Page MenuHomePhabricator

[VPlan] Verify plan entry and exit blocks, set correct exit block.
Needs ReviewPublic

Authored by fhahn on Thu, Nov 25, 5:38 AM.

Details

Reviewers
Ayal
gilr
rengolin
Summary

Both the entry and exit blocks of the top-region of a plan must be
VPBasicBlocks. They also must have no predecessors or successors
respectively.

This invariant was broken when splitting a block for sink-after. To fix
the issue, set the exit block of the region *after* sink-after is done.

Diff Detail

Event Timeline

fhahn created this revision.Thu, Nov 25, 5:38 AM
fhahn requested review of this revision.Thu, Nov 25, 5:38 AM
Herald added a project: Restricted Project. · View Herald TranscriptThu, Nov 25, 5:38 AM
Herald added a subscriber: vkmr. · View Herald Transcript
Ayal added inline comments.Thu, Dec 2, 1:42 PM
llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
9562

Wonder if the above assert should also be taken care of by VPlan verify instead?

9633

Another way of fixing this would be to have split-blocks update Exit, when it updates VPBB?

llvm/lib/Transforms/Vectorize/VPlanVerifier.cpp
169

The Entry and Exit blocks of any region in Plan must have no predecessors and successors, respectively, by definition; not only the top-most region, e.g., including internal replicating regions. Worth extending to check all regions in Plan? Entry and Exit blocks may themselves be regions, in general, so asserting that they be basic blocks should be restricted to the top-most region.