1 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
2 ; RUN: opt -O1 -S < %s | FileCheck %s
4 ; This is a very convoluted way to write an icmp ule, which comes about by
5 ; matching against a three-way comparison result.
6 define i1 @ule(i32 %a, i32 %b) {
9 ; CHECK-NEXT: [[DOTNOT:%.*]] = icmp ule i32 [[A:%.*]], [[B:%.*]]
10 ; CHECK-NEXT: ret i1 [[DOTNOT]]
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 [
28 %res = phi i1 [ true, %bb ], [ false, %start ]