1 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
2 ; RUN: opt -S -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: [[CMP2_C:%.*]] = icmp sgt i32 [[X]], 0
19 ; CHECK-NEXT: [[EXT_C:%.*]] = zext i1 [[CMP2_C]] to i32
20 ; CHECK-NEXT: call void @dummy(i32 [[EXT_C]])
21 ; CHECK-NEXT: call void @dummy(i32 2)
22 ; CHECK-NEXT: br label [[COMMON_RET]]
24 %cmp1 = icmp slt i32 %x, 0
25 call void @llvm.assume(i1 %cmp1)
26 br i1 %c, label %true1, label %false1
29 %cmp2 = icmp sgt i32 %x, 0
30 %ext = zext i1 %cmp2 to i32
31 call void @dummy(i32 %ext)
32 br i1 %c, label %true2, label %false2
35 call void @dummy(i32 1)
39 call void @dummy(i32 2)
46 declare void @dummy(i32)
47 declare void @llvm.assume(i1)