[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


================
@@ -113,13 +88,6 @@ static bool isHeaderBB(BasicBlock *BB, Loop *L) {
   return L && BB == L->getHeader();
 }
 
-void PlainCFGBuilder::setRegionPredsFromBB(VPRegionBlock *Region,
-                                           BasicBlock *BB) {
-  // BB is a loop header block. Connect the region to the loop preheader.
-  Loop *LoopOfBB = LI->getLoopFor(BB);
-  Region->setPredecessors({getOrCreateVPBB(LoopOfBB->getLoopPredecessor())});
-}
-
 // Add operands to VPInstructions representing phi nodes from the input IR.
 void PlainCFGBuilder::fixHeaderPhis() {
   for (auto *Phi : PhisToFix) {
----------------
ayalz wrote:

Header phi's expect preheader as first predecessor and latch as second, corresponding to operands added below, so make sure here the predecessors are ordered accordingly, i.e., swap if needed? Later when loop regions are introduced, can rely on this order.

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


More information about the llvm-commits mailing list