@@ -2050,6 +2050,10 @@ class VPHeaderPHIRecipe : public VPSingleDefRecipe {
2050
2050
// / Generate the phi nodes.
2051
2051
void execute (VPTransformState &State) override = 0;
2052
2052
2053
+ // / Return the cost of this header phi recipe.
2054
+ InstructionCost computeCost (ElementCount VF,
2055
+ VPCostContext &Ctx) const override ;
2056
+
2053
2057
#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP)
2054
2058
// / Print the recipe.
2055
2059
void print (raw_ostream &O, const Twine &Indent,
@@ -2295,6 +2299,10 @@ struct VPFirstOrderRecurrencePHIRecipe : public VPHeaderPHIRecipe {
2295
2299
2296
2300
void execute (VPTransformState &State) override ;
2297
2301
2302
+ // / Return the cost of this first-order recurrence phi recipe.
2303
+ InstructionCost computeCost (ElementCount VF,
2304
+ VPCostContext &Ctx) const override ;
2305
+
2298
2306
#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP)
2299
2307
// / Print the recipe.
2300
2308
void print (raw_ostream &O, const Twine &Indent,
@@ -3134,6 +3142,13 @@ class VPCanonicalIVPHIRecipe : public VPHeaderPHIRecipe {
3134
3142
// / canonical, i.e. has the same start and step (of 1) as the canonical IV.
3135
3143
bool isCanonical (InductionDescriptor::InductionKind Kind, VPValue *Start,
3136
3144
VPValue *Step) const ;
3145
+
3146
+ // / Return the cost of this VPCanonicalIVPHIRecipe.
3147
+ InstructionCost computeCost (ElementCount VF,
3148
+ VPCostContext &Ctx) const override {
3149
+ // For now, match the behavior of the legacy cost model.
3150
+ return 0 ;
3151
+ }
3137
3152
};
3138
3153
3139
3154
// / A recipe for generating the active lane mask for the vector loop that is
@@ -3196,6 +3211,13 @@ class VPEVLBasedIVPHIRecipe : public VPHeaderPHIRecipe {
3196
3211
// / TODO: investigate if it can share the code with VPCanonicalIVPHIRecipe.
3197
3212
void execute (VPTransformState &State) override ;
3198
3213
3214
+ // / Return the cost of this VPEVLBasedIVPHIRecipe.
3215
+ InstructionCost computeCost (ElementCount VF,
3216
+ VPCostContext &Ctx) const override {
3217
+ // For now, match the behavior of the legacy cost model.
3218
+ return 0 ;
3219
+ }
3220
+
3199
3221
// / Returns true if the recipe only uses the first lane of operand \p Op.
3200
3222
bool onlyFirstLaneUsed (const VPValue *Op) const override {
3201
3223
assert (is_contained (operands (), Op) &&
0 commit comments