[llvm] [VPlan] First step towards VPlan cost modeling (LegacyCM in CostCtx) (PR #92555)

via llvm-commits llvm-commits at lists.llvm.org
Mon May 27 02:59:38 PDT 2024


================
@@ -734,30 +733,10 @@ void VPRegionBlock::execute(VPTransformState *State) {
   State->Instance.reset();
 }
 
-static InstructionCost computeCostForRecipe(VPRecipeBase *R, ElementCount VF,
-                                            VPCostContext &Ctx) {
-  if (auto *S = dyn_cast<VPSingleDefRecipe>(R)) {
-    auto *UI = dyn_cast_or_null<Instruction>(S->getUnderlyingValue());
-    if (UI && Ctx.skipCostComputation(UI))
-      return 0;
-  }
-
-  InstructionCost RecipeCost = R->computeCost(VF, Ctx);
-  if (ForceTargetInstructionCost.getNumOccurrences() > 0 &&
-      RecipeCost.isValid())
-    RecipeCost = InstructionCost(ForceTargetInstructionCost);
-
-  LLVM_DEBUG({
-    dbgs() << "Cost of " << RecipeCost << " for VF " << VF << ": ";
-    R->dump();
-  });
-  return RecipeCost;
-}
-
 InstructionCost VPBasicBlock::computeCost(ElementCount VF, VPCostContext &Ctx) {
----------------
ayalz wrote:

Should VPlan and VPBlockBase have `cost()` instead of `computeCost()` to align with VPRecipeBase, complementing their mutual `execute()`?

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


More information about the llvm-commits mailing list