1 ; RUN: llvm-reduce --abort-on-invalid-reduction --delta-passes=unreachable-basic-blocks,basic-blocks --test FileCheck --test-arg --check-prefixes=CHECK-INTERESTINGNESS --test-arg %s --test-arg --input-file %s -o %t
2 ; RUN: FileCheck %s < %t
5 ; CHECK-INTERESTINGNESS: @func(
7 ; CHECK-INTERESTINGNESS: store
8 ; CHECK-INTERESTINGNESS: store
9 ; CHECK-INTERESTINGNESS: store
13 ; CHECK-NEXT: br i1 %arg1, label %bb3, label %bb7
15 ; CHECK: bb3: ; preds = %bb
16 ; CHECK-NEXT: br i1 %arg2, label %bb4, label %bb7
18 ; CHECK: bb4: ; preds = %bb3
19 ; CHECK-NEXT: store i32 0, ptr addrspace(1) null, align 4
20 ; CHECK-NEXT: ret void
22 ; CHECK: bb7: ; preds = %bb3, %bb
23 ; CHECK-NEXT: %i = phi i1 [ false, %bb ], [ true, %bb3 ]
24 ; CHECK-NEXT: store i32 1, ptr addrspace(1) null, align 4
25 ; CHECK-NEXT: br label %bb10
27 ; CHECK: bb10: ; preds = %bb7
28 ; CHECK-NEXT: store i32 2, ptr addrspace(1) null, align 4
29 ; CHECK-NEXT: unreachable
30 define amdgpu_kernel void @func(i1 %arg, i1 %arg1, i1 %arg2) {
32 br i1 %arg1, label %bb3, label %bb7
35 br i1 %arg2, label %bb4, label %bb7
38 store i32 0, ptr addrspace(1) null
44 bb6: ; No predecessors!
47 bb7: ; preds = %bb3, %bb
48 %i = phi i1 [ false, %bb ], [ true, %bb3 ]
49 store i32 1, ptr addrspace(1) null
50 br i1 %arg, label %bb10, label %bb8
53 br i1 %i, label %bb9, label %bb9
55 bb9: ; preds = %bb8, %bb8
59 store i32 2, ptr addrspace(1) null