[llvm] 5f5792a - [VPlan] Use removeDeadRecipes in optimizeForVFAndUF (NFCI)

Florian Hahn via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 2 12:11:05 PST 2025


Author: Florian Hahn
Date: 2025-01-02T20:10:46Z
New Revision: 5f5792aedb1f8088836ccd1c0a924c5e0bbf35db

URL: https://github.com/llvm/llvm-project/commit/5f5792aedb1f8088836ccd1c0a924c5e0bbf35db
DIFF: https://github.com/llvm/llvm-project/commit/5f5792aedb1f8088836ccd1c0a924c5e0bbf35db.diff

LOG: [VPlan] Use removeDeadRecipes in optimizeForVFAndUF (NFCI)

Split off from https://github.com/llvm/llvm-project/pull/108378.

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 89aab71905a293..8ac2bd5160c267 100644
--- a/llvm/lib/Transforms/Vectorize/VPlanTransforms.cpp
+++ b/llvm/lib/Transforms/Vectorize/VPlanTransforms.cpp
@@ -842,11 +842,11 @@ void VPlanTransforms::optimizeForVFAndUF(VPlan &Plan, ElementCount BestVF,
       VPInstruction::BranchOnCond,
       {Plan.getOrAddLiveIn(ConstantInt::getTrue(Ctx))}, Term->getDebugLoc());
 
-  SmallVector<VPValue *> PossiblyDead(Term->operands());
   Term->eraseFromParent();
-  for (VPValue *Op : PossiblyDead)
-    recursivelyDeleteDeadRecipes(Op);
   ExitingVPBB->appendRecipe(BOC);
+
+  VPlanTransforms::removeDeadRecipes(Plan);
+
   Plan.setVF(BestVF);
   Plan.setUF(BestUF);
   // TODO: Further simplifications are possible


        


More information about the llvm-commits mailing list