This is an archive of the discontinued LLVM Phabricator instance.

GlobalISel: Merge and cleanup more AMDGPU call lowering code
ClosedPublic

Authored by arsenm on Feb 28 2021, 7:28 AM.

Details

Summary

This merges more AMDGPU ABI lowering code into the generic call
lowering. Start cleaning up by factoring away more of the pack/unpack
logic into the buildCopy{To|From}Parts functions. These could use more
improvement, and the SelectionDAG versions are significantly more
complex, and we'll eventually have to emulate all of those cases too.

This is mostly NFC, but does result in some minor instruction
reordering. It also removes some of the limitations with mismatched
sizes the old code had. However, similarly to the merge on the input,
this is forcing gfx6/gfx7 to use the gfx8+ ABI (which is what we
actually want, but SelectionDAG is stuck using the weird emergent
ABI).

This also changes the load/store size for stack passed EVTs for
AArch64, which makes it consistent with the DAG behavior.

Diff Detail

Event Timeline

arsenm created this revision.Feb 28 2021, 7:28 AM
arsenm requested review of this revision.Feb 28 2021, 7:28 AM
Herald added a project: Restricted Project. · View Herald TranscriptFeb 28 2021, 7:28 AM
Herald added a subscriber: wdng. · View Herald Transcript
arsenm updated this revision to Diff 326967.Feb 28 2021, 8:02 AM

Remove more vestigial preprocessing code from call side

arsenm updated this revision to Diff 326983.Feb 28 2021, 10:11 AM

Rename function and track extend type, which currently doesn't matter but will in a future change

From the description I expected some test changes. Something missing?

llvm/lib/CodeGen/GlobalISel/CallLowering.cpp
190

This was done in the other patch?

arsenm updated this revision to Diff 327095.Mar 1 2021, 6:21 AM

Attach correct patch

Thanks for doing this. I think we should try to document things here extra carefully. I have to re-learn what this code does every few months.

llvm/lib/CodeGen/GlobalISel/CallLowering.cpp
247–250

An example in a comment would be helpful here.

361

Document this?

arsenm updated this revision to Diff 327422.Mar 2 2021, 5:46 AM

More comments

aemerson accepted this revision.Mar 2 2021, 1:33 PM

LGTM.

llvm/lib/CodeGen/GlobalISel/CallLowering.cpp
264

dead1 shouldn't be here?

This revision is now accepted and ready to land.Mar 2 2021, 1:33 PM