[PATCH] D57162: [DEBUG_INFO][NVPTX] Generate correct data about variable address class.

Artem Belevich via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Jan 30 09:58:26 PST 2019


tra added inline comments.


================
Comment at: lib/CodeGen/CGDebugInfo.cpp:4235
         CGM.getContext().getTargetAddressSpace(D->getType());
+    if (CGM.getLangOpts().CUDA && CGM.getLangOpts().CUDAIsDevice) {
+      if (D->hasAttr<CUDASharedAttr>())
----------------
probinson wrote:
> Can a variable have one of these CUDA attributes when CUDAIsDevice is false? I'm just wondering if the extra level of checking is really necessary or useful.
`__shared__` are probably not going to be encountered on the host side, but `__constant__` ones may be.  E.g. we may have a global `__constant__` variable which will have a host-side address (it's actually the address of its host-side 'shadow') which may be used by various CUDA functions to refer to it's real device-side instance.


Repository:
  rC Clang

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

https://reviews.llvm.org/D57162





More information about the cfe-commits mailing list