[PATCH] D89994: [libomptarget][nvptx] Undef, internal shared variables
Johannes Doerfert via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Fri Oct 23 08:34:52 PDT 2020
jdoerfert added inline comments.
================
Comment at: clang/lib/CodeGen/CGOpenMPRuntimeGPU.cpp:2858
TransferMedium = new llvm::GlobalVariable(
- M, Ty, /*isConstant=*/false, llvm::GlobalVariable::CommonLinkage,
- llvm::Constant::getNullValue(Ty), TransferMediumName,
+ M, Ty, /*isConstant=*/false, llvm::GlobalVariable::InternalLinkage,
+ llvm::UndefValue::get(Ty), TransferMediumName,
----------------
ABataev wrote:
> "Internalization" is not the best option, it increases mem pressure. Common linkage is a better choice, allows to "squash" the same objects, defined in different units. Make it arch dependable, maybe?
> For NVPTX zero initialization is not a problem, it is resolved when PTX is generated.
FWIW, if we do not depend on the zero initialization, we should go with undef.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D89994/new/
https://reviews.llvm.org/D89994
More information about the cfe-commits
mailing list