[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
================
@@ -312,15 +311,19 @@ InstructionCost VPRecipeBase::cost(ElementCount VF, VPCostContext &Ctx) {
InstructionCost VPRecipeBase::computeCost(ElementCount VF,
VPCostContext &Ctx) const {
// Compute the cost for the recipe falling back to the legacy cost model using
- // the underlying instruction. If there is no underlying instruction, returns
- // 0.
+ // the underlying instruction. If there is no underlying instruction or the
+ // cost is computed by the recipe's computeCost, returns
+ // InstructionCost::getMax. It is used as a sentinel value to detect recipes
+ // without underlying instructions for which no forced target instruction cost
+ // should be applied.
----------------
ayalz wrote:
```suggestion
// without underlying instructions for which forced target instruction cost
// should not be applied.
```
https://github.com/llvm/llvm-project/pull/109708
More information about the llvm-commits
mailing list