@@ -9138,22 +9138,20 @@ void LoopVectorizationPlanner::buildVPlansWithVPRecipes(ElementCount MinVF,
9138
9138
ElementCount MaxVF) {
9139
9139
assert (OrigLoop->isInnermost () && " Inner loop expected." );
9140
9140
9141
- // Only use noalias metadata when using memory checks guaranteeing no overlap
9142
- // across all iterations.
9143
9141
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 () &&
9146
9145
!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 ();
9151
9149
}
9152
9150
9153
9151
auto MaxVFTimes2 = MaxVF * 2 ;
9154
9152
for (ElementCount VF = MinVF; ElementCount::isKnownLT (VF, MaxVFTimes2);) {
9155
9153
VFRange SubRange = {VF, MaxVFTimes2};
9156
- if (auto Plan = tryToBuildVPlanWithVPRecipes (SubRange, LVer. get () )) {
9154
+ if (auto Plan = tryToBuildVPlanWithVPRecipes (SubRange, & LVer)) {
9157
9155
bool HasScalarVF = Plan->hasScalarVFOnly ();
9158
9156
// Now optimize the initial VPlan.
9159
9157
if (!HasScalarVF)
0 commit comments