Skip to content

Commit f3747e5

Browse files
authored
Merge pull request #55 from TIFitis/skatrak/composite
Akash- Fix tests related to omp.wsloop.
2 parents 1e47d70 + 0319ceb commit f3747e5

File tree

73 files changed

+592
-306
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

73 files changed

+592
-306
lines changed

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

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,8 @@ subroutine copyin_derived_type()
145145
! CHECK: %[[VAL_6:.*]] = arith.constant 1 : i32
146146
! CHECK: %[[VAL_7:.*]] = fir.load %[[VAL_4]] : !fir.ref<i32>
147147
! CHECK: %[[VAL_8:.*]] = arith.constant 1 : i32
148-
! CHECK: omp.wsloop for (%[[VAL_9:.*]]) : i32 = (%[[VAL_6]]) to (%[[VAL_7]]) inclusive step (%[[VAL_8]]) {
148+
! CHECK: omp.wsloop {
149+
! CHECK: omp.loopnest (%[[VAL_9:.*]]) : i32 = (%[[VAL_6]]) to (%[[VAL_7]]) inclusive step (%[[VAL_8]]) {
149150
! CHECK: fir.store %[[VAL_9]] to %[[VAL_3]] : !fir.ref<i32>
150151
! CHECK: fir.call @_QPsub4(%[[VAL_4]]) {{.*}}: (!fir.ref<i32>) -> ()
151152
! CHECK: omp.yield
@@ -286,7 +287,8 @@ subroutine common_1()
286287
!CHECK: %[[val_c1_i32:.*]] = arith.constant 1 : i32
287288
!CHECK: %[[val_19:.*]] = fir.load %[[val_13]] : !fir.ref<i32>
288289
!CHECK: %[[val_c1_i32_2:.*]] = arith.constant 1 : i32
289-
!CHECK: omp.wsloop for (%[[arg:.*]]) : i32 = (%[[val_c1_i32]]) to (%[[val_19]]) inclusive step (%[[val_c1_i32_2]]) {
290+
!CHECK: omp.wsloop {
291+
!CHECK: omp.loopnest (%[[arg:.*]]) : i32 = (%[[val_c1_i32]]) to (%[[val_19]]) inclusive step (%[[val_c1_i32_2]]) {
290292
!CHECK: fir.store %[[arg]] to %[[val_9]] : !fir.ref<i32>
291293
!CHECK: %[[val_20:.*]] = fir.load %[[val_16]] : !fir.ref<i32>
292294
!CHECK: %[[val_21:.*]] = fir.load %[[val_9]] : !fir.ref<i32>
@@ -303,7 +305,7 @@ subroutine common_2()
303305
integer :: y
304306
common /d/ x, y
305307
!$omp threadprivate(/d/)
306-
308+
307309
!$omp parallel do copyin(/d/)
308310
do i = 1, x
309311
y = y + i

flang/test/Lower/OpenMP/FIR/lastprivate-commonblock.f90

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
! RUN: %flang_fc1 -emit-fir -flang-deprecated-no-hlfir -fopenmp -o - %s 2>&1 | FileCheck %s
1+
! RUN: %flang_fc1 -emit-fir -flang-deprecated-no-hlfir -fopenmp -o - %s 2>&1 | FileCheck %s
22

33
!CHECK: func.func @_QPlastprivate_common() {
44
!CHECK: %[[val_0:.*]] = fir.alloca i32 {adapt.valuebyref, pinned}
@@ -17,7 +17,8 @@
1717
!CHECK: %[[val_c1_i32:.*]] = arith.constant 1 : i32
1818
!CHECK: %[[val_c100_i32:.*]] = arith.constant 100 : i32
1919
!CHECK: %[[val_c1_i32_0:.*]] = arith.constant 1 : i32
20-
!CHECK: omp.wsloop for (%[[arg:.*]]) : i32 = (%[[val_c1_i32]]) to (%[[val_c100_i32]]) inclusive step (%[[val_c1_i32_0]]) {
20+
!CHECK: omp.wsloop {
21+
!CHECK: omp.loopnest (%[[arg:.*]]) : i32 = (%[[val_c1_i32]]) to (%[[val_c100_i32]]) inclusive step (%[[val_c1_i32_0]]) {
2122
!CHECK: fir.store %[[arg]] to %[[val_0]] : !fir.ref<i32>
2223
!CHECK: %[[val_11:.*]] = arith.addi %[[arg]], %[[val_c1_i32_0]] : i32
2324
!CHECK: %[[val_c0_i32:.*]] = arith.constant 0 : i32

flang/test/Lower/OpenMP/FIR/parallel-lastprivate-clause-scalar.f90

Lines changed: 22 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,17 @@
99
!CHECK-DAG: %[[ARG1_REF:.*]] = fir.convert %[[ARG1_UNBOX]]#0 : (!fir.ref<!fir.char<1,?>>) -> !fir.ref<!fir.char<1,5>>
1010

1111
!CHECK: omp.parallel {
12-
!CHECK-DAG: %[[ARG1_PVT:.*]] = fir.alloca !fir.char<1,5> {bindc_name = "arg1",
12+
!CHECK-DAG: %[[ARG1_PVT:.*]] = fir.alloca !fir.char<1,5> {bindc_name = "arg1",
1313

1414
! Check that we are accessing the clone inside the loop
15-
!CHECK-DAG: omp.wsloop for (%[[INDX_WS:.*]]) : {{.*}} {
15+
!CHECK-DAG: omp.wsloop {
16+
!CHECK-DAG: omp.loopnest (%[[INDX_WS:.*]]) : {{.*}} {
1617
!CHECK-DAG: %[[UNIT:.*]] = arith.constant 6 : i32
1718
!CHECK-NEXT: %[[ADDR:.*]] = fir.address_of(@_QQclX
18-
!CHECK-NEXT: %[[CVT0:.*]] = fir.convert %[[ADDR]]
19+
!CHECK-NEXT: %[[CVT0:.*]] = fir.convert %[[ADDR]]
1920
!CHECK-NEXT: %[[CNST:.*]] = arith.constant
2021
!CHECK-NEXT: %[[CALL_BEGIN_IO:.*]] = fir.call @_FortranAioBeginExternalListOutput(%[[UNIT]], %[[CVT0]], %[[CNST]]) {{.*}}: (i32, !fir.ref<i8>, i32) -> !fir.ref<i8>
21-
!CHECK-NEXT: %[[CVT_0_1:.*]] = fir.convert %[[ARG1_PVT]]
22+
!CHECK-NEXT: %[[CVT_0_1:.*]] = fir.convert %[[ARG1_PVT]]
2223
!CHECK-NEXT: %[[CVT_0_2:.*]] = fir.convert %[[FIVE]]
2324
!CHECK-NEXT: %[[CALL_OP_ASCII:.*]] = fir.call @_FortranAioOutputAscii(%[[CALL_BEGIN_IO]], %[[CVT_0_1]], %[[CVT_0_2]])
2425
!CHECK-NEXT: %[[CALL_END_IO:.*]] = fir.call @_FortranAioEndIoStatement(%[[CALL_BEGIN_IO]])
@@ -37,12 +38,12 @@
3738
!CHECK-DAG: %[[CVT:.*]] = fir.convert %[[ARG1_REF]] : (!fir.ref<!fir.char<1,5>>) -> !fir.ref<i8>
3839
!CHECK-DAG: %[[CVT1:.*]] = fir.convert %[[ARG1_PVT]] : (!fir.ref<!fir.char<1,5>>) -> !fir.ref<i8>
3940
!CHECK-DAG: fir.call @llvm.memmove.p0.p0.i64(%[[CVT]], %[[CVT1]]{{.*}})
40-
!CHECK-DAG: }
41+
!CHECK-DAG: }
4142
!CHECK-DAG: omp.yield
4243

4344
subroutine lastprivate_character(arg1)
4445
character(5) :: arg1
45-
!$OMP PARALLEL
46+
!$OMP PARALLEL
4647
!$OMP DO LASTPRIVATE(arg1)
4748
do n = 1, 5
4849
arg1(n:n) = 'c'
@@ -55,7 +56,8 @@ subroutine lastprivate_character(arg1)
5556
!CHECK: func @_QPlastprivate_int(%[[ARG1:.*]]: !fir.ref<i32> {fir.bindc_name = "arg1"}) {
5657
!CHECK-DAG: omp.parallel {
5758
!CHECK-DAG: %[[CLONE:.*]] = fir.alloca i32 {bindc_name = "arg1"
58-
!CHECK: omp.wsloop for (%[[INDX_WS:.*]]) : {{.*}} {
59+
!CHECK: omp.wsloop {
60+
!CHECK: omp.loopnest (%[[INDX_WS:.*]]) : {{.*}} {
5961

6062
! Testing last iteration check
6163
!CHECK: %[[V:.*]] = arith.addi %[[INDX_WS]], %{{.*}} : i32
@@ -75,7 +77,7 @@ subroutine lastprivate_character(arg1)
7577

7678
subroutine lastprivate_int(arg1)
7779
integer :: arg1
78-
!$OMP PARALLEL
80+
!$OMP PARALLEL
7981
!$OMP DO LASTPRIVATE(arg1)
8082
do n = 1, 5
8183
arg1 = 2
@@ -90,7 +92,8 @@ subroutine lastprivate_int(arg1)
9092
!CHECK: omp.parallel {
9193
!CHECK-DAG: %[[CLONE1:.*]] = fir.alloca i32 {bindc_name = "arg1"
9294
!CHECK-DAG: %[[CLONE2:.*]] = fir.alloca i32 {bindc_name = "arg2"
93-
!CHECK: omp.wsloop for (%[[INDX_WS:.*]]) : {{.*}} {
95+
!CHECK: omp.wsloop {
96+
!CHECK: omp.loopnest (%[[INDX_WS:.*]]) : {{.*}} {
9497

9598
! Testing last iteration check
9699
!CHECK: %[[V:.*]] = arith.addi %[[INDX_WS]], %{{.*}} : i32
@@ -111,7 +114,7 @@ subroutine lastprivate_int(arg1)
111114

112115
subroutine mult_lastprivate_int(arg1, arg2)
113116
integer :: arg1, arg2
114-
!$OMP PARALLEL
117+
!$OMP PARALLEL
115118
!$OMP DO LASTPRIVATE(arg1) LASTPRIVATE(arg2)
116119
do n = 1, 5
117120
arg1 = 2
@@ -127,7 +130,8 @@ subroutine mult_lastprivate_int(arg1, arg2)
127130
!CHECK: omp.parallel {
128131
!CHECK-DAG: %[[CLONE1:.*]] = fir.alloca i32 {bindc_name = "arg1"
129132
!CHECK-DAG: %[[CLONE2:.*]] = fir.alloca i32 {bindc_name = "arg2"
130-
!CHECK: omp.wsloop for (%[[INDX_WS:.*]]) : {{.*}} {
133+
!CHECK: omp.wsloop {
134+
!CHECK: omp.loopnest (%[[INDX_WS:.*]]) : {{.*}} {
131135

132136
!Testing last iteration check
133137
!CHECK: %[[V:.*]] = arith.addi %[[INDX_WS]], %{{.*}} : i32
@@ -148,7 +152,7 @@ subroutine mult_lastprivate_int(arg1, arg2)
148152

149153
subroutine mult_lastprivate_int2(arg1, arg2)
150154
integer :: arg1, arg2
151-
!$OMP PARALLEL
155+
!$OMP PARALLEL
152156
!$OMP DO LASTPRIVATE(arg1, arg2)
153157
do n = 1, 5
154158
arg1 = 2
@@ -169,7 +173,8 @@ subroutine mult_lastprivate_int2(arg1, arg2)
169173
! Lastprivate Allocation
170174
!CHECK-DAG: %[[CLONE2:.*]] = fir.alloca i32 {bindc_name = "arg2"
171175
!CHECK-NOT: omp.barrier
172-
!CHECK: omp.wsloop for (%[[INDX_WS:.*]]) : {{.*}} {
176+
!CHECK: omp.wsloop {
177+
!CHECK: omp.loopnest (%[[INDX_WS:.*]]) : {{.*}} {
173178

174179
! Testing last iteration check
175180
!CHECK: %[[V:.*]] = arith.addi %[[INDX_WS]], %{{.*}} : i32
@@ -188,7 +193,7 @@ subroutine mult_lastprivate_int2(arg1, arg2)
188193

189194
subroutine firstpriv_lastpriv_int(arg1, arg2)
190195
integer :: arg1, arg2
191-
!$OMP PARALLEL
196+
!$OMP PARALLEL
192197
!$OMP DO FIRSTPRIVATE(arg1) LASTPRIVATE(arg2)
193198
do n = 1, 5
194199
arg1 = 2
@@ -207,7 +212,8 @@ subroutine firstpriv_lastpriv_int(arg1, arg2)
207212
!CHECK-NEXT: %[[FPV_LD:.*]] = fir.load %[[ARG1]] : !fir.ref<i32>
208213
!CHECK-NEXT: fir.store %[[FPV_LD]] to %[[CLONE1]] : !fir.ref<i32>
209214
!CHECK-NEXT: omp.barrier
210-
!CHECK: omp.wsloop for (%[[INDX_WS:.*]]) : {{.*}} {
215+
!CHECK: omp.wsloop {
216+
!CHECK: omp.loopnest (%[[INDX_WS:.*]]) : {{.*}} {
211217
! Testing last iteration check
212218
!CHECK: %[[V:.*]] = arith.addi %[[INDX_WS]], %{{.*}} : i32
213219
!CHECK: %[[C0:.*]] = arith.constant 0 : i32
@@ -225,7 +231,7 @@ subroutine firstpriv_lastpriv_int(arg1, arg2)
225231

226232
subroutine firstpriv_lastpriv_int2(arg1)
227233
integer :: arg1
228-
!$OMP PARALLEL
234+
!$OMP PARALLEL
229235
!$OMP DO FIRSTPRIVATE(arg1) LASTPRIVATE(arg1)
230236
do n = 1, 5
231237
arg1 = 2

flang/test/Lower/OpenMP/FIR/parallel-private-clause-fixes.f90

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@
1313
! CHECK: %[[ONE:.*]] = arith.constant 1 : i32
1414
! CHECK: %[[VAL_3:.*]] = fir.load %[[VAL_4:.*]] : !fir.ref<i32>
1515
! CHECK: %[[VAL_5:.*]] = arith.constant 1 : i32
16-
! CHECK: omp.wsloop for (%[[VAL_6:.*]]) : i32 = (%[[ONE]]) to (%[[VAL_3]]) inclusive step (%[[VAL_5]]) {
16+
! CHECK: omp.wsloop {
17+
! CHECK: omp.loopnest (%[[VAL_6:.*]]) : i32 = (%[[ONE]]) to (%[[VAL_3]]) inclusive step (%[[VAL_5]]) {
1718
! CHECK: fir.store %[[VAL_6]] to %[[PRIV_I]] : !fir.ref<i32>
1819
! CHECK: %[[VAL_7:.*]] = arith.constant 1 : i32
1920
! CHECK: %[[VAL_8:.*]] = fir.convert %[[VAL_7]] : (i32) -> index

flang/test/Lower/OpenMP/FIR/parallel-private-clause.f90

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,8 @@ subroutine simple_loop_1
259259
! FIRDialect: %[[WS_UB:.*]] = arith.constant 9 : i32
260260
! FIRDialect: %[[WS_STEP:.*]] = arith.constant 1 : i32
261261

262-
! FIRDialect: omp.wsloop for (%[[I:.*]]) : i32 = (%[[WS_LB]]) to (%[[WS_UB]]) inclusive step (%[[WS_STEP]])
262+
! FIRDialect: omp.wsloop {
263+
! FIRDialect: omp.loopnest (%[[I:.*]]) : i32 = (%[[WS_LB]]) to (%[[WS_UB]]) inclusive step (%[[WS_STEP]])
263264
!$OMP DO
264265
do i=1, 9
265266
! FIRDialect: fir.store %[[I]] to %[[ALLOCA_IV:.*]] : !fir.ref<i32>
@@ -295,7 +296,8 @@ subroutine simple_loop_2
295296
! FIRDialect: %[[WS_UB:.*]] = arith.constant 9 : i32
296297
! FIRDialect: %[[WS_STEP:.*]] = arith.constant 1 : i32
297298

298-
! FIRDialect: omp.wsloop for (%[[I:.*]]) : i32 = (%[[WS_LB]]) to (%[[WS_UB]]) inclusive step (%[[WS_STEP]])
299+
! FIRDialect: omp.wsloop {
300+
! FIRDialect: omp.loopnest (%[[I:.*]]) : i32 = (%[[WS_LB]]) to (%[[WS_UB]]) inclusive step (%[[WS_STEP]])
299301
!$OMP DO PRIVATE(r)
300302
do i=1, 9
301303
! FIRDialect: fir.store %[[I]] to %[[ALLOCA_IV:.*]] : !fir.ref<i32>
@@ -330,7 +332,8 @@ subroutine simple_loop_3
330332
! FIRDialect: %[[WS_UB:.*]] = arith.constant 9 : i32
331333
! FIRDialect: %[[WS_STEP:.*]] = arith.constant 1 : i32
332334

333-
! FIRDialect: omp.wsloop for (%[[I:.*]]) : i32 = (%[[WS_LB]]) to (%[[WS_UB]]) inclusive step (%[[WS_STEP]])
335+
! FIRDialect: omp.wsloop {
336+
! FIRDialect: omp.loopnest (%[[I:.*]]) : i32 = (%[[WS_LB]]) to (%[[WS_UB]]) inclusive step (%[[WS_STEP]])
334337
!$OMP PARALLEL DO PRIVATE(r)
335338
do i=1, 9
336339
! FIRDialect: fir.store %[[I]] to %[[ALLOCA_IV:.*]] : !fir.ref<i32>

flang/test/Lower/OpenMP/FIR/parallel-wsloop-firstpriv.f90

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
! RUN: bbc -fopenmp -emit-fir -hlfir=false %s -o - | FileCheck %s
55

6-
! CHECK: func @_QPomp_do_firstprivate(%[[ARG0:.*]]: !fir.ref<i32> {fir.bindc_name = "a"})
6+
! CHECK: func @_QPomp_do_firstprivate(%[[ARG0:.*]]: !fir.ref<i32> {fir.bindc_name = "a"})
77
subroutine omp_do_firstprivate(a)
88
integer::a
99
integer::n
@@ -17,7 +17,8 @@ subroutine omp_do_firstprivate(a)
1717
! CHECK: %[[LB:.*]] = arith.constant 1 : i32
1818
! CHECK-NEXT: %[[UB:.*]] = fir.load %[[CLONE]] : !fir.ref<i32>
1919
! CHECK-NEXT: %[[STEP:.*]] = arith.constant 1 : i32
20-
! CHECK-NEXT: omp.wsloop for (%[[ARG1:.*]]) : i32 = (%[[LB]]) to (%[[UB]]) inclusive step (%[[STEP]])
20+
! CHECK-NEXT: omp.wsloop {
21+
! CHECK-NEXT: omp.loopnest (%[[ARG1:.*]]) : i32 = (%[[LB]]) to (%[[UB]]) inclusive step (%[[STEP]])
2122
! CHECK-NEXT: fir.store %[[ARG1]] to %[[REF]] : !fir.ref<i32>
2223
! CHECK-NEXT: fir.call @_QPfoo(%[[REF]], %[[CLONE]]) {{.*}}: (!fir.ref<i32>, !fir.ref<i32>) -> ()
2324
! CHECK-NEXT: omp.yield
@@ -29,7 +30,7 @@ subroutine omp_do_firstprivate(a)
2930
call bar(a)
3031
end subroutine omp_do_firstprivate
3132

32-
! CHECK: func @_QPomp_do_firstprivate2(%[[ARG0:.*]]: !fir.ref<i32> {fir.bindc_name = "a"}, %[[ARG1:.*]]: !fir.ref<i32> {fir.bindc_name = "n"})
33+
! CHECK: func @_QPomp_do_firstprivate2(%[[ARG0:.*]]: !fir.ref<i32> {fir.bindc_name = "a"}, %[[ARG1:.*]]: !fir.ref<i32> {fir.bindc_name = "n"})
3334
subroutine omp_do_firstprivate2(a, n)
3435
integer::a
3536
integer::n
@@ -48,7 +49,8 @@ subroutine omp_do_firstprivate2(a, n)
4849
! CHECK: %[[LB:.*]] = fir.load %[[CLONE]] : !fir.ref<i32>
4950
! CHECK-NEXT: %[[UB:.*]] = fir.load %[[CLONE1]] : !fir.ref<i32>
5051
! CHECK-NEXT: %[[STEP:.*]] = arith.constant 1 : i32
51-
! CHECK-NEXT: omp.wsloop for (%[[ARG2:.*]]) : i32 = (%[[LB]]) to (%[[UB]]) inclusive step (%[[STEP]])
52+
! CHECK-NEXT: omp.wsloop {
53+
! CHECK-NEXT: omp.loopnest (%[[ARG2:.*]]) : i32 = (%[[LB]]) to (%[[UB]]) inclusive step (%[[STEP]])
5254
! CHECK-NEXT: fir.store %[[ARG2]] to %[[REF]] : !fir.ref<i32>
5355
! CHECK-NEXT: fir.call @_QPfoo(%[[REF]], %[[CLONE]]) {{.*}}: (!fir.ref<i32>, !fir.ref<i32>) -> ()
5456
! CHECK-NEXT: omp.yield

flang/test/Lower/OpenMP/FIR/parallel-wsloop.f90

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@ subroutine simple_parallel_do
99
! CHECK: %[[WS_LB:.*]] = arith.constant 1 : i32
1010
! CHECK: %[[WS_UB:.*]] = arith.constant 9 : i32
1111
! CHECK: %[[WS_STEP:.*]] = arith.constant 1 : i32
12-
! CHECK: omp.wsloop for (%[[I:.*]]) : i32 = (%[[WS_LB]]) to (%[[WS_UB]]) inclusive step (%[[WS_STEP]])
12+
! CHECK: omp.wsloop {
13+
! CHECK: omp.loopnest (%[[I:.*]]) : i32 = (%[[WS_LB]]) to (%[[WS_UB]]) inclusive step (%[[WS_STEP]])
1314
!$OMP PARALLEL DO
1415
do i=1, 9
1516
! CHECK: fir.store %[[I]] to %[[IV_ADDR:.*]] : !fir.ref<i32>
@@ -35,7 +36,8 @@ subroutine parallel_do_with_parallel_clauses(cond, nt)
3536
! CHECK: %[[WS_LB:.*]] = arith.constant 1 : i32
3637
! CHECK: %[[WS_UB:.*]] = arith.constant 9 : i32
3738
! CHECK: %[[WS_STEP:.*]] = arith.constant 1 : i32
38-
! CHECK: omp.wsloop for (%[[I:.*]]) : i32 = (%[[WS_LB]]) to (%[[WS_UB]]) inclusive step (%[[WS_STEP]])
39+
! CHECK: omp.wsloop {
40+
! CHECK: omp.loopnest (%[[I:.*]]) : i32 = (%[[WS_LB]]) to (%[[WS_UB]]) inclusive step (%[[WS_STEP]])
3941
!$OMP PARALLEL DO IF(cond) NUM_THREADS(nt) PROC_BIND(close)
4042
do i=1, 9
4143
! CHECK: fir.store %[[I]] to %[[IV_ADDR:.*]] : !fir.ref<i32>
@@ -58,7 +60,8 @@ subroutine parallel_do_with_clauses(nt)
5860
! CHECK: %[[WS_LB:.*]] = arith.constant 1 : i32
5961
! CHECK: %[[WS_UB:.*]] = arith.constant 9 : i32
6062
! CHECK: %[[WS_STEP:.*]] = arith.constant 1 : i32
61-
! CHECK: omp.wsloop schedule(dynamic) for (%[[I:.*]]) : i32 = (%[[WS_LB]]) to (%[[WS_UB]]) inclusive step (%[[WS_STEP]])
63+
! CHECK: omp.wsloop schedule(dynamic) {
64+
! CHECK: omp.loopnest (%[[I:.*]]) : i32 = (%[[WS_LB]]) to (%[[WS_UB]]) inclusive step (%[[WS_STEP]])
6265
!$OMP PARALLEL DO NUM_THREADS(nt) SCHEDULE(dynamic)
6366
do i=1, 9
6467
! CHECK: fir.store %[[I]] to %[[IV_ADDR:.*]] : !fir.ref<i32>
@@ -90,7 +93,8 @@ subroutine parallel_do_with_privatisation_clauses(cond,nt)
9093
! CHECK: %[[WS_LB:.*]] = arith.constant 1 : i32
9194
! CHECK: %[[WS_UB:.*]] = arith.constant 9 : i32
9295
! CHECK: %[[WS_STEP:.*]] = arith.constant 1 : i32
93-
! CHECK: omp.wsloop for (%[[I:.*]]) : i32 = (%[[WS_LB]]) to (%[[WS_UB]]) inclusive step (%[[WS_STEP]])
96+
! CHECK: omp.wsloop {
97+
! CHECK: omp.loopnest (%[[I:.*]]) : i32 = (%[[WS_LB]]) to (%[[WS_UB]]) inclusive step (%[[WS_STEP]])
9498
!$OMP PARALLEL DO PRIVATE(cond) FIRSTPRIVATE(nt)
9599
do i=1, 9
96100
! CHECK: fir.store %[[I]] to %[[IV_ADDR:.*]] : !fir.ref<i32>
@@ -140,7 +144,8 @@ end subroutine parallel_private_do
140144
! CHECK: %[[VAL_7:.*]] = arith.constant 1 : i32
141145
! CHECK: %[[VAL_8:.*]] = arith.constant 9 : i32
142146
! CHECK: %[[VAL_9:.*]] = arith.constant 1 : i32
143-
! CHECK: omp.wsloop for (%[[I:.*]]) : i32 = (%[[VAL_7]]) to (%[[VAL_8]]) inclusive step (%[[VAL_9]]) {
147+
! CHECK: omp.wsloop {
148+
! CHECK: omp.loopnest (%[[I:.*]]) : i32 = (%[[VAL_7]]) to (%[[VAL_8]]) inclusive step (%[[VAL_9]]) {
144149
! CHECK: fir.store %[[I]] to %[[I_PRIV]] : !fir.ref<i32>
145150
! CHECK: fir.call @_QPfoo(%[[I_PRIV]], %[[COND_ADDR]], %[[NT_ADDR]]) {{.*}}: (!fir.ref<i32>, !fir.ref<!fir.logical<4>>, !fir.ref<i32>) -> ()
146151
! CHECK: omp.yield
@@ -182,7 +187,8 @@ end subroutine omp_parallel_multiple_firstprivate_do
182187
! CHECK: %[[VAL_8:.*]] = arith.constant 1 : i32
183188
! CHECK: %[[VAL_9:.*]] = arith.constant 10 : i32
184189
! CHECK: %[[VAL_10:.*]] = arith.constant 1 : i32
185-
! CHECK: omp.wsloop for (%[[I:.*]]) : i32 = (%[[VAL_8]]) to (%[[VAL_9]]) inclusive step (%[[VAL_10]]) {
190+
! CHECK: omp.wsloop {
191+
! CHECK: omp.loopnest (%[[I:.*]]) : i32 = (%[[VAL_8]]) to (%[[VAL_9]]) inclusive step (%[[VAL_10]]) {
186192
! CHECK: fir.store %[[I]] to %[[I_PRIV_ADDR]] : !fir.ref<i32>
187193
! CHECK: fir.call @_QPbar(%[[I_PRIV_ADDR]], %[[A_PRIV_ADDR]]) {{.*}}: (!fir.ref<i32>, !fir.ref<i32>) -> ()
188194
! CHECK: omp.yield
@@ -224,7 +230,8 @@ end subroutine parallel_do_private
224230
! CHECK: %[[VAL_7:.*]] = arith.constant 1 : i32
225231
! CHECK: %[[VAL_8:.*]] = arith.constant 9 : i32
226232
! CHECK: %[[VAL_9:.*]] = arith.constant 1 : i32
227-
! CHECK: omp.wsloop for (%[[I:.*]]) : i32 = (%[[VAL_7]]) to (%[[VAL_8]]) inclusive step (%[[VAL_9]]) {
233+
! CHECK: omp.wsloop {
234+
! CHECK: omp.loopnest (%[[I:.*]]) : i32 = (%[[VAL_7]]) to (%[[VAL_8]]) inclusive step (%[[VAL_9]]) {
228235
! CHECK: fir.store %[[I]] to %[[I_PRIV_ADDR]] : !fir.ref<i32>
229236
! CHECK: fir.call @_QPfoo(%[[I_PRIV_ADDR]], %[[COND_ADDR]], %[[NT_ADDR]]) {{.*}}: (!fir.ref<i32>, !fir.ref<!fir.logical<4>>, !fir.ref<i32>) -> ()
230237
! CHECK: omp.yield
@@ -266,7 +273,8 @@ end subroutine omp_parallel_do_multiple_firstprivate
266273
! CHECK: %[[VAL_8:.*]] = arith.constant 1 : i32
267274
! CHECK: %[[VAL_9:.*]] = arith.constant 10 : i32
268275
! CHECK: %[[VAL_10:.*]] = arith.constant 1 : i32
269-
! CHECK: omp.wsloop for (%[[I:.*]]) : i32 = (%[[VAL_8]]) to (%[[VAL_9]]) inclusive step (%[[VAL_10]]) {
276+
! CHECK: omp.wsloop {
277+
! CHECK: omp.loopnest (%[[I:.*]]) : i32 = (%[[VAL_8]]) to (%[[VAL_9]]) inclusive step (%[[VAL_10]]) {
270278
! CHECK: fir.store %[[I]] to %[[I_PRIV_ADDR]] : !fir.ref<i32>
271279
! CHECK: fir.call @_QPbar(%[[I_PRIV_ADDR]], %[[A_PRIV_ADDR]]) {{.*}}: (!fir.ref<i32>, !fir.ref<i32>) -> ()
272280
! CHECK: omp.yield

flang/test/Lower/OpenMP/FIR/stop-stmt-in-region.f90

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,8 @@ subroutine test_stop_in_region3()
7777
! CHECK: %[[VAL_3:.*]] = arith.constant 1 : i32
7878
! CHECK: %[[VAL_4:.*]] = arith.constant 10 : i32
7979
! CHECK: %[[VAL_5:.*]] = arith.constant 1 : i32
80-
! CHECK: omp.wsloop for (%[[VAL_6:.*]]) : i32 = (%[[VAL_3]]) to (%[[VAL_4]]) inclusive step (%[[VAL_5]]) {
80+
! CHECK: omp.wsloop {
81+
! CHECK: omp.loopnest (%[[VAL_6:.*]]) : i32 = (%[[VAL_3]]) to (%[[VAL_4]]) inclusive step (%[[VAL_5]]) {
8182
! CHECK: fir.store %[[VAL_6]] to %[[VAL_0]] : !fir.ref<i32>
8283
! CHECK: cf.br ^bb1
8384
! CHECK: ^bb1:

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -487,7 +487,8 @@ subroutine omp_target_parallel_do
487487
!CHECK: %[[VAL_5:.*]] = arith.constant 1 : i32
488488
!CHECK: %[[VAL_6:.*]] = arith.constant 1024 : i32
489489
!CHECK: %[[VAL_7:.*]] = arith.constant 1 : i32
490-
!CHECK: omp.wsloop for (%[[VAL_8:.*]]) : i32 = (%[[VAL_5]]) to (%[[VAL_6]]) inclusive step (%[[VAL_7]]) {
490+
!CHECK: omp.wsloop {
491+
!CHECK: omp.loopnest (%[[VAL_8:.*]]) : i32 = (%[[VAL_5]]) to (%[[VAL_6]]) inclusive step (%[[VAL_7]]) {
491492
!CHECK: fir.store %[[VAL_8]] to %[[VAL_4]] : !fir.ref<i32>
492493
!CHECK: %[[VAL_9:.*]] = arith.constant 10 : i32
493494
!CHECK: %[[VAL_10:.*]] = fir.load %[[VAL_4]] : !fir.ref<i32>

0 commit comments

Comments
 (0)