[llvm-branch-commits] [llvm] [LV] Bundle partial reductions inside VPExpressionRecipe (PR #147302)

Sander de Smalen via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Tue Aug 26 07:29:13 PDT 2025


================
@@ -2678,6 +2684,23 @@ InstructionCost VPExpressionRecipe::computeCost(ElementCount VF,
   case ExpressionTypes::ExtNegatedMulAccReduction:
   case ExpressionTypes::ExtMulAccReduction: {
     bool Negated = ExpressionType == ExpressionTypes::ExtNegatedMulAccReduction;
+    if (isa<VPPartialReductionRecipe>(ExpressionRecipes.back())) {
+      auto *Ext0R = cast<VPWidenCastRecipe>(ExpressionRecipes[0]);
+      auto *Ext1R = cast<VPWidenCastRecipe>(ExpressionRecipes[1]);
+      auto *Mul = cast<VPWidenRecipe>(ExpressionRecipes[2]);
+      unsigned Opcode =
----------------
sdesmalen-arm wrote:

should (in-loop) `VPReductionRecipe` also consider a sub reduction? (`TTI.getMulAccReductionCost` does not take an opcode at the moment)

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


More information about the llvm-branch-commits mailing list