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

Artem Belevich via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Feb 13 10:27:23 PST 2019


tra added inline comments.


================
Comment at: lib/CodeGen/CGCUDANV.cpp:128
+                         unsigned Flags) override {
+    DeviceVars.push_back(VarInfo{&Var, getDeviceSideName(VD), Flags});
   }
----------------
Nit: `VarInfo` is not needed. Compiler should be able to infer it.


================
Comment at: lib/CodeGen/CGCUDANV.cpp:412
+  for (auto &&I : EmittedKernels) {
+    llvm::Constant *KernelName = makeConstantString(I.DeviceSideName);
     llvm::Constant *NullPtr = llvm::ConstantPointerNull::get(VoidPtrTy);
----------------
Can we just call `getDeviceSideName()` here ? Mangling the name early and carrying it around does not seem to buy us anything.


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

https://reviews.llvm.org/D58163





More information about the cfe-commits mailing list