[llvm] [DAG] Fold nested add(add(reduce(a), b), add(reduce(c), d)) (PR #115150)

David Sherwood via llvm-commits llvm-commits at lists.llvm.org
Fri Nov 15 02:36:31 PST 2024


================
@@ -17107,12 +17129,15 @@ SDValue DAGCombiner::visitFADD(SDNode *N) {
                            DAG.getConstantFP(4.0, DL, VT));
       }
     }
+  } // enable-unsafe-fp-math && AllowNewConst
 
+  if (((Options.UnsafeFPMath && Options.NoSignedZerosFPMath) ||
+       (Flags.hasAllowReassociation() && Flags.hasNoSignedZeros()))) {
----------------
david-arm wrote:

Does removing the `AllowNewConst` restriction from the reassociateReduction call have any effect on the tests. Just wondering if this is worth a separate PR?

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


More information about the llvm-commits mailing list