[flang-commits] [flang] [llvm] [mlir] [Flang][OpenMP] Fix Fortran automap handling (PR #162501)

Akash Banerjee via flang-commits flang-commits at lists.llvm.org
Thu Jun 18 07:49:06 PDT 2026


================
@@ -932,6 +932,34 @@ class MapInfoFinalizationPass
     return false;
   }
 
+  static bool isAttachMap(mlir::omp::MapInfoOp op) {
+    return (op.getMapType() & mlir::omp::ClauseMapFlags::attach) ==
+           mlir::omp::ClauseMapFlags::attach;
+  }
+
+  static bool isDescriptorOnlyMap(mlir::omp::MapInfoOp op) {
+    // A descriptor-only map keeps the descriptor object present so that a
+    // subsequent attach map can update its base address. It intentionally does
+    // not map the descriptor's pointee data, so descriptor member expansion
+    // must leave it alone.
+    if (!op.getPartialMap() || !op.getMembers().empty() ||
+        !op.getBounds().empty() || op.getVarPtrPtr() ||
+        op.getMapCaptureType() != mlir::omp::VariableCaptureKind::ByRef)
----------------
TIFitis wrote:

Thanks, this change is no longer needed thanks to your PR.

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


More information about the flang-commits mailing list