This is an archive of the discontinued LLVM Phabricator instance.

[AMDGPU] Save fp/bp after csr saves
ClosedPublic

Authored by sebastian-ne on Feb 2 2021, 3:29 AM.

Details

Summary

Saving callee-save registers happens in whole wave mode. Exec is saved
to a free register, which can be reused to save the frame pointer.
Therefore, saving the fp needs to happen after saving csrs.

Diff Detail

Event Timeline

sebastian-ne created this revision.Feb 2 2021, 3:29 AM
sebastian-ne requested review of this revision.Feb 2 2021, 3:29 AM
Herald added a project: Restricted Project. · View Herald TranscriptFeb 2 2021, 3:29 AM
arsenm added inline comments.Feb 2 2021, 7:09 AM
llvm/test/CodeGen/AMDGPU/callee-frame-setup.ll
600–601

How is it saved to s0 when that's reserved for the first register in the scratch SRD?

608

This is trashing the SRD

sebastian-ne marked an inline comment as done.Feb 2 2021, 7:17 AM
sebastian-ne added inline comments.
llvm/test/CodeGen/AMDGPU/callee-frame-setup.ll
600–601

This is only with flat-scratch instructions enabled, so there is no SRD and s0–s3 are free

arsenm accepted this revision.Feb 2 2021, 7:41 AM
This revision is now accepted and ready to land.Feb 2 2021, 7:41 AM
This revision was landed with ongoing or failed builds.Feb 2 2021, 8:18 AM
This revision was automatically updated to reflect the committed changes.