This is an archive of the discontinued LLVM Phabricator instance.

[ARM] Move VPTBlock pass after post-ra scheduling
ClosedPublic

Authored by dmgreen on Nov 3 2021, 3:08 AM.

Details

Summary

Currently when tail predicating loops, vpt blocks need to be created with the vctp predicate in case we need to revert to non-tail predicated form. This has the unfortunate side effect of severely messing up post-ra scheduling at times as the instructions are already stuck in vpt blocks, not allowed to be independently scheduled.

This patch addresses that by just moving the creating of VPT blocks later in the pipeline, after post-ra scheduling has been performed. This allows more optimal scheduling post-ra before the vpt blocks are created, leading to more optimal tail predicated loops.

Diff Detail

Event Timeline

dmgreen created this revision.Nov 3 2021, 3:08 AM
dmgreen requested review of this revision.Nov 3 2021, 3:08 AM
Herald added a project: Restricted Project. · View Herald TranscriptNov 3 2021, 3:08 AM

Sounds like a good idea. I think its current place in the pipeline was semi arbitrary, i.e. it seemed like a good place and not much thought was given about scheduling.
I can't think of any, but just checking, any (potential) disadvantages to moving this later?

Sounds like a good idea. I think its current place in the pipeline was semi arbitrary, i.e. it seemed like a good place and not much thought was given about scheduling.
I can't think of any, but just checking, any (potential) disadvantages to moving this later?

I couldn't think of any. There may be different scheduling of instructions in and around VPT blocks, which may be better or worse depending on the exact case, but isn't something we control very well at the moment (to try and create the minimum number of blocks for example). It should be an improvement for tail predicated loops and for the most part vpt blocks, I believe, even if we may find not all cases are better.

SjoerdMeijer accepted this revision.Nov 4 2021, 2:58 AM

Cheers, LGTM.

This revision is now accepted and ready to land.Nov 4 2021, 2:58 AM
This revision was landed with ongoing or failed builds.Nov 4 2021, 11:42 AM
This revision was automatically updated to reflect the committed changes.