[flang-commits] [flang] [llvm] [mlir] [flang][mlir][OpenMP] Support iterator modifier in declare mapper map clause (PR #215485)

Urvi Rav via flang-commits flang-commits at lists.llvm.org
Fri Sep 25 03:58:53 PDT 2026


================
@@ -2046,13 +2046,125 @@ bool ClauseProcessor::processMap(
       }
     }
 
-    if (iterator)
-      TODO(currentLocation,
-           "Support for iterator modifiers is not implemented yet");
     TodoLocators(currentLocation, objects);
 
-    processMapObjects(stmtCtx, clauseLocation,
-                      std::get<omp::ObjectList>(clause.t), mapTypeBits,
+    llvm::SmallVector<IteratorRange> iteratorRanges;
+    llvm::SmallPtrSet<const Fortran::semantics::Symbol *, 4> ivSyms;
+    collectIteratorIVs(clause, converter, stmtCtx, iteratorRanges, ivSyms);
+
+    // Objects that reference an iterator induction variable are expanded at
+    // runtime via `omp.iterator`/`map_iterated`; the rest go through the
+    // regular static map-info path below.
+    omp::ObjectList staticObjects;
+    if (!iterator) {
+      staticObjects = objects;
----------------
ravurvi20 wrote:

Done. The non-iterator case now calls `processMapObjects` directly on objects and returns early from the clause callback, so there's no more copying into `staticObjects` for the common case, and the iterator-handling code no longer sits inside the `else`.

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


More information about the flang-commits mailing list