[all-commits] [llvm/llvm-project] 095c48: [AMDGPU] Use "hostcall" module flag instead of sea...

kpyzhov via All-commits all-commits at lists.llvm.org
Tue Oct 5 06:56:31 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 095c48fdf3d27a4f346f8680d1d7e89449bb557b
      https://github.com/llvm/llvm-project/commit/095c48fdf3d27a4f346f8680d1d7e89449bb557b
  Author: kpyzhov <konstantin.pyzhov at amd.com>
  Date:   2021-10-05 (Tue, 05 Oct 2021)

  Changed paths:
    M llvm/lib/Target/AMDGPU/AMDGPUHSAMetadataStreamer.cpp
    M llvm/lib/Transforms/Utils/AMDGPUEmitPrintf.cpp
    M llvm/test/CodeGen/AMDGPU/hsa-metadata-hostcall-present-v3.ll

  Log Message:
  -----------
  [AMDGPU] Use "hostcall" module flag instead of searching for ockl_hostcall_internal() declaration.
The current way to detect hostcalls by looking for "ockl_hostcall_internal()" function in the module seems to be not reliable enough. The LTO may rename the "ockl_hostcall_internal()" function when an application is compiled with "-fgpu-rdc", and MetadataStreamer pass to fail to detect hostcalls, therefore it does not set the "hidden_hostcall_buffer" kernel argument.
This change adds a new module flag: hostcall that can be used to detect whether GPU functions use host calls for printf.

Differential revision: https://reviews.llvm.org/D110337




More information about the All-commits mailing list