Skip to content

Commit 8f18d73

Browse files
committed
[VPlan] Refine name/comment
1 parent 46df34a commit 8f18d73

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

llvm/lib/Transforms/Vectorize/VPlanTransforms.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -517,7 +517,7 @@ static void removeRedundantCanonicalIVs(VPlan &Plan) {
517517
// everything WidenNewIV's users need. That is, WidenOriginalIV will
518518
// generate a vector phi or all users of WidenNewIV demand the first lane
519519
// only.
520-
if (!vputils::onlyUsedByScalars(WidenOriginalIV) ||
520+
if (!vputils::onlyScalarValuesUsed(WidenOriginalIV) ||
521521
vputils::onlyFirstLaneUsed(WidenNewIV)) {
522522
WidenNewIV->replaceAllUsesWith(WidenOriginalIV);
523523
WidenNewIV->eraseFromParent();
@@ -1261,7 +1261,7 @@ static void narrowToSingleScalarRecipes(VPlan &Plan) {
12611261
// scalar results used. In the latter case, we would introduce extra
12621262
// broadcasts.
12631263
if (!vputils::isSingleScalar(RepOrWidenR) ||
1264-
!vputils::onlyUsedByScalars(RepOrWidenR))
1264+
!vputils::onlyScalarValuesUsed(RepOrWidenR))
12651265
continue;
12661266

12671267
auto *Clone = new VPReplicateRecipe(RepOrWidenR->getUnderlyingInstr(),
@@ -3214,7 +3214,7 @@ void VPlanTransforms::materializeBroadcasts(VPlan &Plan) {
32143214

32153215
auto *VectorPreheader = Plan.getVectorPreheader();
32163216
for (VPValue *VPV : VPValues) {
3217-
if (vputils::onlyUsedByScalars(VPV) ||
3217+
if (vputils::onlyScalarValuesUsed(VPV) ||
32183218
(VPV->isLiveIn() && VPV->getLiveInIRValue() &&
32193219
isa<Constant>(VPV->getLiveInIRValue())))
32203220
continue;
@@ -3370,7 +3370,7 @@ void VPlanTransforms::materializeVFAndVFxUF(VPlan &Plan, VPBasicBlock *VectorPH,
33703370
// For users of the runtime VF, compute it as VF * vscale, and VFxUF as (VF *
33713371
// vscale) * UF.
33723372
VPValue *RuntimeVF = Builder.createElementCount(TCTy, VFEC);
3373-
if (!vputils::onlyUsedByScalars(&VF)) {
3373+
if (!vputils::onlyScalarValuesUsed(&VF)) {
33743374
VPValue *BC = Builder.createNaryOp(VPInstruction::Broadcast, RuntimeVF);
33753375
VF.replaceUsesWithIf(
33763376
BC, [&VF](VPUser &U, unsigned) { return !U.usesScalars(&VF); });

llvm/lib/Transforms/Vectorize/VPlanUtils.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ bool vputils::onlyFirstPartUsed(const VPValue *Def) {
2424
[Def](const VPUser *U) { return U->onlyFirstPartUsed(Def); });
2525
}
2626

27-
bool vputils::onlyUsedByScalars(const VPValue *Def) {
27+
bool vputils::onlyScalarValuesUsed(const VPValue *Def) {
2828
return all_of(Def->users(),
2929
[Def](const VPUser *U) { return U->usesScalars(Def); });
3030
}

llvm/lib/Transforms/Vectorize/VPlanUtils.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ bool onlyFirstLaneUsed(const VPValue *Def);
2525
/// Returns true if only the first part of \p Def is used.
2626
bool onlyFirstPartUsed(const VPValue *Def);
2727

28-
/// Returns true if \p Def is only used by scalars.
29-
bool onlyUsedByScalars(const VPValue *Def);
28+
/// Returns true if only scalar values of \p Def is used by all users.
29+
bool onlyScalarValuesUsed(const VPValue *Def);
3030

3131
/// Get or create a VPValue that corresponds to the expansion of \p Expr. If \p
3232
/// Expr is a SCEVConstant or SCEVUnknown, return a VPValue wrapping the live-in

0 commit comments

Comments
 (0)