[llvm] [LV] Remove redudent removel operations, it will be removed by 'removeDeadRecipes' (PR #91575)

via llvm-commits llvm-commits at lists.llvm.org
Thu May 9 02:33:58 PDT 2024


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-llvm-transforms

Author: LiqinWeng (LiqinWeng)

<details>
<summary>Changes</summary>



---
Full diff: https://github.com/llvm/llvm-project/pull/91575.diff


1 Files Affected:

- (modified) llvm/lib/Transforms/Vectorize/VPlanTransforms.cpp (+5-4) 


``````````diff
diff --git a/llvm/lib/Transforms/Vectorize/VPlanTransforms.cpp b/llvm/lib/Transforms/Vectorize/VPlanTransforms.cpp
index c0eb6d710ad34..b80b982920777 100644
--- a/llvm/lib/Transforms/Vectorize/VPlanTransforms.cpp
+++ b/llvm/lib/Transforms/Vectorize/VPlanTransforms.cpp
@@ -465,7 +465,7 @@ static void removeRedundantCanonicalIVs(VPlan &Plan) {
                }) ||
         vputils::onlyFirstLaneUsed(WidenNewIV)) {
       WidenNewIV->replaceAllUsesWith(WidenOriginalIV);
-      WidenNewIV->eraseFromParent();
+      // WidenNewIV->eraseFromParent();
       return;
     }
   }
@@ -632,7 +632,7 @@ static void removeRedundantExpandSCEVRecipes(VPlan &Plan) {
     if (I.second)
       continue;
     ExpR->replaceAllUsesWith(I.first->second);
-    ExpR->eraseFromParent();
+    // ExpR->eraseFromParent();
   }
 }
 
@@ -888,7 +888,7 @@ static void simplifyRecipe(VPRecipeBase &R, VPTypeAnalysis &TypeInfo) {
           !match(Blend->getMask(I), m_False()))
         return;
     Blend->replaceAllUsesWith(Inc0);
-    Blend->eraseFromParent();
+    // Blend->eraseFromParent();
     return;
   }
 
@@ -1090,11 +1090,12 @@ void VPlanTransforms::optimize(VPlan &Plan, ScalarEvolution &SE) {
 
   simplifyRecipes(Plan, SE.getContext());
   legalizeAndOptimizeInductions(Plan, SE);
-  removeDeadRecipes(Plan);
+  // removeDeadRecipes(Plan);
 
   createAndOptimizeReplicateRegions(Plan);
 
   removeRedundantExpandSCEVRecipes(Plan);
+  removeDeadRecipes(Plan);
   mergeBlocksIntoPredecessors(Plan);
 }
 

``````````

</details>


https://github.com/llvm/llvm-project/pull/91575


More information about the llvm-commits mailing list