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

Sam Tebbs via llvm-commits llvm-commits at lists.llvm.org
Tue Jun 24 08:18:47 PDT 2025


================
@@ -2591,24 +2528,46 @@ VPExtendedReductionRecipe::computeCost(ElementCount VF,
       cast<VectorType>(toVectorTy(Ctx.Types.inferScalarType(getVecOp()), VF));
   assert(RedTy->isIntegerTy() &&
          "ExtendedReduction only support integer type currently.");
+  if (isPartialReduction())
+    return Ctx.TTI.getPartialReductionCost(Opcode, RedTy, SrcVecTy, SrcVecTy,
+                                           VF, TargetTransformInfo::PR_None,
----------------
SamTebbs33 wrote:

Exactly, see here for the request to use the base case of no extends: https://github.com/llvm/llvm-project/pull/144908#discussion_r2159268837

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


More information about the llvm-commits mailing list