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

Sam Tebbs via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 7 05:56:58 PDT 2025


================
@@ -2849,6 +2857,19 @@ InstructionCost VPExpressionRecipe::computeCost(ElementCount VF,
     Opcode = Instruction::Sub;
     LLVM_FALLTHROUGH;
   case ExpressionTypes::ExtMulAccReduction: {
+    if (isa<VPPartialReductionRecipe>(ExpressionRecipes.back())) {
+      auto *Ext0R = cast<VPWidenCastRecipe>(ExpressionRecipes[0]);
+      auto *Ext1R = cast<VPWidenCastRecipe>(ExpressionRecipes[1]);
----------------
SamTebbs33 wrote:

Yeah the matching function in `VPlanTransforms` explicitly checks for two extends, so the constant variant doesn't get bundled currently. I'm happy to get that working separately if necessary.

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


More information about the llvm-commits mailing list