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

Changpeng Fang via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 20 11:20:53 PDT 2023


cfang created this revision.
cfang added reviewers: arsenm, cdevadas, sebastian-ne, foad, bcahoon.
Herald added subscribers: kosarev, StephenFan, kerbowa, hiraditya, tpr, dstuttard, yaxunl, jvesely, kzhuravl, qcolombet, MatzeB.
Herald added a project: All.
cfang requested review of this revision.
Herald added a subscriber: wdng.
Herald added a project: LLVM.

  Registers for tail call return should not be clobbered by callee.

So we need a sub-class of SGPR_64 (excluding callee saved registers (CSR)) to hold
the tail call return address.

Because GFX and C calling conventions have different CSR, we need to define 
 the sub-class separately. This work is an extension of D147096 <https://reviews.llvm.org/D147096> with the 
 consideration of GFX calling convention.

Based on the calling conventions, different instructions will be selected with
 different sub-class of SGPR_64 as the input.


https://reviews.llvm.org/D148824

Files:
  llvm/lib/Target/AMDGPU/AMDGPUCallLowering.cpp
  llvm/lib/Target/AMDGPU/AMDGPUISelLowering.cpp
  llvm/lib/Target/AMDGPU/AMDGPUISelLowering.h
  llvm/lib/Target/AMDGPU/AMDGPUInstrInfo.td
  llvm/lib/Target/AMDGPU/AMDGPUMCInstLower.cpp
  llvm/lib/Target/AMDGPU/SIISelLowering.cpp
  llvm/lib/Target/AMDGPU/SIInstructions.td
  llvm/lib/Target/AMDGPU/SIRegisterInfo.td
  llvm/test/CodeGen/AMDGPU/inline-asm.i128.ll
  llvm/test/CodeGen/AMDGPU/partial-regcopy-and-spill-missed-at-regalloc.ll
  llvm/test/CodeGen/AMDGPU/tail-call-amdgpu-gfx.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D148824.515399.patch
Type: text/x-patch
Size: 17814 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230420/40394503/attachment-0001.bin>


More information about the llvm-commits mailing list