Skip to content

Commit 26afa2d

Browse files
committed
[VPlan] Create VPInstructions after setting preds in HCFG builder (NFC)
Set VPBBs predecessors before creating VPInstructions, as setting incoming values for non-header phis directly there will require predecessors to be available.
1 parent 93b263a commit 26afa2d

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

llvm/lib/Transforms/Vectorize/VPlanHCFGBuilder.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -393,11 +393,9 @@ void PlainCFGBuilder::buildPlainCFG(
393393
RPO.perform(LI);
394394

395395
for (BasicBlock *BB : RPO) {
396-
// Create or retrieve the VPBasicBlock for this BB and create its
397-
// VPInstructions.
396+
// Create or retrieve the VPBasicBlock for this BB.
398397
VPBasicBlock *VPBB = getOrCreateVPBB(BB);
399398
VPRegionBlock *Region = VPBB->getParent();
400-
createVPInstructionsForVPBB(VPBB, BB);
401399
Loop *LoopForBB = LI->getLoopFor(BB);
402400
// Set VPBB predecessors in the same order as they are in the incoming BB.
403401
if (!isHeaderBB(BB, LoopForBB)) {
@@ -410,6 +408,9 @@ void PlainCFGBuilder::buildPlainCFG(
410408
setRegionPredsFromBB(Region, BB);
411409
}
412410

411+
// Create VPInstructions for BB.
412+
createVPInstructionsForVPBB(VPBB, BB);
413+
413414
if (TheLoop->getLoopLatch() == BB) {
414415
VPBB->setOneSuccessor(VectorLatchVPBB);
415416
VectorLatchVPBB->clearPredecessors();

0 commit comments

Comments
 (0)