Skip to content

Commit 76baa84

Browse files
committed
Comments and improve canonical iv user check
1 parent b8e1bcb commit 76baa84

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

llvm/lib/Transforms/Vectorize/VPlanTransforms.cpp

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1880,8 +1880,6 @@ static VPValue *addVPLaneMaskPhiAndUpdateExitBranch(
18801880
VPValue *AliasMask = nullptr;
18811881

18821882
for (auto C : RTChecks) {
1883-
// FIXME: How to pass this info back?
1884-
// HasAliasMask = true;
18851883
VPValue *Sink =
18861884
vputils::getOrCreateVPValueForSCEVExpr(Plan, C.SinkStart, *PSE.getSE());
18871885
VPValue *Src =
@@ -2023,10 +2021,10 @@ void VPlanTransforms::addActiveLaneMask(
20232021
"DataAndControlFlowWithoutRuntimeCheck implies "
20242022
"UseActiveLaneMaskForControlFlow");
20252023

2026-
auto *FoundWidenCanonicalIVUser =
2027-
find_if(Plan.getCanonicalIV()->users(),
2028-
[](VPUser *U) { return isa<VPWidenCanonicalIVRecipe>(U); });
2029-
assert(FoundWidenCanonicalIVUser && *FoundWidenCanonicalIVUser &&
2024+
auto IVUsers = Plan.getCanonicalIV()->users();
2025+
auto *FoundWidenCanonicalIVUser = find_if(
2026+
IVUsers, [](VPUser *U) { return isa<VPWidenCanonicalIVRecipe>(U); });
2027+
assert(FoundWidenCanonicalIVUser != IVUsers.end() &&
20302028
"Must have widened canonical IV when tail folding!");
20312029
auto *WideCanonicalIV =
20322030
cast<VPWidenCanonicalIVRecipe>(*FoundWidenCanonicalIVUser);

llvm/lib/Transforms/Vectorize/VPlanTransforms.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,7 @@ struct VPlanTransforms {
125125
/// creation) and instead it is handled using active-lane-mask. \p
126126
/// DataAndControlFlowWithoutRuntimeCheck implies \p
127127
/// UseActiveLaneMaskForControlFlow.
128+
/// PSE is the SCEV expander used for values in runtime checks.
128129
/// RTChecks refers to the pointer pairs that need aliasing elements to be
129130
/// masked off each loop iteration.
130131
static void addActiveLaneMask(VPlan &Plan,

0 commit comments

Comments
 (0)