[PATCH] D95901: [CUDA][HIP] Fix device variable linkage

2021-02-05 Thread Yaxun Liu via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rGb008ea304d43: [CUDA][HIP] Fix device variable linkage (authored by yaxunl). Herald added a project: clang. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION

[PATCH] D95901: [CUDA][HIP] Fix device variable linkage

2021-02-03 Thread Artem Belevich via Phabricator via cfe-commits
tra added inline comments. Comment at: clang/lib/AST/ASTContext.cpp:11437-11443 + return ((!getLangOpts().GPURelocatableDeviceCode && + ((D->hasAttr() && + !D->getAttr()->isImplicit()) || +(D->hasAttr() && +

[PATCH] D95901: [CUDA][HIP] Fix device variable linkage

2021-02-03 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl updated this revision to Diff 321203. yaxunl added a comment. clang-format the patch CHANGES SINCE LAST ACTION https://reviews.llvm.org/D95901/new/ https://reviews.llvm.org/D95901 Files: clang/lib/AST/ASTContext.cpp clang/lib/CodeGen/CGCUDANV.cpp

[PATCH] D95901: [CUDA][HIP] Fix device variable linkage

2021-02-03 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl updated this revision to Diff 321198. yaxunl marked an inline comment as done. yaxunl added a comment. Revised by Artem's comments. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D95901/new/ https://reviews.llvm.org/D95901 Files: clang/lib/AST/ASTContext.cpp

[PATCH] D95901: [CUDA][HIP] Fix device variable linkage

2021-02-03 Thread Artem Belevich via Phabricator via cfe-commits
tra added inline comments. Comment at: clang/lib/AST/ASTContext.cpp:11437-11443 + return ((!getLangOpts().GPURelocatableDeviceCode && + ((D->hasAttr() && + !D->getAttr()->isImplicit()) || +(D->hasAttr() && +

[PATCH] D95901: [CUDA][HIP] Fix device variable linkage

2021-02-03 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl marked an inline comment as done. yaxunl added inline comments. Comment at: clang/lib/AST/ASTContext.cpp:11437-11443 + return ((!getLangOpts().GPURelocatableDeviceCode && + ((D->hasAttr() && + !D->getAttr()->isImplicit()) || +

[PATCH] D95901: [CUDA][HIP] Fix device variable linkage

2021-02-03 Thread Artem Belevich via Phabricator via cfe-commits
tra accepted this revision. tra added a comment. This revision is now accepted and ready to land. In D95901#2539754 , @yaxunl wrote: > For -fno-gpu-rdc, two TU's can have global device variables with the same > name, therefore the shadow variables need

[PATCH] D95901: [CUDA][HIP] Fix device variable linkage

2021-02-03 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl added a comment. In D95901#2539663 , @tra wrote: >> For -fgpu-rdc, shadow variables should not be internalized, otherwise they >> cannot be accessed by other TUs. >> This is necessary because the shadow variable of external device variables >>

[PATCH] D95901: [CUDA][HIP] Fix device variable linkage

2021-02-03 Thread Artem Belevich via Phabricator via cfe-commits
tra added a comment. > For -fgpu-rdc, shadow variables should not be internalized, otherwise they > cannot be accessed by other TUs. > This is necessary because the shadow variable of external device variables > are always emitted as undefined symbols, which need to resolve to a global >

[PATCH] D95901: [CUDA][HIP] Fix device variable linkage

2021-02-02 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl created this revision. yaxunl added a reviewer: tra. yaxunl requested review of this revision. For -fgpu-rdc, shadow variables should not be internalized, otherwise they cannot be accessed by other TUs. This is necessary because the shadow variable of external device variables are always