[llvm] [VPlan] Introduce child regions as VPlan transform. (PR #129402)

via llvm-commits llvm-commits at lists.llvm.org
Mon Apr 7 02:20:47 PDT 2025


================
@@ -423,21 +343,11 @@ void PlainCFGBuilder::buildPlainCFG(
     BasicBlock *IRSucc1 = BI->getSuccessor(1);
     VPBasicBlock *Successor0 = getOrCreateVPBB(IRSucc0);
     VPBasicBlock *Successor1 = getOrCreateVPBB(IRSucc1);
-    if (BB == LoopForBB->getLoopLatch()) {
-      // For a latch we need to set the successor of the region rather than that
-      // of VPBB and it should be set to the exit, i.e., non-header successor,
-      // except for the top region, which is handled elsewhere.
-      assert(LoopForBB != TheLoop &&
-             "Latch of the top region should have been handled earlier");
-      Region->setOneSuccessor(isHeaderVPBB(Successor0) ? Successor1
-                                                       : Successor0);
-      Region->setExiting(VPBB);
-      continue;
-    }
 
-    // Don't connect any blocks outside the current loop except the latch for
-    // now. The latch is handled above.
-    if (LoopForBB) {
+    // Don't connect any blocks outside the current loop except the latch, which
+    // is handled below.
----------------
ayalz wrote:

For TheLoop this now avoids connecting the latch to its exit block, left for skeleton/middle-block construction?
Intention is to remove early exit branches from all loops?
Latch was previously "handled above", now "handled below" - where, in following setTwoSuccessors()?

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


More information about the llvm-commits mailing list