gtbercea created this revision.
gtbercea added reviewers: ABataev, caomhin.
Herald added subscribers: cfe-commits, jdoerfert, guansong.
Herald added a project: clang.

This patch avoids the emission of maps for target link variables when unified 
memory is present.


Repository:
  rC Clang

https://reviews.llvm.org/D60883

Files:
  lib/CodeGen/CGOpenMPRuntime.cpp


Index: lib/CodeGen/CGOpenMPRuntime.cpp
===================================================================
--- lib/CodeGen/CGOpenMPRuntime.cpp
+++ lib/CodeGen/CGOpenMPRuntime.cpp
@@ -7952,6 +7952,10 @@
                                         MapValuesArrayTy &Pointers,
                                         MapValuesArrayTy &Sizes,
                                         MapFlagsArrayTy &Types) const {
+    // If using unified memory, no need to do the mappings.
+    if (CGF.CGM.getOpenMPRuntime().hasUnifiedAddressingSupport())
+      return;
+
     // Map other list items in the map clause which are not captured variables
     // but "declare target link" global variables.
     for (const auto *C : this->CurDir.getClausesOfKind<OMPMapClause>()) {


Index: lib/CodeGen/CGOpenMPRuntime.cpp
===================================================================
--- lib/CodeGen/CGOpenMPRuntime.cpp
+++ lib/CodeGen/CGOpenMPRuntime.cpp
@@ -7952,6 +7952,10 @@
                                         MapValuesArrayTy &Pointers,
                                         MapValuesArrayTy &Sizes,
                                         MapFlagsArrayTy &Types) const {
+    // If using unified memory, no need to do the mappings.
+    if (CGF.CGM.getOpenMPRuntime().hasUnifiedAddressingSupport())
+      return;
+
     // Map other list items in the map clause which are not captured variables
     // but "declare target link" global variables.
     for (const auto *C : this->CurDir.getClausesOfKind<OMPMapClause>()) {
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
  • [PATCH] D60883: [Op... Gheorghe-Teodor Bercea via Phabricator via cfe-commits

Reply via email to