diff options
| author | Tony Tye <Tony.Tye@amd.com> | 2018-03-23 18:43:15 +0000 |
|---|---|---|
| committer | Tony Tye <Tony.Tye@amd.com> | 2018-03-23 18:43:15 +0000 |
| commit | 1a3f3a2d14946b41d176454a4f1843ef8e914a9e (patch) | |
| tree | 04fcf4e9fe8f6559e380fcc4997f212fbeabe4c9 /clang/lib/CodeGen | |
| parent | 5f7ba9a74c5dca7e89f601ab6968c5e9ada30ade (diff) | |
| download | bcm5719-llvm-1a3f3a2d14946b41d176454a4f1843ef8e914a9e.tar.gz bcm5719-llvm-1a3f3a2d14946b41d176454a4f1843ef8e914a9e.zip | |
[AMDGPU] Remove use of OpenCL triple environment and replace with function attribute for AMDGPU (CLANG)
- Remove use of the opencl and amdopencl environment member of the target triple for the AMDGPU target.
- Use a function attribute to communicate to the AMDGPU backend.
Differential Revision: https://reviews.llvm.org/D43735
llvm-svn: 328347
Diffstat (limited to 'clang/lib/CodeGen')
| -rw-r--r-- | clang/lib/CodeGen/TargetInfo.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/clang/lib/CodeGen/TargetInfo.cpp b/clang/lib/CodeGen/TargetInfo.cpp index 01eb6ead163..435565dce3f 100644 --- a/clang/lib/CodeGen/TargetInfo.cpp +++ b/clang/lib/CodeGen/TargetInfo.cpp @@ -7661,6 +7661,11 @@ void AMDGPUTargetCodeGenInfo::setTargetAttributes( const auto *ReqdWGS = M.getLangOpts().OpenCL ? FD->getAttr<ReqdWorkGroupSizeAttr>() : nullptr; + + if (M.getLangOpts().OpenCL && FD->hasAttr<OpenCLKernelAttr>() && + (M.getTriple().getOS() == llvm::Triple::AMDHSA)) + F->addFnAttr("amdgpu-implicitarg-num-bytes", "32"); + const auto *FlatWGS = FD->getAttr<AMDGPUFlatWorkGroupSizeAttr>(); if (ReqdWGS || FlatWGS) { unsigned Min = FlatWGS ? FlatWGS->getMin() : 0; |

