[flang-commits] [flang] [flang][OpenMP] Map `teams loop` to `teams distribute` when required. (PR #127489)

Sergio Afonso via flang-commits flang-commits at lists.llvm.org
Thu Feb 20 03:54:27 PST 2025


================
@@ -179,3 +180,86 @@ subroutine test_standalone_bind_parallel
     c(i) = a(i) * b(i)
   end do
 end subroutine
+
+! CHECK-LABEL: func.func @_QPteams_loop_cannot_be_parallel_for
+subroutine teams_loop_cannot_be_parallel_for
+  implicit none
+  integer :: iter, iter2, val(20)
+  val = 0
+  ! CHECK: omp.teams {
+
+  ! Verify the outer `loop` directive was mapped to only `distribute`.
+  ! CHECK-NOT: omp.parallel {{.*}}
+  ! CHECK:     omp.distribute {{.*}} {
+  ! CHECK-NOT:   omp.wsloop
+  ! CHECK:       omp.loop_nest {{.*}} {
----------------
skatrak wrote:

Nit: Since they are wrappers, you can simplify this with a `CHECK-NEXT: omp.loop_nest`.

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


More information about the flang-commits mailing list