This is an archive of the discontinued LLVM Phabricator instance.

GlobalISel: Merge some AMDGPU ABI lowering code to generic code
ClosedPublic

Authored by arsenm on Feb 9 2021, 7:29 AM.

Details

Summary

AMDGPU currently has a lot of pre-processing code to pre-split
argument types into 32-bit pieces before passing it to the generic
code in handleAssignments. This is a bit sloppy and also requires some
overly fancy iterator work when building the calls. It's better if all
argument marshalling code is handled directly in
handleAssignments. This handles more situations like decomposing large
element vectors into sub-element sized pieces.

This should mostly be NFC, but does change the generated code by
shifting where the initial argument packing instructions are placed. I
think this is nicer looking, since it now emits the packing code
directly after the relevant copies, rather than after the copies for
the remaining arguments.

This doubles down on gfx6/gfx7 using the gfx8+ ABI for 16-bit
types. This is ultimately the better option, but incompatible with the
DAG. Fixing this requires more work, especially for f16.

Diff Detail

Event Timeline

arsenm created this revision.Feb 9 2021, 7:29 AM
arsenm requested review of this revision.Feb 9 2021, 7:29 AM
Herald added a project: Restricted Project. · View Herald TranscriptFeb 9 2021, 7:29 AM
Herald added a subscriber: wdng. · View Herald Transcript
bogner accepted this revision.Feb 17 2021, 2:56 PM
This revision is now accepted and ready to land.Feb 17 2021, 2:56 PM