diff options
author | Nicolai Haehnle <nhaehnle@gmail.com> | 2016-04-06 19:40:20 +0000 |
---|---|---|
committer | Nicolai Haehnle <nhaehnle@gmail.com> | 2016-04-06 19:40:20 +0000 |
commit | df3a20cd8068c732a0b26bdf8c1857c7d97104b4 (patch) | |
tree | 11974d0749ffa9d399f72a66fd5787d6ec248103 /llvm/lib/Target/AMDGPU/SIMachineFunctionInfo.cpp | |
parent | 1b6188d2f865366ef94d65b65596f47c9196c20c (diff) | |
download | bcm5719-llvm-df3a20cd8068c732a0b26bdf8c1857c7d97104b4.tar.gz bcm5719-llvm-df3a20cd8068c732a0b26bdf8c1857c7d97104b4.zip |
AMDGPU: Add a shader calling convention
This makes it possible to distinguish between mesa shaders
and other kernels even in the presence of compute shaders.
Patch By: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Differential Revision: http://reviews.llvm.org/D18559
llvm-svn: 265589
Diffstat (limited to 'llvm/lib/Target/AMDGPU/SIMachineFunctionInfo.cpp')
-rw-r--r-- | llvm/lib/Target/AMDGPU/SIMachineFunctionInfo.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/llvm/lib/Target/AMDGPU/SIMachineFunctionInfo.cpp b/llvm/lib/Target/AMDGPU/SIMachineFunctionInfo.cpp index 6b8d2566597..c56286e43ef 100644 --- a/llvm/lib/Target/AMDGPU/SIMachineFunctionInfo.cpp +++ b/llvm/lib/Target/AMDGPU/SIMachineFunctionInfo.cpp @@ -80,7 +80,7 @@ SIMachineFunctionInfo::SIMachineFunctionInfo(const MachineFunction &MF) const MachineFrameInfo *FrameInfo = MF.getFrameInfo(); - if (getShaderType() == ShaderType::COMPUTE) + if (!AMDGPU::isShader(F->getCallingConv())) KernargSegmentPtr = true; if (F->hasFnAttribute("amdgpu-work-group-id-y")) @@ -100,7 +100,7 @@ SIMachineFunctionInfo::SIMachineFunctionInfo(const MachineFunction &MF) if (WorkItemIDZ) WorkItemIDY = true; - bool MaySpill = ST.isVGPRSpillingEnabled(this); + bool MaySpill = ST.isVGPRSpillingEnabled(*F); bool HasStackObjects = FrameInfo->hasStackObjects(); if (HasStackObjects || MaySpill) @@ -202,5 +202,7 @@ unsigned SIMachineFunctionInfo::getMaximumWorkGroupSize( const AMDGPUSubtarget &ST = MF.getSubtarget<AMDGPUSubtarget>(); // FIXME: We should get this information from kernel attributes if it // is available. - return getShaderType() == ShaderType::COMPUTE ? 256 : ST.getWavefrontSize(); + if (AMDGPU::isCompute(MF.getFunction()->getCallingConv())) + return 256; + return ST.getWavefrontSize(); } |