[PATCH] D58163: [CUDA][HIP] Use device side kernel and variable names when registering them

Yaxun Liu via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Feb 13 11:27:13 PST 2019


yaxunl marked an inline comment as done.
yaxunl added inline comments.


================
Comment at: lib/CodeGen/CGCUDANV.cpp:412
+  for (auto &&I : EmittedKernels) {
+    llvm::Constant *KernelName = makeConstantString(I.DeviceSideName);
     llvm::Constant *NullPtr = llvm::ConstantPointerNull::get(VoidPtrTy);
----------------
tra wrote:
> yaxunl wrote:
> > tra wrote:
> > > Can we just call `getDeviceSideName()` here ? Mangling the name early and carrying it around does not seem to buy us anything.
> > getDeviceSideName() need to know Decl of the function. If we want to call it here, we have to carry Decl of the functions around.
> I see. We appear to get both the Decl and llvm::function from CodeGenFunction.  
> Perhaps we can make `EmittedKernels` a vector<CodeGenFunction*>.
> 
> It's just a nit. I'll leave it up to you.
Carrying Decl around is better than carrying string around since it can save some space. Will do it.


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

https://reviews.llvm.org/D58163





More information about the cfe-commits mailing list