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

Florian Hahn via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 8 12:25:50 PDT 2024


================
@@ -2022,6 +2022,34 @@ void VPReductionEVLRecipe::execute(VPTransformState &State) {
   State.set(this, NewRed, /*IsScalar*/ true);
 }
 
+InstructionCost VPReductionRecipe::computeCost(ElementCount VF,
+                                               VPCostContext &Ctx) const {
+  RecurKind RdxKind = RdxDesc.getRecurrenceKind();
+  // TODO: Support any-of reduction and in-loop reduction
----------------
fhahn wrote:

```suggestion
  // TODO: Support any-of reduction and in-loop reductions.
```

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


More information about the llvm-commits mailing list