[PATCH] D109594: [AMDGPU] Initialize LDS pointers after alloca, but before call.

Mahesha S via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Sep 10 04:50:55 PDT 2021


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

The LDS pointers need to be initialized within the entry basic block of
kernel(s) after all alloca, but before any call instruction. If this is
not possible, then we skip running this pass for now.

Ideally alloca can appear anywhere within the function, and the AMDGPU
backend should be able to handle it, but at the moment it cannot. Once
AMDGPU backend is able to robustly handle alloca inserted anywhere, then
this hack is no longer required.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D109594

Files:
  llvm/lib/Target/AMDGPU/AMDGPUReplaceLDSUseWithPointer.cpp
  llvm/test/CodeGen/AMDGPU/replace-lds-by-ptr-ignore-alloca-after-call.ll
  llvm/test/CodeGen/AMDGPU/replace-lds-by-ptr-split-entry-bb-after-alloca.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D109594.371881.patch
Type: text/x-patch
Size: 7619 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210910/4af04ce7/attachment.bin>


More information about the llvm-commits mailing list