[llvm] [VPlan] Introduce child regions as VPlan transform. (PR #129402)
Florian Hahn via llvm-commits
llvm-commits at lists.llvm.org
Mon Apr 7 05:16:10 PDT 2025
================
@@ -376,23 +311,21 @@ void PlainCFGBuilder::buildPlainCFG(
for (BasicBlock *BB : RPO) {
// Create or retrieve the VPBasicBlock for this BB.
VPBasicBlock *VPBB = getOrCreateVPBB(BB);
- VPRegionBlock *Region = VPBB->getParent();
Loop *LoopForBB = LI->getLoopFor(BB);
// Set VPBB predecessors in the same order as they are in the incoming BB.
if (!isHeaderBB(BB, LoopForBB)) {
setVPBBPredsFromBB(VPBB, BB);
- } else if (Region) {
- // BB is a loop header and there's a corresponding region, set the
- // predecessor for it.
- setRegionPredsFromBB(Region, BB);
+ } else {
+ VPBB->setPredecessors({getOrCreateVPBB(LoopForBB->getLoopPredecessor()),
+ getOrCreateVPBB(LoopForBB->getLoopLatch())});
}
// Create VPInstructions for BB.
createVPInstructionsForVPBB(VPBB, BB);
----------------
fhahn wrote:
Updated the patch to make the phi operand order consistent with predecessors.
At the moment,connections to exit blocks are dropped, but they should be retained as follow up (initial patch here https://github.com/llvm/llvm-project/pull/128420/commits/317d975da01c83a9c04d0f5980265410b60860d9 )
https://github.com/llvm/llvm-project/pull/129402
More information about the llvm-commits
mailing list