[llvm] f211ea1 - [VPlan] Don't calculate VPDT in non-side-effect early exit loops. NFC (#203476)

via llvm-commits llvm-commits at lists.llvm.org
Sun Jun 14 21:08:57 PDT 2026


Author: Luke Lau
Date: 2026-06-15T04:08:52Z
New Revision: f211ea13e59b589fad35ee93a752c7ec19c284ba

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

LOG: [VPlan] Don't calculate VPDT in non-side-effect early exit loops. NFC (#203476)

Follow up from
https://github.com/llvm/llvm-project/pull/203233/changes/BASE..6c916678df65787d524558919cee233bf2329aa8#r3398107262

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 1d661b823ffe6..c03a0efda9528 100644
--- a/llvm/lib/Transforms/Vectorize/VPlanTransforms.cpp
+++ b/llvm/lib/Transforms/Vectorize/VPlanTransforms.cpp
@@ -4256,7 +4256,7 @@ static bool handleUncountableExitsWithSideEffects(
     VPlan &Plan, SmallVectorImpl<EarlyExitInfo> &Exits,
     VPBasicBlock *HeaderVPBB, VPBasicBlock *LatchVPBB, VPBasicBlock *MiddleVPBB,
     Loop *TheLoop, PredicatedScalarEvolution &PSE, DominatorTree &DT,
-    AssumptionCache *AC, VPDominatorTree &VPDT) {
+    AssumptionCache *AC) {
 
   // Disconnect early exiting blocks from successors, remove branches. We
   // currently don't support multiple uses for recipes involved in creating
@@ -4271,7 +4271,7 @@ static bool handleUncountableExitsWithSideEffects(
     VPBlockUtils::disconnectBlocks(Exit.EarlyExitingVPBB, Exit.EarlyExitVPBB);
   }
 
-  VPDT.recalculate(Plan);
+  VPDominatorTree VPDT(Plan);
 
   // We can abandon a VPlan entirely if we return false here, so we shouldn't
   // crash if some earlier assumptions on scalar IR don't hold for the vplan
@@ -4412,7 +4412,9 @@ bool VPlanTransforms::handleUncountableEarlyExits(
     VPlan &Plan, VPBasicBlock *HeaderVPBB, VPBasicBlock *LatchVPBB,
     VPBasicBlock *MiddleVPBB, Loop *TheLoop, PredicatedScalarEvolution &PSE,
     DominatorTree &DT, AssumptionCache *AC, UncountableExitStyle Style) {
+#ifndef NDEBUG
   VPDominatorTree VPDT(Plan);
+#endif
   VPBuilder LatchBuilder(LatchVPBB->getTerminator());
   SmallVector<EarlyExitInfo> Exits;
   for (VPIRBasicBlock *ExitBlock : Plan.getExitBlocks()) {
@@ -4504,9 +4506,8 @@ bool VPlanTransforms::handleUncountableEarlyExits(
     LatchVPBB->setSuccessors({MiddleVPBB, MiddleVPBB, HeaderVPBB});
     MiddleVPBB->clearPredecessors();
     MiddleVPBB->setPredecessors({LatchVPBB, LatchVPBB});
-    return handleUncountableExitsWithSideEffects(Plan, Exits, HeaderVPBB,
-                                                 LatchVPBB, MiddleVPBB, TheLoop,
-                                                 PSE, DT, AC, VPDT);
+    return handleUncountableExitsWithSideEffects(
+        Plan, Exits, HeaderVPBB, LatchVPBB, MiddleVPBB, TheLoop, PSE, DT, AC);
   }
 
   // Create the vector.early.exit blocks.


        


More information about the llvm-commits mailing list