1 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
2 ; RUN: opt -S -passes=guard-widening < %s | FileCheck %s
4 declare void @llvm.experimental.deoptimize.isVoid(...)
5 declare i1 @llvm.experimental.widenable.condition()
7 ; In the current scheme we widen `br i1 %and1`, so we try to build
8 ; `and i1 poison, %and1` using `%call0` as insertion point.
9 ; That's not possible, so widening will not occur in the case.
10 ; TODO: Widen `%call0` in the test case, not a branch.
14 ; CHECK-NEXT: [[CALL0:%.*]] = call i1 @llvm.experimental.widenable.condition()
15 ; CHECK-NEXT: [[AND0:%.*]] = and i1 false, [[CALL0]]
16 ; CHECK-NEXT: [[AND1:%.*]] = and i1 false, [[AND0]]
17 ; CHECK-NEXT: br i1 [[AND1]], label [[BB1:%.*]], label [[DEOPT:%.*]]
19 ; CHECK-NEXT: [[CALL1:%.*]] = call i1 @llvm.experimental.widenable.condition()
20 ; CHECK-NEXT: [[AND2:%.*]] = and i1 poison, [[CALL1]]
21 ; CHECK-NEXT: br i1 [[AND2]], label [[UNREACH:%.*]], label [[DEOPT]]
23 ; CHECK-NEXT: unreachable
25 ; CHECK-NEXT: call void (...) @llvm.experimental.deoptimize.isVoid(i32 0) [ "deopt"(i32 0) ]
26 ; CHECK-NEXT: ret void
29 %call0 = call i1 @llvm.experimental.widenable.condition()
30 %and0 = and i1 false, %call0
31 %and1 = and i1 false, %and0
32 br i1 %and1, label %bb1, label %deopt
35 %call1 = call i1 @llvm.experimental.widenable.condition()
36 %and2 = and i1 poison, %call1
37 br i1 %and2, label %unreach, label %deopt
43 call void (...) @llvm.experimental.deoptimize.isVoid(i32 0) [ "deopt"(i32 0) ]