This is an archive of the discontinued LLVM Phabricator instance.

[AMDGPU] Move atomic expand past infer address spaces
ClosedPublic

Authored by rampitec on Jul 6 2021, 1:38 PM.

Details

Summary

There are cases where infer address spaces pass cannot yet
infer an address space in the opt pipeline and then in the
llc pipeline it runs too late for atomic expand pass to
benefit from a specific address space.

Move atomic expand pass past the infer address spaces.

Fixes: SWDEV-293410

Diff Detail

Event Timeline

rampitec created this revision.Jul 6 2021, 1:38 PM
rampitec requested review of this revision.Jul 6 2021, 1:38 PM
Herald added a project: Restricted Project. · View Herald TranscriptJul 6 2021, 1:38 PM
Herald added a subscriber: wdng. · View Herald Transcript
rampitec edited the summary of this revision. (Show Details)Jul 6 2021, 1:39 PM
yaxunl added a comment.Jul 6 2021, 2:27 PM

If we do it here, do we still need to do it again later?

If we do it here, do we still need to do it again later?

Yes, as later it is after inlining. We can move atomic expansion right after infer address space though.

rampitec updated this revision to Diff 356822.Jul 6 2021, 2:42 PM
rampitec retitled this revision from [AMDGPU] Add infer address spaces pass before atomic expand to [AMDGPU] Move atomic expand past infer address spaces.
rampitec edited the summary of this revision. (Show Details)

Move atomic expand pass itself past infer address spaces instead.

arsenm added a comment.Jul 6 2021, 3:38 PM

Also add a test for the codegen change?

rampitec updated this revision to Diff 356830.Jul 6 2021, 3:54 PM

Added codegen test. On gfx90a it allows to produce global_atomic_add_f32 instead of CAS loop.

arsenm accepted this revision.Jul 6 2021, 4:01 PM
This revision is now accepted and ready to land.Jul 6 2021, 4:01 PM
This revision was landed with ongoing or failed builds.Jul 6 2021, 4:06 PM
This revision was automatically updated to reflect the committed changes.