[llvm] [LV] Use VPReductionRecipe for partial reductions (PR #147513)

Gaƫtan Bossu via llvm-commits llvm-commits at lists.llvm.org
Thu Nov 20 06:41:42 PST 2025


================
@@ -8278,8 +8292,10 @@ VPRecipeBuilder::tryToCreatePartialReduction(VPInstruction *Reduction,
   VPValue *Cond = nullptr;
   if (CM.blockNeedsPredicationForAnyReason(ReductionI->getParent()))
     Cond = getBlockInMask(Builder.getInsertBlock());
-  return new VPPartialReductionRecipe(ReductionOpcode, Accumulator, BinOp, Cond,
-                                      ScaleFactor, ReductionI);
+
+  return new VPReductionRecipe(
+      RecurKind::Add, FastMathFlags(), ReductionI, Accumulator, BinOp, Cond,
----------------
gbossu wrote:

Previously we passed `ReductionOpcode`, but now it seems dead and we are forcing a `RecurKind::Add` reduction. Do things still work for partial "sub" reductions?

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


More information about the llvm-commits mailing list