[llvm-branch-commits] [llvm] [LV] Bundle (partial) reductions with a mul of a constant (PR #162503)

Sander de Smalen via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Thu Oct 23 03:58:27 PDT 2025


================
@@ -3572,9 +3550,38 @@ tryToMatchAndCreateMulAccumulateReduction(VPReductionRecipe *Red,
             ExtCost += Ext1->computeCost(VF, Ctx);
           if (OuterExt)
             ExtCost += OuterExt->computeCost(VF, Ctx);
+          InstructionCost BaseCost = ExtCost + MulCost + RedCost;
 
-          return MulAccCost.isValid() &&
-                 MulAccCost < ExtCost + MulCost + RedCost;
+          if (IsPartialReduction) {
----------------
sdesmalen-arm wrote:

Same as my comment above, this is now a big change and none of the tests change. My suggestion is to keep the code the same as it was, but to create a new PR to add the asserts that partial reduction cost is valid.

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


More information about the llvm-branch-commits mailing list