aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Target/AMDGPU/AMDGPUMachineFunction.cpp
diff options
context:
space:
mode:
authorStanislav Mekhanoshin <Stanislav.Mekhanoshin@amd.com>2021-05-20 15:32:43 -0700
committerStanislav Mekhanoshin <Stanislav.Mekhanoshin@amd.com>2021-05-20 15:59:01 -0700
commit748db5bfacf1f81f65e8c052459ed3eca6aa18c8 (patch)
treed7e5ab8c9624433129a207e83272ddae9dbc1073 /llvm/lib/Target/AMDGPU/AMDGPUMachineFunction.cpp
parentb1140554e1b29f21b0d3657ce0700fa1726646ed (diff)
downloadllvm-748db5bfacf1f81f65e8c052459ed3eca6aa18c8.zip
llvm-748db5bfacf1f81f65e8c052459ed3eca6aa18c8.tar.gz
llvm-748db5bfacf1f81f65e8c052459ed3eca6aa18c8.tar.bz2
[AMDGPU] Fix module LDS selection
Accesses to global module LDS variable start from null, but kernel also thinks its variables start address is null. Fixed by not using a null as an address. Differential Revision: https://reviews.llvm.org/D102882
Diffstat (limited to 'llvm/lib/Target/AMDGPU/AMDGPUMachineFunction.cpp')
-rw-r--r--llvm/lib/Target/AMDGPU/AMDGPUMachineFunction.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/Target/AMDGPU/AMDGPUMachineFunction.cpp b/llvm/lib/Target/AMDGPU/AMDGPUMachineFunction.cpp
index 07806dd..0c743a7 100644
--- a/llvm/lib/Target/AMDGPU/AMDGPUMachineFunction.cpp
+++ b/llvm/lib/Target/AMDGPU/AMDGPUMachineFunction.cpp
@@ -64,7 +64,7 @@ unsigned AMDGPUMachineFunction::allocateLDSGlobal(const DataLayout &DL,
void AMDGPUMachineFunction::allocateModuleLDSGlobal(const Module *M) {
if (isModuleEntryFunction()) {
- GlobalVariable *GV = M->getGlobalVariable("llvm.amdgcn.module.lds");
+ const GlobalVariable *GV = M->getNamedGlobal("llvm.amdgcn.module.lds");
if (GV) {
unsigned Offset = allocateLDSGlobal(M->getDataLayout(), *GV);
(void)Offset;