[llvm] [X86] Fix CCMP miscompile for flag-source-folded SETCC leaves (PR #217682)

Phoebe Wang via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 21 20:01:26 PDT 2026


================
@@ -105,11 +96,10 @@ define i32 @stored_and_vs_zero_interior(i32 %x, i32 %y, i32 %p, i32 %q, i32 %v,
 define i32 @eq_reuses_live_xor_interior(i32 %x, i32 %y, i32 %p, i32 %q, i32 %v, ptr %s) {
 ; CHECK-LABEL: eq_reuses_live_xor_interior:
 ; CHECK:       # %bb.0:
-; CHECK-NEXT:    movl %edi, %eax
-; CHECK-NEXT:    xorl %esi, %eax
-; CHECK-NEXT:    movl %eax, (%r9)
+; CHECK-NEXT:    xorl %esi, %edi
+; CHECK-NEXT:    movl %edi, (%r9)
 ; CHECK-NEXT:    cmpl %ecx, %edx
-; CHECK-NEXT:    ccmpll {dfv=} %esi, %edi
+; CHECK-NEXT:    ctestll {dfv=} %edi, %edi
----------------
phoebewang wrote:

Seems we can generate a single ccmp that reusing ZF of XOR. Anyway, not need to do in this patch.

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


More information about the llvm-commits mailing list