[llvm] [SelectionDAG] Prevent combination on inconsistent type in `combineCarryDiamond` (PR #84888)

Matt Arsenault via llvm-commits llvm-commits at lists.llvm.org
Tue Mar 12 02:31:30 PDT 2024


================
@@ -1490,3 +1490,26 @@ define { i64, i64 } @addcarry_commutative_2(i64 %x0, i64 %x1, i64 %y0, i64 %y1)
   %r1 = insertvalue { i64, i64 } %r0, i64 %b1s, 1
   ret { i64, i64 } %r1
 }
+
+define i1 @pr84831(i64 %0) {
+; CHECK-LABEL: pr84831:
+; CHECK:       # %bb.0:
+; CHECK-NEXT:    testq %rdi, %rdi
+; CHECK-NEXT:    setne %al
+; CHECK-NEXT:    xorl %ecx, %ecx
+; CHECK-NEXT:    addb $-1, %al
+; CHECK-NEXT:    adcq $1, %rcx
+; CHECK-NEXT:    setb %al
+; CHECK-NEXT:    retq
+  %2 = icmp ult i64 0, %0
----------------
arsenm wrote:

Use opt -S -passes=instnamer to avoid adding anonymous values in tests 

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


More information about the llvm-commits mailing list