[PATCH] D114652: [AMDGPU] Move call clobbered return address registers s[30:31] to callee saved range

Venkata Ramanaiah Nalamothu via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Mar 8 08:43:26 PST 2022


RamNalamothu marked 2 inline comments as done.
RamNalamothu added a comment.

In D114652#3367310 <https://reviews.llvm.org/D114652#3367310>, @arsenm wrote:

> I'm not sure I understand why a separate isPhysRegUsed check is needed since ultimately that's what IPRA is doing, but I don't see how it could hurt

The separate `isPhysRegModified` check is needed because we will have the SI_RETURN pseudo, which doesn't have return address operand/use, when IPRA's register usage collection runs and that hides the return address use.
Since the caller function save/restores return address registers, as the call instruction clobbers them, and return address registers use in the callee function is hidden, the IPRA/register allocator concludes that return address registers can be clobbered without save/restoring them in the callee function if the callee function doesn't have any function calls.

Hope that helps.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D114652



More information about the llvm-commits mailing list