[PATCH] D110337: [AMDGPU] Use "amdgpu-hostcalls" attribute to detect if a kernel function hostcall for GPU printf.

Yaxun Liu via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Sep 30 07:59:05 PDT 2021


yaxunl added a comment.

In D110337#3032569 <https://reviews.llvm.org/D110337#3032569>, @sameerds wrote:

> In D110337#3032494 <https://reviews.llvm.org/D110337#3032494>, @yaxunl wrote:
>
>> We need to check the IR to know whether host call is needed since backend depends on that to determine whether to emit implicit kernel arg runtime metadata. How do we check IR for your approach? Are you suggesting to convey the host call information by symbol instead of runtime metadata? That would be an ABI change.
>
> Yeah, the real requirement here is to have something that remains stable until the metadata streamer. It should not be visible to anything outside the compiler. A function attribute does look like overkill. Can we tweak the linkage type of __ockl_hostcall_internal() to protect it from getting renamed by LTO? Alternatively, this could be one of the rare cases that qualify for"@llvm.compiler.used"?

when clang links device library with -mlink-builtin-bitcode, all functions are internalized, so tweak linkage of __ockl_hostcall_internal does not work.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D110337/new/

https://reviews.llvm.org/D110337



More information about the llvm-commits mailing list