[PATCH] D52891: [AMDGPU] Add -fvisibility-amdgpu-non-kernel-functions

Yaxun Liu via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Oct 10 09:17:22 PDT 2018


yaxunl added a comment.

In https://reviews.llvm.org/D52891#1258070, @scott.linder wrote:

> I will update the patch to modify the HIP toolchain and to add tests for global variables.
>
> As far as the semantics are concerned, are we OK with this being AMDGPU only? I do not see a means of determining what is a "kernel" in a language-agnostic way other than checking for our AMDGPU-specific calling convention. If there is a more general mechanism, this could be implemented in `LinkageComputer::getLVForNamespaceScopeDecl` instead. As it stands, it sounds like being AMDGPU specific, but omitting `amdgpu` from the option name is preferred?


The checking of kernel functions can be made target independent. For now we only need to consider OpenCL and CUDA/HIP.  We can check function attribute AT_CUDAGlobal and AT_OpenCLKernel. Then this option can be made target independent. HCC can add its own check out of tree.

> What about:
> 
>   -fvisibility-non-offload-functions=<arg>

This name looks good to me.


https://reviews.llvm.org/D52891





More information about the cfe-commits mailing list