[llvm] cf67360 - [LV] Use VF from selected plan when creating InnerLoopVectorizer.
Florian Hahn via llvm-commits
llvm-commits at lists.llvm.org
Wed Jul 17 02:30:17 PDT 2024
Author: Florian Hahn
Date: 2024-07-17T10:29:58+01:00
New Revision: cf673604c16cc3aeee604642a2c6ea30b0eeeaba
URL: https://github.com/llvm/llvm-project/commit/cf673604c16cc3aeee604642a2c6ea30b0eeeaba
DIFF: https://github.com/llvm/llvm-project/commit/cf673604c16cc3aeee604642a2c6ea30b0eeeaba.diff
LOG: [LV] Use VF from selected plan when creating InnerLoopVectorizer.
This makes sure the same VF is used when executing the plan and in the
functions in InnerLoopVectorizer when the assertion is disabled (e.g.
release builds).
No tests added as they would trigger an assertion.
Added:
Modified:
llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
Removed:
################################################################################
diff --git a/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp b/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
index 1481ddffe6b26..3bdb545946e2b 100644
--- a/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
+++ b/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
@@ -10402,10 +10402,6 @@ bool LoopVectorizePass::processLoop(Loop *L) {
if (!MainILV.areSafetyChecksAdded())
DisableRuntimeUnroll = true;
} else {
- InnerLoopVectorizer LB(L, PSE, LI, DT, TLI, TTI, AC, ORE, VF.Width,
- VF.MinProfitableTripCount, IC, &LVL, &CM, BFI,
- PSI, Checks);
-
VPlan &BestPlan = LVP.getBestPlan();
assert(size(BestPlan.vectorFactors()) == 1 &&
"Plan should have a single VF");
@@ -10414,6 +10410,9 @@ bool LoopVectorizePass::processLoop(Loop *L) {
<< "\n");
assert(VF.Width == Width &&
"VPlan cost model and legacy cost model disagreed");
+ InnerLoopVectorizer LB(L, PSE, LI, DT, TLI, TTI, AC, ORE, Width,
+ VF.MinProfitableTripCount, IC, &LVL, &CM, BFI,
+ PSI, Checks);
LVP.executePlan(Width, IC, BestPlan, LB, DT, false);
++LoopsVectorized;
More information about the llvm-commits
mailing list