From 12756831e4a96aed78e8724bb982e47444ff2ffc Mon Sep 17 00:00:00 2001 From: Kiran Chandramohan Date: Mon, 6 Nov 2023 15:01:57 +0000 Subject: [PATCH] [Flang][OpenMP] Mark mergeable and untied clauses as unsupported (#71209) These two clauses are not supported in the OpenMP Dialect to LLVM conversion. Mark as TODO till support is added. --- flang/lib/Lower/OpenMP.cpp | 2 -- flang/test/Lower/OpenMP/FIR/task.f90 | 32 ++----------------- .../test/Lower/OpenMP/Todo/task_mergeable.f90 | 13 ++++++++ flang/test/Lower/OpenMP/Todo/task_untied.f90 | 13 ++++++++ flang/test/Lower/OpenMP/task.f90 | 32 ++----------------- 5 files changed, 30 insertions(+), 62 deletions(-) create mode 100644 flang/test/Lower/OpenMP/Todo/task_mergeable.f90 create mode 100644 flang/test/Lower/OpenMP/Todo/task_untied.f90 diff --git a/flang/lib/Lower/OpenMP.cpp b/flang/lib/Lower/OpenMP.cpp index 390bafb49e51..087f535ff064 100644 --- a/flang/lib/Lower/OpenMP.cpp +++ b/flang/lib/Lower/OpenMP.cpp @@ -3092,8 +3092,6 @@ genOMP(Fortran::lower::AbstractConverter &converter, !std::get_if(&clause.u) && !std::get_if(&clause.u) && !std::get_if(&clause.u) && - !std::get_if(&clause.u) && - !std::get_if(&clause.u) && !std::get_if(&clause.u) && !std::get_if(&clause.u) && !std::get_if(&clause.u) && diff --git a/flang/test/Lower/OpenMP/FIR/task.f90 b/flang/test/Lower/OpenMP/FIR/task.f90 index d7419bd1100e..99a9e3a6b1e3 100644 --- a/flang/test/Lower/OpenMP/FIR/task.f90 +++ b/flang/test/Lower/OpenMP/FIR/task.f90 @@ -40,34 +40,6 @@ subroutine omp_task_final(bar) !$omp end task end subroutine omp_task_final -!=============================================================================== -! `untied` clause -!=============================================================================== - -!CHECK-LABEL: func @_QPomp_task_untied() { -subroutine omp_task_untied() - !CHECK: omp.task untied { - !$omp task untied - !CHECK: fir.call @_QPfoo() {{.*}}: () -> () - call foo() - !CHECK: omp.terminator - !$omp end task -end subroutine omp_task_untied - -!=============================================================================== -! `mergeable` clause -!=============================================================================== - -!CHECK-LABEL: func @_QPomp_task_mergeable() { -subroutine omp_task_mergeable() - !CHECK: omp.task mergeable { - !$omp task mergeable - !CHECK: fir.call @_QPfoo() {{.*}}: () -> () - call foo() - !CHECK: omp.terminator - !$omp end task -end subroutine omp_task_mergeable - !=============================================================================== ! `priority` clause !=============================================================================== @@ -245,8 +217,8 @@ subroutine task_multiple_clauses() integer :: x, y, z logical :: buzz - !CHECK: omp.task if(%{{.+}}) final(%{{.+}}) untied mergeable priority(%{{.+}}) allocate(%{{.+}} : i32 -> %{{.+}} : !fir.ref) { - !$omp task if(buzz) final(buzz) untied mergeable priority(z) allocate(omp_high_bw_mem_alloc: x) private(x) firstprivate(y) + !CHECK: omp.task if(%{{.+}}) final(%{{.+}}) priority(%{{.+}}) allocate(%{{.+}} : i32 -> %{{.+}} : !fir.ref) { + !$omp task if(buzz) final(buzz) priority(z) allocate(omp_high_bw_mem_alloc: x) private(x) firstprivate(y) !CHECK: %[[x_priv:.+]] = fir.alloca i32 !CHECK: %[[y_priv:.+]] = fir.alloca i32 diff --git a/flang/test/Lower/OpenMP/Todo/task_mergeable.f90 b/flang/test/Lower/OpenMP/Todo/task_mergeable.f90 new file mode 100644 index 000000000000..13145d92ccf9 --- /dev/null +++ b/flang/test/Lower/OpenMP/Todo/task_mergeable.f90 @@ -0,0 +1,13 @@ +! RUN: %not_todo_cmd bbc -emit-fir -fopenmp -o - %s 2>&1 | FileCheck %s +! RUN: %not_todo_cmd %flang_fc1 -emit-fir -fopenmp -o - %s 2>&1 | FileCheck %s + +!=============================================================================== +! `mergeable` clause +!=============================================================================== + +! CHECK: not yet implemented: OpenMP Block construct clause +subroutine omp_task_mergeable() + !$omp task mergeable + call foo() + !$omp end task +end subroutine omp_task_mergeable diff --git a/flang/test/Lower/OpenMP/Todo/task_untied.f90 b/flang/test/Lower/OpenMP/Todo/task_untied.f90 new file mode 100644 index 000000000000..19621c7aac16 --- /dev/null +++ b/flang/test/Lower/OpenMP/Todo/task_untied.f90 @@ -0,0 +1,13 @@ +! RUN: %not_todo_cmd bbc -emit-fir -fopenmp -o - %s 2>&1 | FileCheck %s +! RUN: %not_todo_cmd %flang_fc1 -emit-fir -fopenmp -o - %s 2>&1 | FileCheck %s + +!=============================================================================== +! `untied` clause +!=============================================================================== + +! CHECK: not yet implemented: OpenMP Block construct clause +subroutine omp_task_untied() + !$omp task untied + call foo() + !$omp end task +end subroutine omp_task_untied diff --git a/flang/test/Lower/OpenMP/task.f90 b/flang/test/Lower/OpenMP/task.f90 index 99b1740ca75a..7d7a79af3185 100644 --- a/flang/test/Lower/OpenMP/task.f90 +++ b/flang/test/Lower/OpenMP/task.f90 @@ -40,34 +40,6 @@ subroutine omp_task_final(bar) !$omp end task end subroutine omp_task_final -!=============================================================================== -! `untied` clause -!=============================================================================== - -!CHECK-LABEL: func @_QPomp_task_untied() { -subroutine omp_task_untied() - !CHECK: omp.task untied { - !$omp task untied - !CHECK: fir.call @_QPfoo() {{.*}}: () -> () - call foo() - !CHECK: omp.terminator - !$omp end task -end subroutine omp_task_untied - -!=============================================================================== -! `mergeable` clause -!=============================================================================== - -!CHECK-LABEL: func @_QPomp_task_mergeable() { -subroutine omp_task_mergeable() - !CHECK: omp.task mergeable { - !$omp task mergeable - !CHECK: fir.call @_QPfoo() {{.*}}: () -> () - call foo() - !CHECK: omp.terminator - !$omp end task -end subroutine omp_task_mergeable - !=============================================================================== ! `priority` clause !=============================================================================== @@ -253,8 +225,8 @@ subroutine task_multiple_clauses() integer :: x, y, z logical :: buzz - !CHECK: omp.task if(%{{.+}}) final(%{{.+}}) untied mergeable priority(%{{.+}}) allocate(%{{.+}} : i32 -> %{{.+}} : !fir.ref) { - !$omp task if(buzz) final(buzz) untied mergeable priority(z) allocate(omp_high_bw_mem_alloc: x) private(x) firstprivate(y) + !CHECK: omp.task if(%{{.+}}) final(%{{.+}}) priority(%{{.+}}) allocate(%{{.+}} : i32 -> %{{.+}} : !fir.ref) { + !$omp task if(buzz) final(buzz) priority(z) allocate(omp_high_bw_mem_alloc: x) private(x) firstprivate(y) !CHECK: %[[X_PRIV_ALLOCA:.+]] = fir.alloca i32 {bindc_name = "x", pinned, uniq_name = "_QFtask_multiple_clausesEx"} !CHECK: %[[X_PRIV:.+]]:2 = hlfir.declare %[[X_PRIV_ALLOCA]] {uniq_name = "_QFtask_multiple_clausesEx"} : (!fir.ref) -> (!fir.ref, !fir.ref)