Skip to content

Commit ec22b1a

Browse files
committed
[VPlan] Iterate over blocks in VPlan::execute in RPOT (NFC).
This prepares for more complex CFGs in VPlan, as in #114292 #112138
1 parent 5c8ed3a commit ec22b1a

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

llvm/lib/Transforms/Vectorize/VPlan.cpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1033,8 +1033,11 @@ void VPlan::execute(VPTransformState *State) {
10331033
State->CFG.DTU.applyUpdates(
10341034
{{DominatorTree::Delete, ScalarPh, ScalarPh->getSingleSuccessor()}});
10351035

1036-
// Generate code in the loop pre-header and body.
1037-
for (VPBlockBase *Block : vp_depth_first_shallow(Entry))
1036+
ReversePostOrderTraversal<VPBlockShallowTraversalWrapper<VPBlockBase *>> RPOT(
1037+
Entry);
1038+
// Generate code for the VPlan, in parts of the vector skeleton, loop body and
1039+
// successor blocks including the middle, exit and scalar preheader blocks.
1040+
for (VPBlockBase *Block : RPOT)
10381041
Block->execute(State);
10391042

10401043
VPBasicBlock *LatchVPBB = getVectorLoopRegion()->getExitingBasicBlock();

0 commit comments

Comments
 (0)