[PATCH] D60883: [OpenMP] Avoid emitting maps for target link variables when unified memory is used

Gheorghe-Teodor Bercea via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Apr 18 12:02:39 PDT 2019

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.

  rC Clang



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>()) {

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D60883.195798.patch
Type: text/x-patch
Size: 762 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20190418/4fbda6b1/attachment.bin>

More information about the cfe-commits mailing list