[llvm-branch-commits] [flang] [llvm] [mlir] [Flang][OpenMP][MLIR] Initial declare target to for variables implementation (PR #119589)

via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Mon Oct 6 13:45:20 PDT 2025


================
@@ -275,9 +275,21 @@ class MapInfoFinalizationPass
       return mapTypeFlag;
 
     mapFlags flags = mapFlags::OMP_MAP_TO |
-                     (mapFlags(mapTypeFlag) &
-                      (mapFlags::OMP_MAP_IMPLICIT | mapFlags::OMP_MAP_CLOSE |
-                       mapFlags::OMP_MAP_ALWAYS));
+                     (mapFlags(mapTypeFlag) & mapFlags::OMP_MAP_IMPLICIT);
+
+    // Descriptors for objects will always be copied. This is because the
+    // descriptor can be rematerialized by the compiler, and so the address
+    // of the descriptor for a given object at one place in the code may
+    // differ from that address in another place. The contents of the
+    // descriptor (the base address in particular) will remain unchanged
+    // though.
+    // TODO/FIXME: We currently cannot have MAP_CLOSE and MAP_ALWAYS on
----------------
agozillon wrote:

It's more of a runtime or descriptor mapping specific thing, I imagine it is legal to have a map always with a close, it's just not playing friendly in certain cases with the current mapping we do for descriptors, so need to figure out an appropriate fix for it. 

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


More information about the llvm-branch-commits mailing list