[all-commits] [llvm/llvm-project] 22c457: [HIP] Fix device stub name

Yaxun (Sam) Liu via All-commits all-commits at lists.llvm.org
Mon Mar 9 13:42:22 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 22c457a869d5dd9d7e6ca0f97e2a8408bf7326f2
      https://github.com/llvm/llvm-project/commit/22c457a869d5dd9d7e6ca0f97e2a8408bf7326f2
  Author: Yaxun (Sam) Liu <yaxun.liu at amd.com>
  Date:   2020-03-09 (Mon, 09 Mar 2020)

  Changed paths:
    M clang/include/clang/AST/GlobalDecl.h
    M clang/lib/AST/Expr.cpp
    M clang/lib/AST/ItaniumMangle.cpp
    M clang/lib/AST/Mangle.cpp
    M clang/lib/CodeGen/CGCUDANV.cpp
    M clang/lib/CodeGen/CGCUDARuntime.h
    M clang/lib/CodeGen/CGDecl.cpp
    M clang/lib/CodeGen/CGExpr.cpp
    M clang/lib/CodeGen/CodeGenModule.cpp
    M clang/lib/CodeGen/CodeGenModule.h
    M clang/test/CodeGenCUDA/amdgpu-kernel-arg-pointer-type.cu
    M clang/test/CodeGenCUDA/kernel-stub-name.cu
    M clang/test/CodeGenCUDA/unnamed-types.cu

  Log Message:
  -----------
  [HIP] Fix device stub name

HIP emits a device stub function for each kernel in host code.

The HIP debugger requires device stub function to have a different unmangled name as the kernel.

Currently the name of the device stub function is the mangled name with a postfix .stub. However,
this does not work with the HIP debugger since the unmangled name is the same as the kernel.

This patch adds prefix __device__stub__ to the unmangled name of the device stub before mangling,
therefore the device stub function has a valid mangled name which is different than the device kernel
name. The device side kernel name is kept unchanged. kernels with extern "C" also gets the prefix added
to the corresponding device stub function.

Differential Revision: https://reviews.llvm.org/D68578




More information about the All-commits mailing list