[PATCH] D127052: [amdgpu][nfc] Allocate kernel-specific LDS struct deterministically

Jon Chesterfield via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat Jun 4 09:41:18 PDT 2022


JonChesterfield created this revision.
JonChesterfield added reviewers: arsenm, rampitec, ronlieb, foad, bcahoon, carlo.bertolli, jhuber6.
Herald added subscribers: kosarev, jsilvanus, hsmhsm, kerbowa, mgrang, hiraditya, t-tye, tpr, dstuttard, yaxunl, nhaehnle, jvesely, kzhuravl.
Herald added a project: All.
JonChesterfield requested review of this revision.
Herald added subscribers: llvm-commits, wdng.
Herald added a project: LLVM.

A kernel may have an associated struct for laying out LDS variables.
This patch puts that instance, if present, at a deterministic address by
allocating it at the same time as the module scope instance.

This is relatively likely to be where the instance was allocated anyway (~NFC)
but will allow later patches to calculate where a given field can be found,
which means a function which is only reachable from a single kernel will be
able to access a LDS variable with zero overhead. That will be particularly
helpful for applications that instantiate a function template containing LDS
variables once per kernel.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D127052

Files:
  llvm/lib/Target/AMDGPU/AMDGPUCallLowering.cpp
  llvm/lib/Target/AMDGPU/AMDGPUMachineFunction.cpp
  llvm/lib/Target/AMDGPU/AMDGPUMachineFunction.h
  llvm/lib/Target/AMDGPU/SIISelLowering.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D127052.434274.patch
Type: text/x-patch
Size: 5527 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220604/3a8c7f32/attachment.bin>


More information about the llvm-commits mailing list