This is an archive of the discontinued LLVM Phabricator instance.

AMDGPU: Move AMDGPUAttributor run earlier
ClosedPublic

Authored by arsenm on Jun 8 2023, 10:22 AM.

Details

Reviewers
JonChesterfield
jdoerfert
rampitec
Pierre-vh
sstefan1
Group Reviewers
Restricted Project
Summary

Move it up with other module passes. It's a higher level optimization
that should probably be done before hacking up the IR for codegen. It
should really be done earlier than this. We could possibly move this
with other IPO passes, but we'd have to stop inferring the lack of
lds.kernel.id calls and have the LDS module pass mark functions which
don't need the ID.

The one test change is because that pass is relying on the backend run
of SROA (which we ideally wouldn't have).

Diff Detail

Event Timeline

arsenm created this revision.Jun 8 2023, 10:22 AM
Herald added a project: Restricted Project. · View Herald TranscriptJun 8 2023, 10:22 AM
arsenm requested review of this revision.Jun 8 2023, 10:22 AM
Herald added a project: Restricted Project. · View Herald Transcript
Herald added a subscriber: wdng. · View Herald Transcript
Pierre-vh accepted this revision as: Pierre-vh.Jun 9 2023, 12:40 AM
Pierre-vh added inline comments.
llvm/test/CodeGen/AMDGPU/simple-indirect-call.ll
46–48

nit: Do you know why there's more registers being used?
We go up to s31 for the call at the end so I guess the SGPR usage is the same overall, I'm just wondering.

This revision is now accepted and ready to land.Jun 9 2023, 12:40 AM
arsenm added inline comments.Jun 9 2023, 6:15 PM
llvm/test/CodeGen/AMDGPU/simple-indirect-call.ll
46–48

This is what the change description referenced. Since InferAddressSpaces/SROA no longer eliminate the cast and alloca, it doesn't figure out it can turn off all the inputs