1; NOTE: Assertions have been autogenerated by utils/update_test_checks.py 2; RUN: opt -constraint-elimination -S %s | FileCheck %s 3 4declare void @use(i1) 5 6define i32 @test_or_ule(i32 %x, i32 %y, i32 %z, i32 %a) { 7; CHECK-LABEL: @test_or_ule( 8; CHECK-NEXT: entry: 9; CHECK-NEXT: [[C_1:%.*]] = icmp ule i32 [[X:%.*]], [[Y:%.*]] 10; CHECK-NEXT: [[C_2:%.*]] = icmp ule i32 [[Y]], [[Z:%.*]] 11; CHECK-NEXT: [[OR:%.*]] = or i1 [[C_1]], [[C_2]] 12; CHECK-NEXT: br i1 [[OR]], label [[BB1:%.*]], label [[EXIT:%.*]] 13; CHECK: bb1: 14; CHECK-NEXT: [[C_3:%.*]] = icmp ule i32 [[X]], [[Z]] 15; CHECK-NEXT: call void @use(i1 [[C_3]]) 16; CHECK-NEXT: [[C_4:%.*]] = icmp ule i32 [[X]], [[A:%.*]] 17; CHECK-NEXT: call void @use(i1 [[C_4]]) 18; CHECK-NEXT: ret i32 10 19; CHECK: exit: 20; CHECK-NEXT: [[F_1:%.*]] = icmp ule i32 [[X]], [[Z]] 21; CHECK-NEXT: call void @use(i1 false) 22; CHECK-NEXT: [[C_5:%.*]] = icmp ule i32 [[X]], [[A]] 23; CHECK-NEXT: call void @use(i1 [[C_5]]) 24; CHECK-NEXT: [[T_1:%.*]] = icmp ugt i32 [[Y]], [[Z]] 25; CHECK-NEXT: call void @use(i1 true) 26; CHECK-NEXT: [[T_2:%.*]] = icmp ugt i32 [[X]], [[Y]] 27; CHECK-NEXT: call void @use(i1 true) 28; CHECK-NEXT: [[T_3:%.*]] = icmp ugt i32 [[X]], [[Z]] 29; CHECK-NEXT: call void @use(i1 true) 30; CHECK-NEXT: ret i32 20 31; 32entry: 33 %c.1 = icmp ule i32 %x, %y 34 %c.2 = icmp ule i32 %y, %z 35 %or = or i1 %c.1, %c.2 36 br i1 %or, label %bb1, label %exit 37 38bb1: 39 %c.3 = icmp ule i32 %x, %z 40 call void @use(i1 %c.3) 41 42 %c.4 = icmp ule i32 %x, %a 43 call void @use(i1 %c.4) 44 45 ret i32 10 46 47exit: 48 %f.1 = icmp ule i32 %x, %z 49 call void @use(i1 %f.1) 50 51 %c.5 = icmp ule i32 %x, %a 52 call void @use(i1 %c.5) 53 54 %t.1 = icmp ugt i32 %y, %z 55 call void @use(i1 %t.1) 56 57 %t.2 = icmp ugt i32 %x, %y 58 call void @use(i1 %t.2) 59 60 %t.3 = icmp ugt i32 %x, %z 61 call void @use(i1 %t.3) 62 63 ret i32 20 64} 65