[PATCH] D98814: [CUDA][HIP] Mark device var used by host only

Yaxun Liu via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sun Mar 21 07:23:39 PDT 2021


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


================
Comment at: clang/lib/CodeGen/CGCUDANV.cpp:1102
+          Info.D->isUsed() && !Info.D->hasAttr<UsedAttr>()) {
+        CGM.addCompilerUsedGlobal(Info.Var);
+      }
----------------
tra wrote:
> Do we want to limit it further to only externally-visible variables?
> I think we already externalize the variables we want to be visible across host/device boundary.
> If the variable is not visible, there's no point keeping it around as the runtime will not be able to find it in the GPU binary.
Good point. Will do


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

https://reviews.llvm.org/D98814



More information about the cfe-commits mailing list