[llvm-branch-commits] [flang] [mlir] [mlir][flang][OpenMP] Select depend and affinity iterators per locator (PR #227454)

via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Mon Oct 5 21:08:48 PDT 2026


================
@@ -0,0 +1,149 @@
+! RUN: bbc -emit-hlfir -fopenmp -fopenmp-version=52 -o - %s \
+! RUN:   | FileCheck %s
+! RUN: %flang_fc1 -emit-hlfir -fopenmp -fopenmp-version=52 -o - %s \
+! RUN:   | FileCheck %s
+
+! Range selection follows resolved source occurrences, even when 0*i folds.
+! The enclosing i is distinct from the iterator i in the first clause.
+
+subroutine depend_folded(a, m, d, i)
+  integer :: a(2), m, d, i
+  !$omp task depend(iterator(i = 1:m, j = 1:2), &
+  !$omp& in: a(j/d + 0*i), a(1 + 0*i), a(j), a(1))
+  !$omp end task
+end subroutine
+
+! CHECK-LABEL: func.func @_QPdepend_folded(
+! CHECK: omp.iterator(%{{.*}}: index, %{{.*}}: index) =
+! CHECK: arith.divsi
+! CHECK: omp.yield
+! CHECK: omp.iterator(%{{[^,:]+}}: index) =
----------------
MattPD wrote:

The assertions now catch the source permutation for both dependence and affinity.

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


More information about the llvm-branch-commits mailing list