[Openmp-commits] [openmp] [clang] [Clang][OpenMP] Fix ordering of processing of map clauses when mapping a struct. (PR #72410)

Alexey Bataev via Openmp-commits openmp-commits at lists.llvm.org
Wed Nov 22 07:10:32 PST 2023


================
@@ -7731,10 +7731,30 @@ class MappableExprsHandler {
               IsImplicit, Mapper, VarRef, ForDeviceAddr);
         };
 
+    // Sort all map clauses and make sure all the maps containing array
+    // sections are processed last.
+    llvm::SmallVector<const OMPMapClause *, 16> SortedMapClauses;
----------------
alexey-bataev wrote:

So, looks like we emit something like this as maptypes:
<placeholder for the whole struct> 0x0
0x1000000000011 - MEMBER_OF_1 | MAP_PTR_AND_OBJ | MAP_TO - array section
0x1000000000001 - MEMBER_OF_1 | MAP_TO - whole struct

I think the whole struct info can be copied to the very first element instead of the placeholder, if we see that the whole struct is mapped, and the corresponding element can be removed out of the list. I think this can be done in emitCombinedEntry function

https://github.com/llvm/llvm-project/pull/72410


More information about the Openmp-commits mailing list