[PATCH] D108421: Mark openmp internal global dso_local
kamlesh kumar via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Thu Aug 19 16:11:40 PDT 2021
kamleshbhalui created this revision.
kamleshbhalui added reviewers: MaskRay, pengfei.
kamleshbhalui added a project: OpenMP.
Herald added subscribers: guansong, yaxunl.
kamleshbhalui requested review of this revision.
Herald added a reviewer: jdoerfert.
Herald added subscribers: cfe-commits, sstefan1.
Herald added a project: clang.
Starting from clang-12 openmp started generating internal global variable with got relocation even when static relocation enabled.
In clang-11 shouldAssumeDSOLocal was assuming it dso_local based on static relocation model.
Since shouldAssumeDSOLocal is cleaned up now for respecting dso_local generated from frontend, marking openmp internal globals as dso_local.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D108421
Files:
clang/lib/CodeGen/CGOpenMPRuntime.cpp
Index: clang/lib/CodeGen/CGOpenMPRuntime.cpp
===================================================================
--- clang/lib/CodeGen/CGOpenMPRuntime.cpp
+++ clang/lib/CodeGen/CGOpenMPRuntime.cpp
@@ -2179,11 +2179,14 @@
return &*Elem.second;
}
- return Elem.second = new llvm::GlobalVariable(
+ llvm::GlobalVariable *GV = new llvm::GlobalVariable(
CGM.getModule(), Ty, /*IsConstant*/ false,
llvm::GlobalValue::CommonLinkage, llvm::Constant::getNullValue(Ty),
Elem.first(), /*InsertBefore=*/nullptr,
llvm::GlobalValue::NotThreadLocal, AddressSpace);
+ GV->setDSOLocal(true);
+ Elem.second = GV;
+ return Elem.second;
}
llvm::Value *CGOpenMPRuntime::getCriticalRegionLock(StringRef CriticalName) {
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D108421.367643.patch
Type: text/x-patch
Size: 772 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20210819/9c02c223/attachment.bin>
More information about the cfe-commits
mailing list