[PATCH] D148824: AMDGPU: Define sub-class of SGPR_64 for tail call return

Sebastian Neubauer via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Apr 26 08:44:29 PDT 2023


sebastian-ne added a comment.

In D148824#4299075 <https://reviews.llvm.org/D148824#4299075>, @arsenm wrote:

> Stepping back for a moment, why does amdgpu_gfx use a different set of callee saved registers? It shouldn't really have different needs

Right, it does not have different needs.

Both, compute and graphics, pass user data in SGPR and want to preserve them through function calls.
In compute, all of this is handled through reserved registers in the AMDGPU backend. In graphics, everything is more variable, so we handle user-data in the frontend and add it as `inreg` arguments to all functions.

This is why for graphics, we need the calling convention to preserve SGPR arguments.

When it was proposed to do this for all calling conventions – compute and graphics – there were objections, so we ended up marking SGPR arguments callee save only for amdgpu_gfx.


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

https://reviews.llvm.org/D148824



More information about the llvm-commits mailing list