[Openmp-commits] [PATCH] D107926: [OpenMP][NFC] Eliminate CopyMember from targetDataEnd

Joel E. Denny via Phabricator via Openmp-commits openmp-commits at lists.llvm.org
Wed Aug 11 13:02:58 PDT 2021


jdenny created this revision.
jdenny added reviewers: grokos, tianshilei1992, RaviNarayanaswamy, jdoerfert.
jdenny added a project: OpenMP.
Herald added subscribers: guansong, yaxunl.
jdenny requested review of this revision.
Herald added a subscriber: sstefan1.

This patch is based on comments in D105990 <https://reviews.llvm.org/D105990>.  It is NFC according to
the following observations:

1. `CopyMember` is computed as `!IsHostPtr && IsLast`.
2. `DelEntry` is true only if `IsLast` is true.

We apply those observations in order:

  if ((DelEntry || Always || CopyMember) && !IsHostPtr)
  
  if ((DelEntry || Always || IsLast) && !IsHostPtr)
  
  if ((Always || IsLast) && !IsHostPtr)


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D107926

Files:
  openmp/libomptarget/src/omptarget.cpp


Index: openmp/libomptarget/src/omptarget.cpp
===================================================================
--- openmp/libomptarget/src/omptarget.cpp
+++ openmp/libomptarget/src/omptarget.cpp
@@ -731,13 +731,7 @@
       // Move data back to the host
       if (ArgTypes[I] & OMP_TGT_MAPTYPE_FROM) {
         bool Always = ArgTypes[I] & OMP_TGT_MAPTYPE_ALWAYS;
-        bool CopyMember = false;
-        if (!IsHostPtr) {
-          if (IsLast)
-            CopyMember = true;
-        }
-
-        if ((DelEntry || Always || CopyMember) && !IsHostPtr) {
+        if ((Always || IsLast) && !IsHostPtr) {
           DP("Moving %" PRId64 " bytes (tgt:" DPxMOD ") -> (hst:" DPxMOD ")\n",
              DataSize, DPxPTR(TgtPtrBegin), DPxPTR(HstPtrBegin));
           Ret = Device.retrieveData(HstPtrBegin, TgtPtrBegin, DataSize,


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D107926.365829.patch
Type: text/x-patch
Size: 829 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/openmp-commits/attachments/20210811/94f305e8/attachment.bin>


More information about the Openmp-commits mailing list