@@ -206,11 +206,6 @@ static cl::opt<unsigned> VectorizeMemoryCheckThreshold(
206
206
" vectorize-memory-check-threshold" , cl::init(128 ), cl::Hidden,
207
207
cl::desc(" The maximum allowed number of runtime memory checks" ));
208
208
209
- static cl::opt<bool > UseLegacyCostModel (
210
- " vectorize-use-legacy-cost-model" , cl::init(false ), cl::Hidden,
211
- cl::desc(" Use the legacy cost model instead of the VPlan-based cost model. "
212
- " This option will be removed in the future." ));
213
-
214
209
// Option prefer-predicate-over-epilogue indicates that an epilogue is undesired,
215
210
// that predication is preferred, and this lists all options. I.e., the
216
211
// vectorizer will try to fold the tail-loop (epilogue) into the vector body
@@ -9976,9 +9971,8 @@ bool LoopVectorizePass::processLoop(Loop *L) {
9976
9971
InnerLoopUnroller Unroller (L, PSE, LI, DT, TLI, TTI, AC, ORE, IC, &LVL,
9977
9972
&CM, BFI, PSI, Checks);
9978
9973
9979
- VPlan &BestPlan =
9980
- UseLegacyCostModel ? LVP.getBestPlanFor (VF.Width ) : LVP.getBestPlan ();
9981
- assert ((UseLegacyCostModel || BestPlan.hasScalarVFOnly ()) &&
9974
+ VPlan &BestPlan = LVP.getBestPlan ();
9975
+ assert (BestPlan.hasScalarVFOnly () &&
9982
9976
" VPlan cost model and legacy cost model disagreed" );
9983
9977
LVP.executePlan (VF.Width , IC, BestPlan, Unroller, DT, false );
9984
9978
@@ -10095,18 +10089,14 @@ bool LoopVectorizePass::processLoop(Loop *L) {
10095
10089
if (!MainILV.areSafetyChecksAdded ())
10096
10090
DisableRuntimeUnroll = true ;
10097
10091
} else {
10098
- ElementCount Width = VF.Width ;
10099
- VPlan &BestPlan =
10100
- UseLegacyCostModel ? LVP.getBestPlanFor (Width) : LVP.getBestPlan ();
10101
- if (!UseLegacyCostModel) {
10102
- assert (size (BestPlan.vectorFactors ()) == 1 &&
10103
- " Plan should have a single VF" );
10104
- Width = *BestPlan.vectorFactors ().begin ();
10105
- LLVM_DEBUG (dbgs ()
10106
- << " VF picked by VPlan cost model: " << Width << " \n " );
10107
- assert (VF.Width == Width &&
10108
- " VPlan cost model and legacy cost model disagreed" );
10109
- }
10092
+ VPlan &BestPlan = LVP.getBestPlan ();
10093
+ assert (size (BestPlan.vectorFactors ()) == 1 &&
10094
+ " Plan should have a single VF" );
10095
+ ElementCount Width = *BestPlan.vectorFactors ().begin ();
10096
+ LLVM_DEBUG (dbgs () << " VF picked by VPlan cost model: " << Width
10097
+ << " \n " );
10098
+ assert (VF.Width == Width &&
10099
+ " VPlan cost model and legacy cost model disagreed" );
10110
10100
InnerLoopVectorizer LB (L, PSE, LI, DT, TLI, TTI, AC, ORE, Width,
10111
10101
VF.MinProfitableTripCount , IC, &LVL, &CM, BFI,
10112
10102
PSI, Checks);
0 commit comments