[llvm] 43842b8 - [VPlan] Remove uneeded needsVectorIV check.

Florian Hahn via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 28 08:30:10 PDT 2022


Author: Florian Hahn
Date: 2022-04-28T16:27:34+01:00
New Revision: 43842b887e0a7b918bb2d6c9f672025b2c621f8a

URL: https://github.com/llvm/llvm-project/commit/43842b887e0a7b918bb2d6c9f672025b2c621f8a
DIFF: https://github.com/llvm/llvm-project/commit/43842b887e0a7b918bb2d6c9f672025b2c621f8a.diff

LOG: [VPlan] Remove uneeded needsVectorIV check.

Remove one of the last remaining uses of ::needsVectorIV, preparing for
its removal. Now that usesScalars is available and based on the
information explicit in VPlan, there is no need to use the pre-computed
needsVectorIV.

Reviewed By: Ayal

Differential Revision: https://reviews.llvm.org/D123720

Added: 
    

Modified: 
    llvm/lib/Transforms/Vectorize/VPlanTransforms.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Transforms/Vectorize/VPlanTransforms.cpp b/llvm/lib/Transforms/Vectorize/VPlanTransforms.cpp
index f4d2af2d9de39..2c3b0aca30215 100644
--- a/llvm/lib/Transforms/Vectorize/VPlanTransforms.cpp
+++ b/llvm/lib/Transforms/Vectorize/VPlanTransforms.cpp
@@ -429,15 +429,7 @@ 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) {
       VPRecipeBase *R = cast<VPRecipeBase>(U);


        


More information about the llvm-commits mailing list