]> granicus.if.org Git - llvm/commit
AMDGPU: Write LDS objects out as global symbols in code generation
authorNicolai Haehnle <nhaehnle@gmail.com>
Tue, 25 Jun 2019 11:52:30 +0000 (11:52 +0000)
committerNicolai Haehnle <nhaehnle@gmail.com>
Tue, 25 Jun 2019 11:52:30 +0000 (11:52 +0000)
commit90f5eff5ac4c8818136a7f66a22b9971f5bb6260
tree41d8534544c5c014da3588e6e65a0ded2a7a04b4
parentf1a1a392dbca5a0240b26a88ea3bc470e8df62cd
AMDGPU: Write LDS objects out as global symbols in code generation

Summary:
The symbols use the processor-specific SHN_AMDGPU_LDS section index
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

Reviewers: arsenm, rampitec, t-tye, b-sumner, jsjodin

Subscribers: qcolombet, kzhuravl, jvesely, wdng, yaxunl, dstuttard, tpr, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D61494

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@364297 91177308-0d34-0410-b5e6-96231b3b80d8
29 files changed:
lib/Target/AMDGPU/AMDGPUAsmPrinter.cpp
lib/Target/AMDGPU/AMDGPUISelLowering.cpp
lib/Target/AMDGPU/AMDGPUISelLowering.h
lib/Target/AMDGPU/SIFoldOperands.cpp
lib/Target/AMDGPU/SIISelLowering.cpp
lib/Target/AMDGPU/SIInstrInfo.cpp
lib/Target/AMDGPU/SIInstrInfo.td
lib/Target/AMDGPU/SIInstructions.td
lib/Target/AMDGPU/SIShrinkInstructions.cpp
test/CodeGen/AMDGPU/32-bit-local-address-space.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 [new file with mode: 0644]
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/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 [deleted file]
test/CodeGen/AMDGPU/promote-alloca-globals.ll
test/CodeGen/AMDGPU/shl_add_ptr.ll
test/CodeGen/AMDGPU/si-sgpr-spill.ll
test/CodeGen/AMDGPU/target-cpu.ll
test/CodeGen/MIR/AMDGPU/machine-function-info.ll