Skip to content

Commit

Permalink
[VPlan] Iterate over blocks in VPlan::execute in RPOT (NFC).
Browse files Browse the repository at this point in the history
This prepares for more complex CFGs in VPlan, as in
    llvm#114292
    llvm#112138
  • Loading branch information
fhahn authored and broxigarchen committed Dec 10, 2024
1 parent dcab69e commit d38559b
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions llvm/lib/Transforms/Vectorize/VPlan.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1033,8 +1033,11 @@ void VPlan::execute(VPTransformState *State) {
State->CFG.DTU.applyUpdates(
{{DominatorTree::Delete, ScalarPh, ScalarPh->getSingleSuccessor()}});

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

VPBasicBlock *LatchVPBB = getVectorLoopRegion()->getExitingBasicBlock();
Expand Down

0 comments on commit d38559b

Please sign in to comment.