[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 19 04:13:13 PDT 2021


sebastian-ne added a comment.

The assembly changes look a lot better now.
Some of the mir tests have a lot of changes caused by the update scripts. Can you pre-commit these changes? (i.e. regenerate the tests on `main`, make sure they still pass, commit it and then rebase this review) That should make the diff more readable.



================
Comment at: llvm/lib/Target/AMDGPU/SIRegisterInfo.td:695-696
+// Call clobbered 64-bit SGPRs for AMDGPU_Gfx CC
+def Gfx_CCR_SGPR_64 : RegisterClass<"AMDGPU", SGPR_64.RegTypes, 32,
+                                (add (trunc (shl SGPR_64, 15), 33))> {
+  let CopyCost = SGPR_64.CopyCost;
----------------
If I understand this correctly, Gfx_CCR_SGPR_64 contains s[30:31], s[32:33], …, s[94:95] (33 pairs, starting with the 16th).
But it should not contain reserved registers like the stack pointer (s32, 33, 34) and also not contain callee-save registers (s64, s65, …).


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