Skip to content

Commit 7500cea

Browse files
committed
[VPlan] Flatten the CFG separately after creating wide recipes (NFC).
Move flattening of the CFG out of the loop that creates the wide recipes. This simplifies the already large loop and prepares for moving flattening to a separate transform.
1 parent fe141c2 commit 7500cea

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

llvm/lib/Transforms/Vectorize/LoopVectorize.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9464,7 +9464,6 @@ LoopVectorizationPlanner::tryToBuildVPlanWithVPRecipes(VFRange &Range,
94649464
HeaderVPBB);
94659465

94669466
VPBasicBlock::iterator MBIP = MiddleVPBB->getFirstNonPhi();
9467-
VPBlockBase *PrevVPBB = nullptr;
94689467
for (VPBasicBlock *VPBB : VPBlockUtils::blocksOnly<VPBasicBlock>(RPOT)) {
94699468
// Create mask based on the IR BB corresponding to VPBB.
94709469
// TODO: Predicate directly based on VPlan.
@@ -9548,7 +9547,10 @@ LoopVectorizationPlanner::tryToBuildVPlanWithVPRecipes(VFRange &Range,
95489547
"Unexpected multidef recipe");
95499548
R.eraseFromParent();
95509549
}
9550+
}
95519551

9552+
VPBlockBase *PrevVPBB = nullptr;
9553+
for (VPBasicBlock *VPBB : VPBlockUtils::blocksOnly<VPBasicBlock>(RPOT)) {
95529554
// Flatten the CFG in the loop. Masks for blocks have already been generated
95539555
// and added to recipes as needed. To do so, first disconnect VPBB from its
95549556
// successors. Then connect VPBB to the previously visited VPBB.

0 commit comments

Comments
 (0)