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

2021-04-17 Thread Yaxun Liu via Phabricator via cfe-commits
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

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

2021-04-17 Thread Yaxun Liu via Phabricator via cfe-commits
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

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

2021-03-22 Thread Artem Belevich via Phabricator via cfe-commits
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__

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

2021-03-21 Thread Yaxun Liu via Phabricator via cfe-commits
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

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

2021-03-21 Thread Yaxun Liu via Phabricator via cfe-commits
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

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

2021-03-17 Thread Artem Belevich via Phabricator via cfe-commits
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

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

2021-03-17 Thread Yaxun Liu via Phabricator via cfe-commits
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