Skip to content

Commit 0a3ac0c

Browse files
committed
!fixup remove newline, move CostCtx back.
1 parent d560abe commit 0a3ac0c

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

llvm/lib/Transforms/Vectorize/LoopVectorize.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4910,7 +4910,6 @@ LoopVectorizationPlanner::selectInterleaveCount(VPlan &Plan, ElementCount VF,
49104910
any_of(Plan.getVectorLoopRegion()->getEntryBasicBlock()->phis(),
49114911
[](VPRecipeBase &R) {
49124912
auto *RedR = dyn_cast<VPReductionPHIRecipe>(&R);
4913-
49144913
return RedR && (RecurrenceDescriptor::isAnyOfRecurrenceKind(
49154914
RedR->getRecurrenceKind()) ||
49164915
RecurrenceDescriptor::isFindIVRecurrenceKind(
@@ -10149,9 +10148,6 @@ bool LoopVectorizePass::processLoop(Loop *L) {
1014910148

1015010149
GeneratedRTChecks Checks(PSE, DT, LI, TTI, F->getDataLayout(), CM.CostKind);
1015110150
if (LVP.hasPlanWithVF(VF.Width)) {
10152-
VPCostContext CostCtx(CM.TTI, *CM.TLI, CM.Legal->getWidestInductionType(),
10153-
CM, CM.CostKind);
10154-
1015510151
// Select the interleave count.
1015610152
IC = LVP.selectInterleaveCount(LVP.getPlanFor(VF.Width), VF.Width, VF.Cost);
1015710153

@@ -10175,6 +10171,8 @@ bool LoopVectorizePass::processLoop(Loop *L) {
1017510171
// Check if it is profitable to vectorize with runtime checks.
1017610172
bool ForceVectorization =
1017710173
Hints.getForce() == LoopVectorizeHints::FK_Enabled;
10174+
VPCostContext CostCtx(CM.TTI, *CM.TLI, CM.Legal->getWidestInductionType(),
10175+
CM, CM.CostKind);
1017810176
if (!ForceVectorization &&
1017910177
!isOutsideLoopWorkProfitable(Checks, VF, L, PSE, CostCtx,
1018010178
LVP.getPlanFor(VF.Width), SEL,

0 commit comments

Comments
 (0)