[PATCH] D153517: [AMDGPU] ISel for amdgpu_cs_chain[_preserve] functions

Diana Picus via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jun 22 03:28:13 PDT 2023


rovka created this revision.
Herald added subscribers: foad, kerbowa, hiraditya, tpr, dstuttard, yaxunl, jvesely, kzhuravl, arsenm.
Herald added a project: All.
rovka requested review of this revision.
Herald added subscribers: llvm-commits, wdng.
Herald added a project: LLVM.

Lower formal arguments and returns for functions with the
`amdgpu_cs_chain` and `amdgpu_cs_chain_preserve` calling conventions:

- Put `inreg` arguments into SGPRs, starting at s0, and other arguments

into VGPRs, starting at v8. No arguments should end up on the stack, if
we don't have enough registers we should error out.

- Lower the return (which is always void) as an S_ENDPGM.

- Set the ScratchRSrc register to s48:51, as described in the docs.

- Set the SP to s105, for now. This should definitely be revisited in

a future patch (I left a fixme for now).


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D153517

Files:
  llvm/lib/Target/AMDGPU/AMDGPUCallingConv.td
  llvm/lib/Target/AMDGPU/AMDGPUISelLowering.cpp
  llvm/lib/Target/AMDGPU/SIMachineFunctionInfo.cpp
  llvm/lib/Target/AMDGPU/Utils/AMDGPUBaseInfo.cpp
  llvm/lib/Target/AMDGPU/Utils/AMDGPUBaseInfo.h
  llvm/test/CodeGen/AMDGPU/amdgpu-cs-chain-cc.ll
  llvm/test/CodeGen/AMDGPU/amdgpu-cs-chain-preserve-cc.ll



More information about the llvm-commits mailing list