Skip to content

Commit a12dc43

Browse files
committed
!fixup remove newline, move CostCtx back.
1 parent a0f2172 commit a12dc43

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(
@@ -10156,9 +10155,6 @@ bool LoopVectorizePass::processLoop(Loop *L) {
1015610155

1015710156
GeneratedRTChecks Checks(PSE, DT, LI, TTI, F->getDataLayout(), CM.CostKind);
1015810157
if (LVP.hasPlanWithVF(VF.Width)) {
10159-
VPCostContext CostCtx(CM.TTI, *CM.TLI, CM.Legal->getWidestInductionType(),
10160-
CM, CM.CostKind);
10161-
1016210158
// Select the interleave count.
1016310159
IC = LVP.selectInterleaveCount(LVP.getPlanFor(VF.Width), VF.Width, VF.Cost);
1016410160

@@ -10182,6 +10178,8 @@ bool LoopVectorizePass::processLoop(Loop *L) {
1018210178
// Check if it is profitable to vectorize with runtime checks.
1018310179
bool ForceVectorization =
1018410180
Hints.getForce() == LoopVectorizeHints::FK_Enabled;
10181+
VPCostContext CostCtx(CM.TTI, *CM.TLI, CM.Legal->getWidestInductionType(),
10182+
CM, CM.CostKind);
1018510183
if (!ForceVectorization &&
1018610184
!isOutsideLoopWorkProfitable(Checks, VF, L, PSE, CostCtx,
1018710185
LVP.getPlanFor(VF.Width), SEL,

0 commit comments

Comments
 (0)