[AMDGPU] Replace non-kernel function uses of LDS globals by pointers.
authorhsmahesha <mahesha.comp@gmail.com>
Mon, 21 Jun 2021 05:25:23 +0000 (10:55 +0530)
committerhsmahesha <mahesha.comp@gmail.com>
Mon, 21 Jun 2021 06:21:49 +0000 (11:51 +0530)
commit80fd5fa5269ce102b3126d2de49970e3af6719d5
tree63145e8d70d38d566738e81f7fb170067d2625a6
parent7a97cd9da787d560fee397eb598360349734711e
[AMDGPU] Replace non-kernel function uses of LDS globals by pointers.

The main motivation behind pointer replacement of LDS use within non-kernel
functions is - to *avoid* subsequent LDS lowering pass from directly packing
LDS (assume large LDS) into a struct type which would otherwise cause allocating
huge memory for struct instance within every kernel.

Reviewed By: rampitec

Differential Revision: https://reviews.llvm.org/D103225
24 files changed:
llvm/lib/Target/AMDGPU/AMDGPU.h
llvm/lib/Target/AMDGPU/AMDGPULowerModuleLDSPass.cpp
llvm/lib/Target/AMDGPU/AMDGPUReplaceLDSUseWithPointer.cpp [new file with mode: 0644]
llvm/lib/Target/AMDGPU/AMDGPUTargetMachine.cpp
llvm/lib/Target/AMDGPU/CMakeLists.txt
llvm/lib/Target/AMDGPU/Utils/AMDGPULDSUtils.cpp
llvm/lib/Target/AMDGPU/Utils/AMDGPULDSUtils.h
llvm/test/CodeGen/AMDGPU/llc-pipeline.ll
llvm/test/CodeGen/AMDGPU/replace-lds-by-ptr-call-diamond-shape.ll [new file with mode: 0644]
llvm/test/CodeGen/AMDGPU/replace-lds-by-ptr-call-selected_functions.ll [new file with mode: 0644]
llvm/test/CodeGen/AMDGPU/replace-lds-by-ptr-ignore-global-scope-use.ll [new file with mode: 0644]
llvm/test/CodeGen/AMDGPU/replace-lds-by-ptr-ignore-inline-asm-call.ll [new file with mode: 0644]
llvm/test/CodeGen/AMDGPU/replace-lds-by-ptr-ignore-kernel-only-used-lds.ll [new file with mode: 0644]
llvm/test/CodeGen/AMDGPU/replace-lds-by-ptr-ignore-not-reachable-lds.ll [new file with mode: 0644]
llvm/test/CodeGen/AMDGPU/replace-lds-by-ptr-ignore-small-lds.ll [new file with mode: 0644]
llvm/test/CodeGen/AMDGPU/replace-lds-by-ptr-indirect-call-diamond-shape.ll [new file with mode: 0644]
llvm/test/CodeGen/AMDGPU/replace-lds-by-ptr-indirect-call-selected_functions.ll [new file with mode: 0644]
llvm/test/CodeGen/AMDGPU/replace-lds-by-ptr-indirect-call-signature-match.ll [new file with mode: 0644]
llvm/test/CodeGen/AMDGPU/replace-lds-by-ptr-lds-offsets.ll [new file with mode: 0644]
llvm/test/CodeGen/AMDGPU/replace-lds-by-ptr-use-multiple-lds.ll [new file with mode: 0644]
llvm/test/CodeGen/AMDGPU/replace-lds-by-ptr-use-same-lds.ll [new file with mode: 0644]
llvm/test/CodeGen/AMDGPU/replace-lds-by-ptr-use-within-const-expr1.ll [new file with mode: 0644]
llvm/test/CodeGen/AMDGPU/replace-lds-by-ptr-use-within-const-expr2.ll [new file with mode: 0644]
llvm/test/CodeGen/AMDGPU/replace-lds-by-ptr-use-within-phi-inst.ll [new file with mode: 0644]