1; NOTE: Assertions have been autogenerated by utils/update_test_checks.py 2; RUN: opt -O1 -S < %s | FileCheck %s 3 4; This is a very convoluted way to write an icmp ule, which comes about by 5; matching against a three-way comparison result. 6define i1 @ule(i32 %a, i32 %b) { 7; CHECK-LABEL: @ule( 8; CHECK-NEXT: start: 9; CHECK-NEXT: [[DOTNOT:%.*]] = icmp ule i32 [[A:%.*]], [[B:%.*]] 10; CHECK-NEXT: ret i1 [[DOTNOT]] 11; 12start: 13 %cmp1 = icmp eq i32 %a, %b 14 %cmp2 = icmp ult i32 %a, %b 15 %cmp3 = icmp ne i32 %a, %b 16 %zext = zext i1 %cmp3 to i64 17 %sel1 = select i1 %cmp2, i64 -1, i64 %zext 18 %sel2 = select i1 %cmp1, i64 0, i64 %sel1 19 switch i64 %sel2, label %exit [ 20 i64 -1, label %bb 21 i64 0, label %bb 22 ] 23 24bb: 25 br label %exit 26 27exit: 28 %res = phi i1 [ true, %bb ], [ false, %start ] 29 ret i1 %res 30} 31