Skip to content

Commit 740f055

Browse files
committed
[VPlan] Rename getBestVF -> computeBestVF (NFC).
As suggested in #103033, more accurately rename to computeBestVF, as it now does not simply return the best VF, but directly computes it.
1 parent 065d2d9 commit 740f055

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

llvm/lib/Transforms/Vectorize/LoopVectorizationPlanner.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -365,9 +365,9 @@ class LoopVectorizationPlanner {
365365
/// Return the best VPlan for \p VF.
366366
VPlan &getBestPlanFor(ElementCount VF) const;
367367

368-
/// Return the most profitable vectorization factor. Also collect all
369-
/// profitable VFs in ProfitableVFs.
370-
ElementCount getBestVF();
368+
/// Compute and return the most profitable vectorization factor. Also collect
369+
/// all profitable VFs in ProfitableVFs.
370+
ElementCount computeBestVF();
371371

372372
/// Generate the IR code for the vectorized loop captured in VPlan \p BestPlan
373373
/// according to the best selected \p VF and \p UF.

llvm/lib/Transforms/Vectorize/LoopVectorize.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7250,7 +7250,7 @@ InstructionCost LoopVectorizationPlanner::cost(VPlan &Plan,
72507250
return Cost;
72517251
}
72527252

7253-
ElementCount LoopVectorizationPlanner::getBestVF() {
7253+
ElementCount LoopVectorizationPlanner::computeBestVF() {
72547254
// If there is a single VPlan with a single VF, return it directly.
72557255
VPlan &FirstPlan = *VPlans[0];
72567256
if (VPlans.size() == 1 && size(FirstPlan.vectorFactors()) == 1)
@@ -9959,7 +9959,7 @@ bool LoopVectorizePass::processLoop(Loop *L) {
99599959
InnerLoopUnroller Unroller(L, PSE, LI, DT, TLI, TTI, AC, ORE, IC, &LVL,
99609960
&CM, BFI, PSI, Checks);
99619961

9962-
ElementCount BestVF = LVP.getBestVF();
9962+
ElementCount BestVF = LVP.computeBestVF();
99639963
assert(BestVF.isScalar() &&
99649964
"VPlan cost model and legacy cost model disagreed");
99659965
VPlan &BestPlan = LVP.getBestPlanFor(BestVF);
@@ -9974,7 +9974,7 @@ bool LoopVectorizePass::processLoop(Loop *L) {
99749974
} else {
99759975
// If we decided that it is *legal* to vectorize the loop, then do it.
99769976

9977-
ElementCount BestVF = LVP.getBestVF();
9977+
ElementCount BestVF = LVP.computeBestVF();
99789978
LLVM_DEBUG(dbgs() << "VF picked by VPlan cost model: " << BestVF << "\n");
99799979
assert(VF.Width == BestVF &&
99809980
"VPlan cost model and legacy cost model disagreed");

0 commit comments

Comments
 (0)