1 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
2 ; RUN: opt -S -lower-widenable-condition < %s | FileCheck %s
3 ; RUN: opt -S -passes=lower-widenable-condition < %s | FileCheck %s
5 ; Basic test case: make sure that all widenable conditions turn into i1 true.
6 define void @f_0(i1 %cond_0, i1 %cond_1) {
9 ; CHECK-NEXT: [[EXIPLICIT_GUARD_COND:%.*]] = and i1 [[COND_0:%.*]], true
10 ; CHECK-NEXT: br i1 [[EXIPLICIT_GUARD_COND]], label [[GUARDED:%.*]], label [[DEOPT:%.*]]
12 ; CHECK-NEXT: unreachable
14 ; CHECK-NEXT: [[EXIPLICIT_GUARD_COND4:%.*]] = and i1 [[COND_1:%.*]], true
15 ; CHECK-NEXT: br i1 [[EXIPLICIT_GUARD_COND4]], label [[GUARDED1:%.*]], label [[DEOPT2:%.*]]
17 ; CHECK-NEXT: unreachable
19 ; CHECK-NEXT: ret void
22 %widenable_cond = call i1 @llvm.experimental.widenable.condition()
23 %exiplicit_guard_cond = and i1 %cond_0, %widenable_cond
24 br i1 %exiplicit_guard_cond, label %guarded, label %deopt
26 deopt: ; preds = %entry
29 guarded: ; preds = %entry
30 %widenable_cond3 = call i1 @llvm.experimental.widenable.condition()
31 %exiplicit_guard_cond4 = and i1 %cond_1, %widenable_cond3
32 br i1 %exiplicit_guard_cond4, label %guarded1, label %deopt2
34 deopt2: ; preds = %guarded
37 guarded1: ; preds = %guarded
41 ; Function Attrs: inaccessiblememonly nounwind
42 declare i1 @llvm.experimental.widenable.condition() #0
44 attributes #0 = { inaccessiblememonly nounwind }