[Openmp-commits] [PATCH] D104924: [OpenMP] Avoid checking parent reference count in targetDataEnd

Joel E. Denny via Phabricator via Openmp-commits openmp-commits at lists.llvm.org
Sat Jul 10 09:27:50 PDT 2021


This revision was automatically updated to reflect the committed changes.
Closed by commit rG1d0456361a42: [OpenMP] Avoid checking parent reference count in targetDataEnd (authored by jdenny).

Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D104924

Files:
  openmp/libomptarget/src/omptarget.cpp


Index: openmp/libomptarget/src/omptarget.cpp
===================================================================
--- openmp/libomptarget/src/omptarget.cpp
+++ openmp/libomptarget/src/omptarget.cpp
@@ -731,14 +731,8 @@
         if (!(PM->RTLs.RequiresFlags & OMP_REQ_UNIFIED_SHARED_MEMORY) ||
             HasCloseModifier) {
           if ((ArgTypes[I] & OMP_TGT_MAPTYPE_MEMBER_OF) &&
-              !(ArgTypes[I] & OMP_TGT_MAPTYPE_PTR_AND_OBJ)) {
-            // Copy data only if the "parent" struct has RefCount==1.
-            int32_t ParentIdx = getParentIndex(ArgTypes[I]);
-            uint64_t ParentRC = Device.getMapEntryRefCnt(Args[ParentIdx]);
-            assert(ParentRC > 0 && "parent struct not found");
-            if (ParentRC == 1)
-              CopyMember = true;
-          }
+              !(ArgTypes[I] & OMP_TGT_MAPTYPE_PTR_AND_OBJ))
+            CopyMember = IsLast;
         }
 
         if ((DelEntry || Always || CopyMember) &&


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D104924.357725.patch
Type: text/x-patch
Size: 959 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/openmp-commits/attachments/20210710/eee5756a/attachment.bin>


More information about the Openmp-commits mailing list