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

via flang-commits flang-commits at lists.llvm.org
Fri Oct 23 00:14:57 PDT 2026


================
@@ -295,6 +295,9 @@ static mlir::Value buildIteratorOp(Fortran::lower::AbstractConverter &converter,
   auto itOp = mlir::omp::IteratorOp::create(
       builder, loc, iterTy, mlir::ValueRange{lbs}, mlir::ValueRange{ubs},
       mlir::ValueRange{steps});
+  // Fortran iterator-specifier ranges (OpenMP 5.2 3.2.6) include the upper
+  // bound, unlike the op's default (exclusive) loop semantics.
+  itOp->setAttr("loop_inclusive", builder.getUnitAttr());
----------------
MattPD wrote:

This `setAttr` call marks each iterator built by `buildIteratorOp` as `inclusive`, including the `depend` and `affinity` iterators. The updates to `depend-iterator.f90` and `task-affinity.f90` come from this call.

Could the PR description mention this change to the `depend` and `affinity` iterators?

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


More information about the flang-commits mailing list