This revision was automatically updated to reflect the committed changes.
yaxunl marked 2 inline comments as done.
Closed by commit rGd5c0f00e216a: [CUDA][HIP] Mark device var used by host only
(authored by yaxunl).
Herald added a project: clang.
Changed prior to commit:
https://reviews.llvm.or
yaxunl marked 2 inline comments as done.
yaxunl added inline comments.
Comment at: clang/test/CodeGenCUDA/host-used-device-var.cu:31-33
+// Check device-used static device var is not in llvm.compiler.used.
+// CHECK-DAG: @_ZL2u4
+static __device__ int u4;
tra wro
tra accepted this revision.
tra added inline comments.
This revision is now accepted and ready to land.
Comment at: clang/test/CodeGenCUDA/host-used-device-var.cu:31-33
+// Check device-used static device var is not in llvm.compiler.used.
+// CHECK-DAG: @_ZL2u4
+static __device__
yaxunl updated this revision to Diff 332157.
yaxunl marked an inline comment as done.
yaxunl added a comment.
revised by Artem's comments
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D98814/new/
https://reviews.llvm.org/D98814
Files:
clang/lib/CodeGen/CGCUDANV.cpp
clang/test/CodeGe
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()) {
+CGM.addCompilerUsedGlobal(Info.Var);
+ }
tra wrote:
> Do we want to limit it
tra added inline comments.
Comment at: clang/lib/CodeGen/CGCUDANV.cpp:1102
+ Info.D->isUsed() && !Info.D->hasAttr()) {
+CGM.addCompilerUsedGlobal(Info.Var);
+ }
Do we want to limit it further to only externally-visible variables?
I think we
yaxunl created this revision.
yaxunl added a reviewer: tra.
yaxunl requested review of this revision.
Add device variables to llvm.compiler.used if they are
ODR-used by either host or device functions.
This is necessary to prevent them from being
eliminated by whole-program optimization
where the