Skip to content

Commit cfb9a06

Browse files
committed
!fixup address comments, thanks
1 parent 60c0b14 commit cfb9a06

File tree

1 file changed

+7
-9
lines changed

1 file changed

+7
-9
lines changed

llvm/lib/Transforms/Vectorize/LoopVectorize.cpp

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9138,22 +9138,20 @@ void LoopVectorizationPlanner::buildVPlansWithVPRecipes(ElementCount MinVF,
91389138
ElementCount MaxVF) {
91399139
assert(OrigLoop->isInnermost() && "Inner loop expected.");
91409140

9141-
// Only use noalias metadata when using memory checks guaranteeing no overlap
9142-
// across all iterations.
91439141
const LoopAccessInfo *LAI = Legal->getLAI();
9144-
std::unique_ptr<LoopVersioning> LVer = nullptr;
9145-
if (LAI && !LAI->getRuntimePointerChecking()->getChecks().empty() &&
9142+
LoopVersioning LVer(*LAI, LAI->getRuntimePointerChecking()->getChecks(),
9143+
OrigLoop, LI, DT, PSE.getSE());
9144+
if (!LAI->getRuntimePointerChecking()->getChecks().empty() &&
91469145
!LAI->getRuntimePointerChecking()->getDiffChecks()) {
9147-
LVer = std::make_unique<LoopVersioning>(
9148-
*LAI, LAI->getRuntimePointerChecking()->getChecks(), OrigLoop, LI, DT,
9149-
PSE.getSE());
9150-
LVer->prepareNoAliasMetadata();
9146+
// Only use noalias metadata when using memory checks guaranteeing no
9147+
// overlap across all iterations.
9148+
LVer.prepareNoAliasMetadata();
91519149
}
91529150

91539151
auto MaxVFTimes2 = MaxVF * 2;
91549152
for (ElementCount VF = MinVF; ElementCount::isKnownLT(VF, MaxVFTimes2);) {
91559153
VFRange SubRange = {VF, MaxVFTimes2};
9156-
if (auto Plan = tryToBuildVPlanWithVPRecipes(SubRange, LVer.get())) {
9154+
if (auto Plan = tryToBuildVPlanWithVPRecipes(SubRange, &LVer)) {
91579155
bool HasScalarVF = Plan->hasScalarVFOnly();
91589156
// Now optimize the initial VPlan.
91599157
if (!HasScalarVF)

0 commit comments

Comments
 (0)