Skip to content

Commit cf67360

Browse files
committed
[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.
1 parent 39d751a commit cf67360

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

llvm/lib/Transforms/Vectorize/LoopVectorize.cpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10402,10 +10402,6 @@ bool LoopVectorizePass::processLoop(Loop *L) {
1040210402
if (!MainILV.areSafetyChecksAdded())
1040310403
DisableRuntimeUnroll = true;
1040410404
} else {
10405-
InnerLoopVectorizer LB(L, PSE, LI, DT, TLI, TTI, AC, ORE, VF.Width,
10406-
VF.MinProfitableTripCount, IC, &LVL, &CM, BFI,
10407-
PSI, Checks);
10408-
1040910405
VPlan &BestPlan = LVP.getBestPlan();
1041010406
assert(size(BestPlan.vectorFactors()) == 1 &&
1041110407
"Plan should have a single VF");
@@ -10414,6 +10410,9 @@ bool LoopVectorizePass::processLoop(Loop *L) {
1041410410
<< "\n");
1041510411
assert(VF.Width == Width &&
1041610412
"VPlan cost model and legacy cost model disagreed");
10413+
InnerLoopVectorizer LB(L, PSE, LI, DT, TLI, TTI, AC, ORE, Width,
10414+
VF.MinProfitableTripCount, IC, &LVL, &CM, BFI,
10415+
PSI, Checks);
1041710416
LVP.executePlan(Width, IC, BestPlan, LB, DT, false);
1041810417
++LoopsVectorized;
1041910418

0 commit comments

Comments
 (0)