1 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
2 ; RUN: opt < %s -S -passes=simplifycfg -bonus-inst-threshold=1 | FileCheck %s
4 declare ptr @llvm.strip.invariant.group.p0(ptr)
9 define void @f(ptr %a, ptr %b, i1 %c, i1 %d, i1 %e) {
11 ; CHECK-NEXT: [[A1:%.*]] = call ptr @llvm.strip.invariant.group.p0(ptr [[A:%.*]])
12 ; CHECK-NEXT: [[B1:%.*]] = call ptr @llvm.strip.invariant.group.p0(ptr [[B:%.*]])
13 ; CHECK-NEXT: [[I:%.*]] = icmp eq ptr [[A1]], [[B1]]
14 ; CHECK-NEXT: [[OR_COND:%.*]] = select i1 [[C:%.*]], i1 [[I]], i1 false
15 ; CHECK-NEXT: br i1 [[OR_COND]], label [[L2:%.*]], label [[L3:%.*]]
17 ; CHECK-NEXT: call void @g1()
18 ; CHECK-NEXT: br label [[RET:%.*]]
20 ; CHECK-NEXT: call void @g2()
21 ; CHECK-NEXT: br label [[RET]]
23 ; CHECK-NEXT: ret void
25 br i1 %c, label %l1, label %l3
27 %a1 = call ptr @llvm.strip.invariant.group.p0(ptr %a)
28 %b1 = call ptr @llvm.strip.invariant.group.p0(ptr %b)
29 %i = icmp eq ptr %a1, %b1
30 br i1 %i, label %l2, label %l3