[llvm] [VPlan] Implement VPReductionRecipe::computeCost(). NFC (PR #107790)

Florian Hahn via llvm-commits llvm-commits at lists.llvm.org
Fri Oct 4 02:25:14 PDT 2024


================
@@ -1999,6 +1999,27 @@ void VPReductionEVLRecipe::execute(VPTransformState &State) {
   State.set(this, NewRed, 0, /*IsScalar*/ true);
 }
 
+InstructionCost VPReductionRecipe::computeCost(ElementCount VF,
+                                               VPCostContext &Ctx) const {
+  RecurKind RdxKind = RdxDesc.getRecurrenceKind();
----------------
fhahn wrote:

It would probably be better to add support for in-loop reductions separately, as it adds extra complexity and may introduce new divergences

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


More information about the llvm-commits mailing list