[llvm] e958717 - [VPlan] Recalculate VPDT in handleUncountableExitsWithSideEffects (#203233)

via llvm-commits llvm-commits at lists.llvm.org
Thu Jun 11 04:27:00 PDT 2026


Author: Luke Lau
Date: 2026-06-11T19:26:55+08:00
New Revision: e95871719c41a8de96b438b962ed3b8f869b9e0c

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

LOG: [VPlan] Recalculate VPDT in handleUncountableExitsWithSideEffects (#203233)

In the loop before we're modifying the CFG, but this invalidates the
dominator tree. We need to recalculate since we query it later on. I
can't really think of a test case for this, if anything using the
stale dominator tree with the extra branch will make the dominance
queries more conservative. But it's probably something we should fix.

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 3fe8c84658c8f..cd0fddd4489d8 100644
--- a/llvm/lib/Transforms/Vectorize/VPlanTransforms.cpp
+++ b/llvm/lib/Transforms/Vectorize/VPlanTransforms.cpp
@@ -4250,6 +4250,8 @@ static bool handleUncountableExitsWithSideEffects(
     VPBlockUtils::disconnectBlocks(Exit.EarlyExitingVPBB, Exit.EarlyExitVPBB);
   }
 
+  VPDT.recalculate(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
   // version of the loop.


        


More information about the llvm-commits mailing list