summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CGOpenMPRuntime.cpp
diff options
context:
space:
mode:
authorGheorghe-Teodor Bercea <gheorghe-teod.bercea@ibm.com>2019-06-14 17:58:26 +0000
committerGheorghe-Teodor Bercea <gheorghe-teod.bercea@ibm.com>2019-06-14 17:58:26 +0000
commit5254f0a9abab54eed4e2ca7a23ceca3b3bb65fd0 (patch)
tree7ebe769613f4421ff195231e830451f4468562c2 /clang/lib/CodeGen/CGOpenMPRuntime.cpp
parentf79d3bc72423176a38568d89f80d1a4577aaf3d0 (diff)
downloadbcm5719-llvm-5254f0a9abab54eed4e2ca7a23ceca3b3bb65fd0.tar.gz
bcm5719-llvm-5254f0a9abab54eed4e2ca7a23ceca3b3bb65fd0.zip
[OpenMP] Avoid emitting maps for target link variables when unified memory is used
Summary: This patch avoids the emission of maps for target link variables when unified memory is present. Reviewers: ABataev, caomhin Reviewed By: ABataev Subscribers: guansong, jdoerfert, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D60883 llvm-svn: 363435
Diffstat (limited to 'clang/lib/CodeGen/CGOpenMPRuntime.cpp')
-rw-r--r--clang/lib/CodeGen/CGOpenMPRuntime.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/clang/lib/CodeGen/CGOpenMPRuntime.cpp b/clang/lib/CodeGen/CGOpenMPRuntime.cpp
index 651cca4993c..09be478a265 100644
--- a/clang/lib/CodeGen/CGOpenMPRuntime.cpp
+++ b/clang/lib/CodeGen/CGOpenMPRuntime.cpp
@@ -8266,7 +8266,8 @@ public:
continue;
llvm::Optional<OMPDeclareTargetDeclAttr::MapTypeTy> Res =
OMPDeclareTargetDeclAttr::isDeclareTargetDeclaration(VD);
- if (!Res || *Res != OMPDeclareTargetDeclAttr::MT_Link)
+ if (CGF.CGM.getOpenMPRuntime().hasRequiresUnifiedSharedMemory() ||
+ !Res || *Res != OMPDeclareTargetDeclAttr::MT_Link)
continue;
StructRangeInfoTy PartialStruct;
generateInfoForComponentList(
@@ -9251,6 +9252,10 @@ bool CGOpenMPRuntime::hasAllocateAttributeForGlobalVar(const VarDecl *VD,
return false;
}
+bool CGOpenMPRuntime::hasRequiresUnifiedSharedMemory() const {
+ return HasRequiresUnifiedSharedMemory;
+}
+
CGOpenMPRuntime::DisableAutoDeclareTargetRAII::DisableAutoDeclareTargetRAII(
CodeGenModule &CGM)
: CGM(CGM) {
OpenPOWER on IntegriCloud