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

Sameer Sahasrabuddhe via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 29 22:45:00 PDT 2021


sameerds added a comment.

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"?


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