Skip to content

Commit 1275683

Browse files
[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.
1 parent 1a1a5ec commit 1275683

File tree

5 files changed

+30
-62
lines changed

5 files changed

+30
-62
lines changed

flang/lib/Lower/OpenMP.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3092,8 +3092,6 @@ genOMP(Fortran::lower::AbstractConverter &converter,
30923092
!std::get_if<Fortran::parser::OmpClause::Allocate>(&clause.u) &&
30933093
!std::get_if<Fortran::parser::OmpClause::Default>(&clause.u) &&
30943094
!std::get_if<Fortran::parser::OmpClause::Final>(&clause.u) &&
3095-
!std::get_if<Fortran::parser::OmpClause::Untied>(&clause.u) &&
3096-
!std::get_if<Fortran::parser::OmpClause::Mergeable>(&clause.u) &&
30973095
!std::get_if<Fortran::parser::OmpClause::Priority>(&clause.u) &&
30983096
!std::get_if<Fortran::parser::OmpClause::Reduction>(&clause.u) &&
30993097
!std::get_if<Fortran::parser::OmpClause::Depend>(&clause.u) &&

flang/test/Lower/OpenMP/FIR/task.f90

Lines changed: 2 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -40,34 +40,6 @@ subroutine omp_task_final(bar)
4040
!$omp end task
4141
end subroutine omp_task_final
4242

43-
!===============================================================================
44-
! `untied` clause
45-
!===============================================================================
46-
47-
!CHECK-LABEL: func @_QPomp_task_untied() {
48-
subroutine omp_task_untied()
49-
!CHECK: omp.task untied {
50-
!$omp task untied
51-
!CHECK: fir.call @_QPfoo() {{.*}}: () -> ()
52-
call foo()
53-
!CHECK: omp.terminator
54-
!$omp end task
55-
end subroutine omp_task_untied
56-
57-
!===============================================================================
58-
! `mergeable` clause
59-
!===============================================================================
60-
61-
!CHECK-LABEL: func @_QPomp_task_mergeable() {
62-
subroutine omp_task_mergeable()
63-
!CHECK: omp.task mergeable {
64-
!$omp task mergeable
65-
!CHECK: fir.call @_QPfoo() {{.*}}: () -> ()
66-
call foo()
67-
!CHECK: omp.terminator
68-
!$omp end task
69-
end subroutine omp_task_mergeable
70-
7143
!===============================================================================
7244
! `priority` clause
7345
!===============================================================================
@@ -245,8 +217,8 @@ subroutine task_multiple_clauses()
245217
integer :: x, y, z
246218
logical :: buzz
247219

248-
!CHECK: omp.task if(%{{.+}}) final(%{{.+}}) untied mergeable priority(%{{.+}}) allocate(%{{.+}} : i32 -> %{{.+}} : !fir.ref<i32>) {
249-
!$omp task if(buzz) final(buzz) untied mergeable priority(z) allocate(omp_high_bw_mem_alloc: x) private(x) firstprivate(y)
220+
!CHECK: omp.task if(%{{.+}}) final(%{{.+}}) priority(%{{.+}}) allocate(%{{.+}} : i32 -> %{{.+}} : !fir.ref<i32>) {
221+
!$omp task if(buzz) final(buzz) priority(z) allocate(omp_high_bw_mem_alloc: x) private(x) firstprivate(y)
250222

251223
!CHECK: %[[x_priv:.+]] = fir.alloca i32
252224
!CHECK: %[[y_priv:.+]] = fir.alloca i32
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
! RUN: %not_todo_cmd bbc -emit-fir -fopenmp -o - %s 2>&1 | FileCheck %s
2+
! RUN: %not_todo_cmd %flang_fc1 -emit-fir -fopenmp -o - %s 2>&1 | FileCheck %s
3+
4+
!===============================================================================
5+
! `mergeable` clause
6+
!===============================================================================
7+
8+
! CHECK: not yet implemented: OpenMP Block construct clause
9+
subroutine omp_task_mergeable()
10+
!$omp task mergeable
11+
call foo()
12+
!$omp end task
13+
end subroutine omp_task_mergeable
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
! RUN: %not_todo_cmd bbc -emit-fir -fopenmp -o - %s 2>&1 | FileCheck %s
2+
! RUN: %not_todo_cmd %flang_fc1 -emit-fir -fopenmp -o - %s 2>&1 | FileCheck %s
3+
4+
!===============================================================================
5+
! `untied` clause
6+
!===============================================================================
7+
8+
! CHECK: not yet implemented: OpenMP Block construct clause
9+
subroutine omp_task_untied()
10+
!$omp task untied
11+
call foo()
12+
!$omp end task
13+
end subroutine omp_task_untied

flang/test/Lower/OpenMP/task.f90

Lines changed: 2 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -40,34 +40,6 @@ subroutine omp_task_final(bar)
4040
!$omp end task
4141
end subroutine omp_task_final
4242

43-
!===============================================================================
44-
! `untied` clause
45-
!===============================================================================
46-
47-
!CHECK-LABEL: func @_QPomp_task_untied() {
48-
subroutine omp_task_untied()
49-
!CHECK: omp.task untied {
50-
!$omp task untied
51-
!CHECK: fir.call @_QPfoo() {{.*}}: () -> ()
52-
call foo()
53-
!CHECK: omp.terminator
54-
!$omp end task
55-
end subroutine omp_task_untied
56-
57-
!===============================================================================
58-
! `mergeable` clause
59-
!===============================================================================
60-
61-
!CHECK-LABEL: func @_QPomp_task_mergeable() {
62-
subroutine omp_task_mergeable()
63-
!CHECK: omp.task mergeable {
64-
!$omp task mergeable
65-
!CHECK: fir.call @_QPfoo() {{.*}}: () -> ()
66-
call foo()
67-
!CHECK: omp.terminator
68-
!$omp end task
69-
end subroutine omp_task_mergeable
70-
7143
!===============================================================================
7244
! `priority` clause
7345
!===============================================================================
@@ -253,8 +225,8 @@ subroutine task_multiple_clauses()
253225
integer :: x, y, z
254226
logical :: buzz
255227

256-
!CHECK: omp.task if(%{{.+}}) final(%{{.+}}) untied mergeable priority(%{{.+}}) allocate(%{{.+}} : i32 -> %{{.+}} : !fir.ref<i32>) {
257-
!$omp task if(buzz) final(buzz) untied mergeable priority(z) allocate(omp_high_bw_mem_alloc: x) private(x) firstprivate(y)
228+
!CHECK: omp.task if(%{{.+}}) final(%{{.+}}) priority(%{{.+}}) allocate(%{{.+}} : i32 -> %{{.+}} : !fir.ref<i32>) {
229+
!$omp task if(buzz) final(buzz) priority(z) allocate(omp_high_bw_mem_alloc: x) private(x) firstprivate(y)
258230

259231
!CHECK: %[[X_PRIV_ALLOCA:.+]] = fir.alloca i32 {bindc_name = "x", pinned, uniq_name = "_QFtask_multiple_clausesEx"}
260232
!CHECK: %[[X_PRIV:.+]]:2 = hlfir.declare %[[X_PRIV_ALLOCA]] {uniq_name = "_QFtask_multiple_clausesEx"} : (!fir.ref<i32>) -> (!fir.ref<i32>, !fir.ref<i32>)

0 commit comments

Comments
 (0)