[llvm] [VPlan] Retain exit conditions and edges in initial VPlan (NFC). (PR #137709)

Florian Hahn via llvm-commits llvm-commits at lists.llvm.org
Tue May 6 12:54:12 PDT 2025


================
@@ -447,19 +424,21 @@ static void createLoopRegion(VPlan &Plan, VPBlockBase *HeaderVPB) {
   VPBlockBase *Succ = LatchVPBB->getSingleSuccessor();
   assert(LatchVPBB->getNumSuccessors() <= 1 &&
          "Latch has more than one successor");
-  if (Succ)
-    VPBlockUtils::disconnectBlocks(LatchVPBB, Succ);
+  LatchVPBB->removeSuccessor(Succ);
----------------
fhahn wrote:

Ah yes, introducing a temporary block nicely solves the issue, thank you very much!

This also required changing the region construction order to innermost first, to ensure the parents for VPBBs are set correctly at all times 32928a07846bd531ef31f1166faa4e119be4f15f

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


More information about the llvm-commits mailing list