[PATCH] D63335: [HIP] Add the interface deriving the stub name of device kernels.

Artem Belevich via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Jun 14 15:19:33 PDT 2019


tra accepted this revision.
tra added a comment.
This revision is now accepted and ready to land.

LGTM. This is a cleaner way to provide stub name tweaks.



================
Comment at: clang/lib/CodeGen/CGCUDANV.cpp:223
+  // Ensure either we have different ABIs between host and device compilations,
+  // says host compilation following MSVC ABI but device compilation follows
+  // Itanium C++ ABI or, if they follow the same ABI, kernel names after
----------------
says .... -> (e.g. ....)


================
Comment at: clang/lib/CodeGen/CGCUDANV.cpp:225
+  // Itanium C++ ABI or, if they follow the same ABI, kernel names after
+  // mangling should be same after name stubbing. The later checking is very
+  // important as the device kernel name being mangled in host-compilation is
----------------
... should be `the same` ...
or, perhaps, `identical`


================
Comment at: clang/lib/CodeGen/CodeGenModule.cpp:1091
 
-  // Postfix kernel stub names with .stub to differentiate them from kernel
-  // names in device binaries. This is to facilitate the debugger to find
-  // the correct symbols for kernels in the device binary.
+  // Derive the kernel stub from CUDA runtime.
   if (auto *FD = dyn_cast<FunctionDecl>(GD.getDecl()))
----------------
Adjust kernel stub mangling as we may need to be able to differentiate them from the kernel itself (e.g. for HIP).


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D63335





More information about the cfe-commits mailing list