[llvm] [CVP] Flip signedness icmp predicate in use level (PR #69948)
via llvm-commits
llvm-commits at lists.llvm.org
Tue Oct 24 02:46:42 PDT 2023
================
@@ -1246,3 +1246,78 @@ declare <2 x i8> @llvm.umin.v2i8(<2 x i8>, <2 x i8>)
declare <2 x i8> @llvm.umax.v2i8(<2 x i8>, <2 x i8>)
attributes #4 = { noreturn }
+
+define i64 @test_select_flip(i64 noundef %arg) {
+; CHECK-LABEL: @test_select_flip(
+; CHECK-NEXT: entry:
+; CHECK-NEXT: [[CMP1:%.*]] = icmp ult i64 [[ARG:%.*]], 1000
+; CHECK-NEXT: [[CMP2:%.*]] = icmp ult i64 [[ARG]], 100
+; CHECK-NEXT: [[SELECT:%.*]] = select i1 [[CMP1]], i1 [[CMP2]], i1 false
+; CHECK-NEXT: br i1 [[SELECT]], label [[GOOD:%.*]], label [[BAD:%.*]]
+; CHECK: bad:
+; CHECK-NEXT: ret i64 1
+; CHECK: good:
+; CHECK-NEXT: ret i64 0
+;
+entry:
+ %cmp1 = icmp ult i64 %arg, 1000
+ %cmp2 = icmp slt i64 %arg, 100
+ %select = select i1 %cmp1, i1 %cmp2, i1 false
+ br i1 %select, label %good, label %bad
----------------
XChy wrote:
It is a copy from the original issue, so it contains br.
https://github.com/llvm/llvm-project/pull/69948
More information about the llvm-commits
mailing list