[PATCH] D111637: [AMDGPU] Changes the AMDGPU_Gfx calling convention by making the SGPRs 4..29 callee-save. This is to avoid superfluous s_movs when executing amdgpu_gfx function calls as the callee is likely not going to change the argument values.

Sebastian Neubauer via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 12 09:08:43 PDT 2021


sebastian-ne added a comment.

The physical registers for the return address used by `s_setpc` need to go into a caller-save register and that seems to be wired to `CCR_SGPR_64` defined in SIRegisterInfo.td <https://github.com/llvm/llvm-project/blob/1112b7bad851c78af2159d39c7bff670a9c77da1/llvm/lib/Target/AMDGPU/SIRegisterInfo.td#L687-L692> as s0...s15.
That should be changed to s35..s63 for amdgpu_gfx functions.
I think that’s the cause for some of the spilling here and also for `no_stack_call` using stack (which it should not do).


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D111637/new/

https://reviews.llvm.org/D111637



More information about the llvm-commits mailing list