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

Florian Hahn via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 25 06:21:02 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:

This computes the cost for non-in loop and non-any-of reductions, correct? Would be good to add an assert an explanation why (for those the cost needs to be pre-computed at the moment)

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


More information about the llvm-commits mailing list