[Openmp-commits] [PATCH] D104580: [NFC][OpenMP][Offloading] Unified the construction of mapping table entry

Shilei Tian via Phabricator via Openmp-commits openmp-commits at lists.llvm.org
Tue Jun 22 09:39:00 PDT 2021


This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rG002905907432: [NFC][OpenMP][Offloading] Unified the construction of mapping table entry (authored by tianshilei1992).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D104580/new/

https://reviews.llvm.org/D104580

Files:
  openmp/libomptarget/src/device.cpp


Index: openmp/libomptarget/src/device.cpp
===================================================================
--- openmp/libomptarget/src/device.cpp
+++ openmp/libomptarget/src/device.cpp
@@ -76,17 +76,16 @@
   }
 
   // Mapping does not exist, allocate it with refCount=INF
-  HostDataToTargetTy newEntry((uintptr_t)HstPtrBegin /*HstPtrBase*/,
-                              (uintptr_t)HstPtrBegin /*HstPtrBegin*/,
-                              (uintptr_t)HstPtrBegin + Size /*HstPtrEnd*/,
-                              (uintptr_t)TgtPtrBegin /*TgtPtrBegin*/, nullptr,
-                              true /*IsRefCountINF*/);
-
+  auto Res = HostDataToTargetMap.emplace(
+      (uintptr_t)HstPtrBegin /*HstPtrBase*/,
+      (uintptr_t)HstPtrBegin /*HstPtrBegin*/,
+      (uintptr_t)HstPtrBegin + Size /*HstPtrEnd*/,
+      (uintptr_t)TgtPtrBegin /*TgtPtrBegin*/, nullptr, true /*IsRefCountINF*/);
+  auto NewEntry = Res.first;
   DP("Creating new map entry: HstBase=" DPxMOD ", HstBegin=" DPxMOD
      ", HstEnd=" DPxMOD ", TgtBegin=" DPxMOD "\n",
-     DPxPTR(newEntry.HstPtrBase), DPxPTR(newEntry.HstPtrBegin),
-     DPxPTR(newEntry.HstPtrEnd), DPxPTR(newEntry.TgtPtrBegin));
-  HostDataToTargetMap.insert(newEntry);
+     DPxPTR(NewEntry->HstPtrBase), DPxPTR(NewEntry->HstPtrBegin),
+     DPxPTR(NewEntry->HstPtrEnd), DPxPTR(NewEntry->TgtPtrBegin));
 
   DataMapMtx.unlock();
 
@@ -269,9 +268,8 @@
          "HstPtrBegin=" DPxMOD ", TgtPtrBegin=" DPxMOD ", Size=%ld, Name=%s\n",
          DPxPTR(HstPtrBegin), DPxPTR(tp), Size,
          (HstPtrName) ? getNameFromMapping(HstPtrName).c_str() : "unknown");
-    HostDataToTargetMap.emplace(
-        HostDataToTargetTy((uintptr_t)HstPtrBase, (uintptr_t)HstPtrBegin,
-                           (uintptr_t)HstPtrBegin + Size, tp, HstPtrName));
+    HostDataToTargetMap.emplace((uintptr_t)HstPtrBase, (uintptr_t)HstPtrBegin,
+                                (uintptr_t)HstPtrBegin + Size, tp, HstPtrName);
     rc = (void *)tp;
   }
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D104580.353680.patch
Type: text/x-patch
Size: 1987 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/openmp-commits/attachments/20210622/1f2f4c31/attachment.bin>


More information about the Openmp-commits mailing list