[PATCH] D61494: AMDGPU: Write LDS objects out as global symbols in code generation

Nicolai Hähnle via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri May 3 05:04:13 PDT 2019


nhaehnle created this revision.
nhaehnle added reviewers: arsenm, rampitec, t-tye, b-sumner, jsjodin.
Herald added subscribers: tpr, dstuttard, yaxunl, wdng, jvesely, kzhuravl, qcolombet.
Herald added a project: LLVM.

The symbols are of the STT_AMDGPU_LDS type introduced with a previous
change. The linker is then expected to resolve relocations, which are
also emitted.

Initially disabled for HSA and PAL environments until they have caught up
in terms of linker and runtime loader.

Some notes:

- The llvm.amdgcn.groupstaticsize intrinsics can no longer be lowered to a constant at compile times, which means some tests can no longer be applied.

  The current "solution" is a terrible hack, but the intrinsic isn't used by Mesa, so we can keep it for now.

- We no longer know the full LDS size per kernel at compile time, which means that we can no longer generate a relevant error message at compile time. It would be possible to add a check for the size of individual variables, but ultimately the linker will have to perform the final check.

Change-Id: If66dbf33fccfbf3609aefefa2558ac0850d42275


Repository:
  rL LLVM

https://reviews.llvm.org/D61494

Files:
  include/llvm/CodeGen/AsmPrinter.h
  include/llvm/CodeGen/MachineOperand.h
  lib/CodeGen/MachineOperand.cpp
  lib/Target/AMDGPU/AMDGPUAsmPrinter.cpp
  lib/Target/AMDGPU/SIFoldOperands.cpp
  lib/Target/AMDGPU/SIISelLowering.cpp
  lib/Target/AMDGPU/SIISelLowering.h
  lib/Target/AMDGPU/SIInstrInfo.cpp
  test/CodeGen/AMDGPU/32-bit-local-address-space.ll
  test/CodeGen/AMDGPU/constant-fold-mi-operands.ll
  test/CodeGen/AMDGPU/ds-sub-offset.ll
  test/CodeGen/AMDGPU/ds_read2.ll
  test/CodeGen/AMDGPU/ds_write2.ll
  test/CodeGen/AMDGPU/lds-initializer.ll
  test/CodeGen/AMDGPU/lds-relocs.ll
  test/CodeGen/AMDGPU/lds-size.ll
  test/CodeGen/AMDGPU/lds-zero-initializer.ll
  test/CodeGen/AMDGPU/llvm.amdgcn.atomic.dec.ll
  test/CodeGen/AMDGPU/llvm.amdgcn.atomic.inc.ll
  test/CodeGen/AMDGPU/llvm.amdgcn.groupstaticsize.ll
  test/CodeGen/AMDGPU/llvm.amdgcn.update.dpp.ll
  test/CodeGen/AMDGPU/local-memory.amdgcn.ll
  test/CodeGen/AMDGPU/local-memory.ll
  test/CodeGen/AMDGPU/merge-store-crash.ll
  test/CodeGen/AMDGPU/over-max-lds-size.ll
  test/CodeGen/AMDGPU/promote-alloca-globals.ll
  test/CodeGen/AMDGPU/s_addk_i32.ll
  test/CodeGen/AMDGPU/s_mulk_i32.ll
  test/CodeGen/AMDGPU/shl_add_ptr.ll
  test/CodeGen/AMDGPU/si-sgpr-spill.ll
  test/CodeGen/AMDGPU/sopk-compares.ll
  test/CodeGen/AMDGPU/sub.i16.ll
  test/CodeGen/AMDGPU/target-cpu.ll
  test/CodeGen/MIR/AMDGPU/machine-function-info.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D61494.197962.patch
Type: text/x-patch
Size: 61413 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190503/ccfda838/attachment.bin>


More information about the llvm-commits mailing list