This is an archive of the discontinued LLVM Phabricator instance.

[VPlan] Do not create dummy entry block (NFC).
ClosedPublic

Authored by fhahn on Oct 7 2021, 4:21 AM.

Details

Summary

At the moment a dummy entry block is created at the beginning of VPlan
construction. This dummy block is later removed again.

This means it is not easy to identify the VPlan header block in a
general fashion, because during recipe creation it is the single
successor of the entry block, while later it is the entry block.

To make getting the header easier, just skip creating the dummy block.

Diff Detail

Event Timeline

fhahn created this revision.Oct 7 2021, 4:21 AM
fhahn requested review of this revision.Oct 7 2021, 4:21 AM
Herald added a project: Restricted Project. · View Herald TranscriptOct 7 2021, 4:21 AM
Herald added a subscriber: vkmr. · View Herald Transcript
Ayal accepted this revision.Oct 25 2021, 12:56 AM

This is indeed better, thanks!
(Original version tried to simplify the loop by peeling setEntry(), but this does look better overall.)
Adding a minor nit.

llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
9351

Worth asserting that Plan Entry is set after the loop?
(Original version did this by calling getSingleSuccessor()).
(Perhaps also assert that this entry is not empty(?)).

This revision is now accepted and ready to land.Oct 25 2021, 12:56 AM
This revision was landed with ongoing or failed builds.Oct 25 2021, 1:53 AM
This revision was automatically updated to reflect the committed changes.
fhahn marked an inline comment as done.Oct 25 2021, 1:54 AM
fhahn added inline comments.
llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
9351

Thanks, committed with the suggested assert!