This is an archive of the discontinued LLVM Phabricator instance.

[AMDGPU] Extend SILoadStoreOptimizer to handle global loads
ClosedPublic

Authored by rampitec on Feb 21 2022, 1:23 PM.

Details

Summary

There can be situations where global and flat loads and stores are not
combined by the vectorizer, in particular if their address space
differ in the IR but they end up the same class instructions after
selection. For example a divergent load from constant address space
ends up being the same global_load as a load from global address space.

TODO: merge global stores.
TODO: handle SADDR forms.
TODO: merge flat load/stores.
TODO: merge flat with global promoting to flat.

Diff Detail

Event Timeline

rampitec created this revision.Feb 21 2022, 1:23 PM
rampitec requested review of this revision.Feb 21 2022, 1:23 PM
Herald added a project: Restricted Project. · View Herald TranscriptFeb 21 2022, 1:23 PM
Herald added a subscriber: wdng. · View Herald Transcript
rampitec updated this revision to Diff 410399.Feb 21 2022, 3:08 PM

Corrected MMO load sizes, cosmetic change.

foad accepted this revision.Feb 22 2022, 2:42 AM
foad added reviewers: piotr, critson, kmitropoulou.

Typo in summary: "sitaions", "th"

Looks good apart from that.

This revision is now accepted and ready to land.Feb 22 2022, 2:42 AM
rampitec edited the summary of this revision. (Show Details)Feb 22 2022, 8:22 AM

Overall I think this pass should do less than it currently does. All of these cases should have been handled in the IR already, it's not the disjoint case of the DS operations.

This is another example where I think having constant address space is overcomplicated and would be better served by global loads marked invariant

Overall I think this pass should do less than it currently does. All of these cases should have been handled in the IR already, it's not the disjoint case of the DS operations.

This is another example where I think having constant address space is overcomplicated and would be better served by global loads marked invariant

Invariant load can be reordered with stores, these constant loads cannot.

This revision was landed with ongoing or failed builds.Feb 22 2022, 8:42 AM
This revision was automatically updated to reflect the committed changes.