brintos

brintos / llvm-project-archived public Read only

0
0
Text · 827 B · 6d4a8e3 Raw
31 lines · plain
1; NOTE: Assertions have been autogenerated by utils/update_test_checks.py2; RUN: opt -O1 -S < %s | FileCheck %s3 4; This is a very convoluted way to write an icmp ule, which comes about by5; 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:    [[SWITCH_SELECTCMP1:%.*]] = icmp ule i32 [[A:%.*]], [[B:%.*]]10; CHECK-NEXT:    ret i1 [[SWITCH_SELECTCMP1]]11;12start:13  %cmp1 = icmp eq i32 %a, %b14  %cmp2 = icmp ult i32 %a, %b15  %cmp3 = icmp ne i32 %a, %b16  %zext = zext i1 %cmp3 to i6417  %sel1 = select i1 %cmp2, i64 -1, i64 %zext18  %sel2 = select i1 %cmp1, i64 0, i64 %sel119  switch i64 %sel2, label %exit [20  i64 -1, label %bb21  i64 0, label %bb22  ]23 24bb:25  br label %exit26 27exit:28  %res = phi i1 [ true, %bb ], [ false, %start ]29  ret i1 %res30}31