[llvm] [VPlan] Return Max from computeCost without underlying instrs. (PR #109708)
via llvm-commits
llvm-commits at lists.llvm.org
Tue Oct 8 07:01:44 PDT 2024
================
@@ -276,14 +276,6 @@ static Instruction *getInstructionForCost(const VPRecipeBase *R) {
return dyn_cast_or_null<Instruction>(S->getUnderlyingValue());
if (auto *IG = dyn_cast<VPInterleaveRecipe>(R))
return IG->getInsertPos();
- // Currently the legacy cost model only calculates the instruction cost with
- // underlying instruction. Removing the WidenMem here will prevent
- // force-target-instruction-cost overwriting the cost of recipe with
- // underlying instruction which is inconsistent with the legacy model.
- // TODO: Remove WidenMem from this function when we don't need to compare to
- // the legacy model.
- if (auto *WidenMem = dyn_cast<VPWidenMemoryRecipe>(R))
- return &WidenMem->getIngredient();
----------------
ayalz wrote:
> Nullptr is returned if either the recipe doesn't have an underlying instruction or computeCost is implemented and there is no need for the underlying instruction (i.e. it should not be needed to be skipped)
Regarding the "else" part of this "or" - not needing UI because recipe is not to be skipped is fine (if it's absence from SkipCostComputation it won't be skipped), but would UI still be needed in order to apply ForceTargetInstructionCost?
https://github.com/llvm/llvm-project/pull/109708
More information about the llvm-commits
mailing list