Revert "[VPlan] Remove uneeded needsVectorIV check."

This reverts commit 43842b887e while I
investigate a buildbot failure.

It also reverts the follow-up commit
2883de0514.
This commit is contained in:
Florian Hahn 2022-04-28 20:16:21 +01:00
parent 99499c3ea7
commit f4e1eaa375
No known key found for this signature in database
GPG Key ID: EEF712BB5E80EBBA
1 changed files with 9 additions and 2 deletions

View File

@ -429,8 +429,15 @@ void VPlanTransforms::optimizeInductions(VPlan &Plan, ScalarEvolution &SE) {
IV->getStartValue(), Step, TruncI ? TruncI->getType() : nullptr);
HeaderVPBB->insert(Steps, HeaderVPBB->getFirstNonPhi());
// Update scalar users of IV to use Step instead. Use SetVector to ensure
// the list of users doesn't contain duplicates.
// If there are no vector users of IV, simply update all users to use Step
// instead.
if (!IV->needsVectorIV()) {
IV->replaceAllUsesWith(Steps);
continue;
}
// Otherwise only update scalar users of IV to use Step instead. Use
// SetVector to ensure the list of users doesn't contain duplicates.
SetVector<VPUser *> Users(IV->user_begin(), IV->user_end());
for (VPUser *U : Users) {
VPRecipeBase *R = cast<VPRecipeBase>(U);