1 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
2 ; RUN: opt -S -passes=simplifycfg -simplifycfg-require-and-preserve-domtree=1 < %s | FileCheck %s
4 define void @pr46638(i1 %c, i32 %x) {
5 ; CHECK-LABEL: @pr46638(
6 ; CHECK-NEXT: [[CMP1:%.*]] = icmp slt i32 [[X:%.*]], 0
7 ; CHECK-NEXT: call void @llvm.assume(i1 [[CMP1]])
8 ; CHECK-NEXT: br i1 [[C:%.*]], label [[TRUE2_CRITEDGE:%.*]], label [[FALSE1:%.*]]
10 ; CHECK-NEXT: call void @dummy(i32 1)
11 ; CHECK-NEXT: [[CMP2:%.*]] = icmp sgt i32 [[X]], 0
12 ; CHECK-NEXT: [[EXT:%.*]] = zext i1 [[CMP2]] to i32
13 ; CHECK-NEXT: call void @dummy(i32 [[EXT]])
14 ; CHECK-NEXT: br label [[COMMON_RET:%.*]]
16 ; CHECK-NEXT: ret void
17 ; CHECK: true2.critedge:
18 ; CHECK-NEXT: call void @dummy(i32 0)
19 ; CHECK-NEXT: call void @dummy(i32 2)
20 ; CHECK-NEXT: br label [[COMMON_RET]]
22 %cmp1 = icmp slt i32 %x, 0
23 call void @llvm.assume(i1 %cmp1)
24 br i1 %c, label %true1, label %false1
27 %cmp2 = icmp sgt i32 %x, 0
28 %ext = zext i1 %cmp2 to i32
29 call void @dummy(i32 %ext)
30 br i1 %c, label %true2, label %false2
33 call void @dummy(i32 1)
37 call void @dummy(i32 2)
44 declare void @dummy(i32)
45 declare void @llvm.assume(i1)