Skip to content

Commit c49b0d6

Browse files
committed
!fixup fix formatting
1 parent 8d001b2 commit c49b0d6

File tree

3 files changed

+22
-17
lines changed

3 files changed

+22
-17
lines changed

llvm/lib/Transforms/Vectorize/LoopVectorize.cpp

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10262,8 +10262,10 @@ bool LoopVectorizePass::processLoop(Loop *L) {
1026210262
L, PSE, LI, DT, TLI, TTI, AC, ORE, ElementCount::getFixed(1),
1026310263
ElementCount::getFixed(1), IC, &CM, BFI, PSI, Checks, BestPlan);
1026410264

10265-
// TODO: Move to general VPlan pipeline once epilogue loops are also supported.
10266-
VPlanTransforms::runPass(VPlanTransforms::materializeVectorTripCount, BestPlan, VF.Width, IC, PSE);
10265+
// TODO: Move to general VPlan pipeline once epilogue loops are also
10266+
// supported.
10267+
VPlanTransforms::runPass(VPlanTransforms::materializeVectorTripCount,
10268+
BestPlan, VF.Width, IC, PSE);
1026710269

1026810270
LVP.executePlan(VF.Width, IC, BestPlan, Unroller, DT, false);
1026910271

@@ -10332,8 +10334,10 @@ bool LoopVectorizePass::processLoop(Loop *L) {
1033210334
InnerLoopVectorizer LB(L, PSE, LI, DT, TLI, TTI, AC, ORE, VF.Width,
1033310335
VF.MinProfitableTripCount, IC, &CM, BFI, PSI,
1033410336
Checks, BestPlan);
10335-
// TODO: Move to general VPlan pipeline once epilogue loops are also supported.
10336-
VPlanTransforms::runPass(VPlanTransforms::materializeVectorTripCount, BestPlan, VF.Width, IC, PSE);
10337+
// TODO: Move to general VPlan pipeline once epilogue loops are also
10338+
// supported.
10339+
VPlanTransforms::runPass(VPlanTransforms::materializeVectorTripCount,
10340+
BestPlan, VF.Width, IC, PSE);
1033710341

1033810342
LVP.executePlan(VF.Width, IC, BestPlan, LB, DT, false);
1033910343
++LoopsVectorized;

llvm/lib/Transforms/Vectorize/VPlanTransforms.cpp

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3115,27 +3115,27 @@ void VPlanTransforms::materializeBroadcasts(VPlan &Plan) {
31153115
}
31163116
}
31173117

3118-
void VPlanTransforms::materializeVectorTripCount(VPlan &Plan, ElementCount BestVF,
3119-
unsigned BestUF,
3120-
PredicatedScalarEvolution &PSE) {
3118+
void VPlanTransforms::materializeVectorTripCount(
3119+
VPlan &Plan, ElementCount BestVF, unsigned BestUF,
3120+
PredicatedScalarEvolution &PSE) {
31213121
assert(Plan.hasVF(BestVF) && "BestVF is not available in Plan");
31223122
assert(Plan.hasUF(BestUF) && "BestUF is not available in Plan");
31233123

3124-
VPValue *TC = Plan.getTripCount();
3124+
VPValue *TC = Plan.getTripCount();
31253125
// Skip cases for which the trip count may be non-trivial to materialize.
3126-
if (!Plan.hasScalarTail() || Plan.getMiddleBlock()->getSingleSuccessor() == Plan.getScalarPreheader() || !TC->isLiveIn())
3127-
return;
3126+
if (!Plan.hasScalarTail() ||
3127+
Plan.getMiddleBlock()->getSingleSuccessor() ==
3128+
Plan.getScalarPreheader() ||
3129+
!TC->isLiveIn())
3130+
return;
31283131
// Materialize vector trip counts for constants early if it can simply
31293132
// be computed as (Original TC / VF * UF) * VF * UF.
31303133
ScalarEvolution &SE = *PSE.getSE();
31313134
auto *TCScev = SE.getSCEV(TC->getLiveInIRValue());
3132-
const SCEV *VFxUF =
3133-
SE.getElementCount(TCScev->getType(), BestVF * BestUF);
3134-
auto VecTCScev =
3135-
SE.getMulExpr(SE.getUDivExpr(TCScev, VFxUF), VFxUF);
3135+
const SCEV *VFxUF = SE.getElementCount(TCScev->getType(), BestVF * BestUF);
3136+
auto VecTCScev = SE.getMulExpr(SE.getUDivExpr(TCScev, VFxUF), VFxUF);
31363137
if (auto *NewC = dyn_cast<SCEVConstant>(VecTCScev))
3137-
Plan.getVectorTripCount().setUnderlyingValue(
3138-
NewC->getValue());
3138+
Plan.getVectorTripCount().setUnderlyingValue(NewC->getValue());
31393139
}
31403140

31413141
/// Returns true if \p V is VPWidenLoadRecipe or VPInterleaveRecipe that can be

llvm/lib/Transforms/Vectorize/VPlanTransforms.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,8 @@ struct VPlanTransforms {
222222
/// Add explicit broadcasts for live-ins and VPValues defined in \p Plan's entry block if they are used as vectors.
223223
static void materializeBroadcasts(VPlan &Plan);
224224

225-
// Materialize vector trip counts for constants early if it can simply be computed as (Original TC / VF * UF) * VF * UF.
225+
// Materialize vector trip counts for constants early if it can simply be
226+
// computed as (Original TC / VF * UF) * VF * UF.
226227
static void materializeVectorTripCount(VPlan &Plan, ElementCount BestVF,
227228
unsigned BestUF,
228229
PredicatedScalarEvolution &PSE);

0 commit comments

Comments
 (0)