[llvm] [X86] Optimized ADD + ADC to ADC (PR #173543)

Sebastian Buchwald via llvm-commits llvm-commits at lists.llvm.org
Wed Dec 31 12:18:17 PST 2025


================
@@ -58242,8 +58253,7 @@ static SDValue combineADC(SDNode *N, SelectionDAG &DAG,
 
   // Fold ADC(ADD(X,Y),0,Carry) -> ADC(X,Y,Carry)
   // iff the flag result is dead.
-  if (LHS.getOpcode() == ISD::ADD && RHSC && RHSC->isZero() &&
-      !N->hasAnyUseOfValue(1))
+  if (LHS.getOpcode() == ISD::ADD && RHSC && RHSC->isZero())
----------------
UniQP wrote:

The removed condition was there because the carry/overflow flags may differ after the optimization. We need to check that these flags are not used.

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


More information about the llvm-commits mailing list