[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:29 PDT 2024


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

None

>From ddb1e4f55ddb896ac307fb2e676f95cd5cd9a059 Mon Sep 17 00:00:00 2001
From: LiqinWeng <liqin.weng at spacemit.com>
Date: Thu, 9 May 2024 17:19:56 +0800
Subject: [PATCH] [LV] Remove redudent removel operations, it will be removed
 by 'removeDeadRecipes'

---
 llvm/lib/Transforms/Vectorize/VPlanTransforms.cpp | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

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);
 }
 



More information about the llvm-commits mailing list