[llvm] [InstCombine] Fold comparison of adding two z/sext booleans (PR #67895)

via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 2 09:52:36 PDT 2023


================
@@ -879,7 +879,8 @@ define i1 @zext_sext_add_icmp_slt_minus_1_no_oneuse(i1 %a, i1 %b) {
 ; CHECK-NEXT:    [[SEXT_B:%.*]] = sext i1 [[B:%.*]] to i8
 ; CHECK-NEXT:    [[ADD:%.*]] = add nsw i8 [[ZEXT_A]], [[SEXT_B]]
 ; CHECK-NEXT:    call void @use(i8 [[ADD]])
-; CHECK-NEXT:    ret i1 false
+; CHECK-NEXT:    [[R:%.*]] = icmp slt i8 [[ADD]], -1
----------------
elhewaty wrote:

@dtcxzyw can you explain further?

https://github.com/llvm/llvm-project/pull/67895


More information about the llvm-commits mailing list