[PATCH] D130784: [AMDGPU] Support LDS spilling

Piotr Sobczak via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jul 29 09:00:33 PDT 2022


piotr created this revision.
Herald added subscribers: kosarev, jsilvanus, foad, kerbowa, hiraditya, t-tye, tpr, dstuttard, yaxunl, nhaehnle, jvesely, kzhuravl, arsenm, qcolombet.
Herald added a project: All.
piotr requested review of this revision.
Herald added subscribers: llvm-commits, wdng.
Herald added a project: LLVM.

Add experimental support for LDS spilling on targets >= gfx9.

The amount of LDS is controlled by the attribute amdgpu-lds-spill-limit-dwords.
The default value of 0 means that LDS spilling is disabled.

The implementation utilizes DS_READ_ADDTID/DS_WRITE_ADDTID instructions.

For cases where workgroup size is larger than wave size, MultiDispatchInfo
(user sgpr in PAL front-end) is used to offset the address accordingly.
With some extra work, compute could use WorkGroupInfo to drive the spill
in the backend. Sadly, the way the values are preloaded is different between
graphics and compute (user sgpr versus system sgpr).

Tested on real-world graphics content (compute and pixel shaders).


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D130784

Files:
  llvm/lib/Target/AMDGPU/AMDGPUAsmPrinter.cpp
  llvm/lib/Target/AMDGPU/AMDGPUResourceUsageAnalysis.cpp
  llvm/lib/Target/AMDGPU/AMDGPUSubtarget.cpp
  llvm/lib/Target/AMDGPU/GCNSubtarget.h
  llvm/lib/Target/AMDGPU/SIFrameLowering.cpp
  llvm/lib/Target/AMDGPU/SIFrameLowering.h
  llvm/lib/Target/AMDGPU/SIISelLowering.cpp
  llvm/lib/Target/AMDGPU/SIMachineFunctionInfo.cpp
  llvm/lib/Target/AMDGPU/SIMachineFunctionInfo.h
  llvm/lib/Target/AMDGPU/SIRegisterInfo.cpp
  llvm/lib/Target/AMDGPU/SIRegisterInfo.h
  llvm/test/CodeGen/AMDGPU/lds-spill-cs.ll
  llvm/test/CodeGen/AMDGPU/lds-spill-ps.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D130784.448649.patch
Type: text/x-patch
Size: 31425 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220729/3d9109d9/attachment.bin>


More information about the llvm-commits mailing list