1 ; RUN: llvm-reduce --abort-on-invalid-reduction --delta-passes=basic-blocks --test=FileCheck --test-arg=--check-prefix=CHECK-INTERESTINGNESS --test-arg=%s --test-arg=--input-file %s -o %t
2 ; RUN: FileCheck %s < %t
4 ; Make sure an invalid reduction isn't tried when deleting %bb5,
5 ; causing the or in %bb6 to use its own output value.
8 ; CHECK-INTERESTINGNESS: store i32 0
9 ; CHECK-INTERESTINGNESS: store i32 1
10 ; CHECK-INTERESTINGNESS: store i32 2
13 ; CHECK-NEXT: br label %bb5
19 ; CHECK-NEXT: %tmp = phi i32 [ %tmp7, %bb6 ]
20 ; CHECK-NEXT: store i32 1
21 ; CHECK-NEXT: %tmp7 = or i32 %tmp, 0
22 ; CHECK-NEXT: br label %bb6
26 ; CHECK-NEXT: store i32 2,
27 define amdgpu_kernel void @snork(i32 %arg, i1 %arg1) {
29 store i32 0, ptr addrspace(3) null
30 br i1 %arg1, label %bb5, label %bb7
32 bb5: ; preds = %bb5, %bb
33 switch i32 %arg, label %bb5 [
38 bb6: ; preds = %bb6, %bb5
39 %tmp = phi i32 [ %tmp7, %bb6 ], [ 0, %bb5 ]
40 store i32 1, ptr addrspace(3) null
41 %tmp7 = or i32 %tmp, 0
45 store i32 3, ptr addrspace(3) null
49 store i32 2, ptr addrspace(3) null