[Openmp-commits] [openmp] 2ced1f3 - [OpenMP][NFC] Simplify targetDataEnd conditions for CopyMember

Joel E. Denny via Openmp-commits openmp-commits at lists.llvm.org
Tue Aug 10 09:36:13 PDT 2021


Author: Joel E. Denny
Date: 2021-08-10T12:29:55-04:00
New Revision: 2ced1f338ae05260b01d9293e9dba27b90a2bfed

URL: https://github.com/llvm/llvm-project/commit/2ced1f338ae05260b01d9293e9dba27b90a2bfed
DIFF: https://github.com/llvm/llvm-project/commit/2ced1f338ae05260b01d9293e9dba27b90a2bfed.diff

LOG: [OpenMP][NFC] Simplify targetDataEnd conditions for CopyMember

targetDataEnd and targetDataBegin compute CopyMember/copy differently,
and I don't see why they should.  This patch eliminates one of those
differences by making a simplifying NFC change to targetDataEnd.

The change is NFC as follows.  The change only affects the case when
`!UNIFIED_SHARED_MEMORY || HasCloseModifier`.  In that case, the
following points are always true:

* The value of CopyMember is relevant later only if DelEntry = false.
* DelEntry = false only if one of the following is true:
    * IsLast = false.  In this case, it's always true that CopyMember
      = false = IsLast.
    * `MEMBER_OF && !PTR_AND_OBJ` is true.  In this case, CopyMember =
      IsLast.
* Thus, if CopyMember is relevant, CopyMember = IsLast.

Reviewed By: grokos

Differential Revision: https://reviews.llvm.org/D105990

Added: 
    

Modified: 
    openmp/libomptarget/src/omptarget.cpp

Removed: 
    


################################################################################
diff  --git a/openmp/libomptarget/src/omptarget.cpp b/openmp/libomptarget/src/omptarget.cpp
index 9cfd5cda19157..87ea1c49fe957 100644
--- a/openmp/libomptarget/src/omptarget.cpp
+++ b/openmp/libomptarget/src/omptarget.cpp
@@ -738,9 +738,8 @@ int targetDataEnd(ident_t *loc, DeviceTy &Device, int32_t ArgNum,
         bool CopyMember = false;
         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))
-            CopyMember = IsLast;
+          if (IsLast)
+            CopyMember = true;
         }
 
         if ((DelEntry || Always || CopyMember) &&


        


More information about the Openmp-commits mailing list