This is an archive of the discontinued LLVM Phabricator instance.

[AArch64][GlobalISel] Add support for sret demotion.
ClosedPublic

Authored by aemerson on Jul 4 2022, 4:46 PM.

Details

Summary

To do this, we need to implement a target hook and make a minor change to the call lowering to demote arguments to sret if they can't be handled by calling conventions.

Fixes issue 56295

Diff Detail

Event Timeline

aemerson created this revision.Jul 4 2022, 4:46 PM
Herald added a project: Restricted Project. · View Herald TranscriptJul 4 2022, 4:46 PM
aemerson requested review of this revision.Jul 4 2022, 4:46 PM
Allen added a subscriber: Allen.Jul 4 2022, 7:19 PM
arsenm added inline comments.Jul 5 2022, 7:26 AM
llvm/test/CodeGen/AArch64/GlobalISel/call-lowering-sret-demotion.ll
46

Should also add another function to test the caller side sret

aemerson added inline comments.Jul 5 2022, 10:34 AM
llvm/test/CodeGen/AArch64/GlobalISel/call-lowering-sret-demotion.ll
46

Good point, it only worked before in the runtime test because of a fallback...

paquette added inline comments.Jul 5 2022, 11:08 AM
llvm/test/CodeGen/AArch64/GlobalISel/call-lowering-sret-demotion.ll
43

Does this have to be 9 x i64 or could it be smaller? Would be nice to have fewer generated lines if possible.

aemerson added inline comments.Jul 5 2022, 1:34 PM
llvm/test/CodeGen/AArch64/GlobalISel/call-lowering-sret-demotion.ll
43

It has to be [9 x i64] for it to be returned using sret.

aemerson updated this revision to Diff 442387.Jul 5 2022, 1:34 PM

Fix support on the return lowering side.

arsenm added inline comments.Jul 5 2022, 1:50 PM
llvm/test/CodeGen/AArch64/GlobalISel/call-lowering-sret-demotion.ll
80

Might also be worth adding a case using a tail call

aemerson updated this revision to Diff 442394.Jul 5 2022, 2:00 PM

I'm assuming you mean adding tail to the call?

arsenm accepted this revision.Jul 5 2022, 2:41 PM
This revision is now accepted and ready to land.Jul 5 2022, 2:41 PM
This revision was landed with ongoing or failed builds.Jul 5 2022, 3:24 PM
This revision was automatically updated to reflect the committed changes.