diff options
author | Matt Arsenault <Matthew.Arsenault@amd.com> | 2017-05-02 18:33:18 +0000 |
---|---|---|
committer | Matt Arsenault <Matthew.Arsenault@amd.com> | 2017-05-02 18:33:18 +0000 |
commit | 5c80618fb78e5571e859e42b7ff2f062f5fc6f81 (patch) | |
tree | 5f535d41dbe0befad4414c3d66dfdd4f6b8c1ba3 /llvm/lib/Target | |
parent | fca6fae463fadf7f3f6b96db7e41a7727cd86e7e (diff) | |
download | bcm5719-llvm-5c80618fb78e5571e859e42b7ff2f062f5fc6f81.tar.gz bcm5719-llvm-5c80618fb78e5571e859e42b7ff2f062f5fc6f81.zip |
AMDGPU: Don't promote alloca to LDS for leaf functions
LDS use in leaf functions not currently handled.
llvm-svn: 301958
Diffstat (limited to 'llvm/lib/Target')
-rw-r--r-- | llvm/lib/Target/AMDGPU/AMDGPUPromoteAlloca.cpp | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/llvm/lib/Target/AMDGPU/AMDGPUPromoteAlloca.cpp b/llvm/lib/Target/AMDGPU/AMDGPUPromoteAlloca.cpp index 4fb262c6277..36dcc699d4e 100644 --- a/llvm/lib/Target/AMDGPU/AMDGPUPromoteAlloca.cpp +++ b/llvm/lib/Target/AMDGPU/AMDGPUPromoteAlloca.cpp @@ -677,12 +677,19 @@ void AMDGPUPromoteAlloca::handleAlloca(AllocaInst &I) { } const Function &ContainingFunction = *I.getParent()->getParent(); + CallingConv::ID CC = ContainingFunction.getCallingConv(); // Don't promote the alloca to LDS for shader calling conventions as the work // item ID intrinsics are not supported for these calling conventions. // Furthermore not all LDS is available for some of the stages. - if (AMDGPU::isShader(ContainingFunction.getCallingConv())) + switch (CC) { + case CallingConv::AMDGPU_KERNEL: + case CallingConv::SPIR_KERNEL: + break; + default: + DEBUG(dbgs() << " promote alloca to LDS not supported with calling convention.\n"); return; + } const AMDGPUSubtarget &ST = TM->getSubtarget<AMDGPUSubtarget>(ContainingFunction); |