Skip to content

Commit 07688d1

Browse files
committed
Revert "[LV] Add option to still enable the legacy cost model. (llvm#99536)"
This reverts commit 9ba5244. Remove the recently added temporary option vectorize-use-legacy-cost-model as discussed on the PR adding it, now that we branched for 19.x.
1 parent 6da6772 commit 07688d1

File tree

1 file changed

+10
-20
lines changed

1 file changed

+10
-20
lines changed

llvm/lib/Transforms/Vectorize/LoopVectorize.cpp

+10-20
Original file line numberDiff line numberDiff line change
@@ -206,11 +206,6 @@ static cl::opt<unsigned> VectorizeMemoryCheckThreshold(
206206
"vectorize-memory-check-threshold", cl::init(128), cl::Hidden,
207207
cl::desc("The maximum allowed number of runtime memory checks"));
208208

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-
214209
// Option prefer-predicate-over-epilogue indicates that an epilogue is undesired,
215210
// that predication is preferred, and this lists all options. I.e., the
216211
// vectorizer will try to fold the tail-loop (epilogue) into the vector body
@@ -9976,9 +9971,8 @@ bool LoopVectorizePass::processLoop(Loop *L) {
99769971
InnerLoopUnroller Unroller(L, PSE, LI, DT, TLI, TTI, AC, ORE, IC, &LVL,
99779972
&CM, BFI, PSI, Checks);
99789973

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() &&
99829976
"VPlan cost model and legacy cost model disagreed");
99839977
LVP.executePlan(VF.Width, IC, BestPlan, Unroller, DT, false);
99849978

@@ -10095,18 +10089,14 @@ bool LoopVectorizePass::processLoop(Loop *L) {
1009510089
if (!MainILV.areSafetyChecksAdded())
1009610090
DisableRuntimeUnroll = true;
1009710091
} 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");
1011010100
InnerLoopVectorizer LB(L, PSE, LI, DT, TLI, TTI, AC, ORE, Width,
1011110101
VF.MinProfitableTripCount, IC, &LVL, &CM, BFI,
1011210102
PSI, Checks);

0 commit comments

Comments
 (0)