Recommit "[VPlan] Remove uneeded needsVectorIV check."

This reverts commit 266ea446ab.

The reasons for the revert have been addressed by cleaning up condition
handling in VPlan and properly marking VPBranchOnMaskRecipe as using
scalars.

The test case for the revert from D123720 has been added in 3d663308a5.
This commit is contained in:
Florian Hahn
2022-06-08 14:06:45 +01:00
parent 98d4f0651a
commit cedfd7a2e5
2 changed files with 9 additions and 9 deletions

View File

@@ -392,15 +392,8 @@ void VPlanTransforms::optimizeInductions(VPlan &Plan, ScalarEvolution &SE) {
IV->getStartValue(), Step, TruncI ? TruncI->getType() : nullptr);
HeaderVPBB->insert(Steps, HeaderVPBB->getFirstNonPhi());
// 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.
// 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) {
if (!U->usesScalars(IV))