[PATCH] D68578: [HIP] Fix device stub name

Yaxun Liu via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Oct 7 07:45:05 PDT 2019


yaxunl created this revision.
yaxunl added reviewers: tra, rjmccall, hliao.
Herald added a subscriber: erik.pilkington.

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.


https://reviews.llvm.org/D68578

Files:
  include/clang/AST/Mangle.h
  lib/AST/ItaniumMangle.cpp
  lib/CodeGen/CGCUDANV.cpp
  test/CodeGenCUDA/kernel-stub-name.cu

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D68578.223598.patch
Type: text/x-patch
Size: 6023 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20191007/c94cfffb/attachment-0001.bin>


More information about the cfe-commits mailing list