Skip to content

Commit

Permalink
Merge pull request #55 from TIFitis/skatrak/composite
Browse files Browse the repository at this point in the history
Akash- Fix tests related to omp.wsloop.
  • Loading branch information
TIFitis committed Mar 26, 2024
2 parents 1e47d70 + 0319ceb commit f3747e5
Show file tree
Hide file tree
Showing 73 changed files with 592 additions and 306 deletions.
8 changes: 5 additions & 3 deletions flang/test/Lower/OpenMP/FIR/copyin.f90
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,8 @@ subroutine copyin_derived_type()
! CHECK: %[[VAL_6:.*]] = arith.constant 1 : i32
! CHECK: %[[VAL_7:.*]] = fir.load %[[VAL_4]] : !fir.ref<i32>
! CHECK: %[[VAL_8:.*]] = arith.constant 1 : i32
! CHECK: omp.wsloop for (%[[VAL_9:.*]]) : i32 = (%[[VAL_6]]) to (%[[VAL_7]]) inclusive step (%[[VAL_8]]) {
! CHECK: omp.wsloop {
! CHECK: omp.loopnest (%[[VAL_9:.*]]) : i32 = (%[[VAL_6]]) to (%[[VAL_7]]) inclusive step (%[[VAL_8]]) {
! CHECK: fir.store %[[VAL_9]] to %[[VAL_3]] : !fir.ref<i32>
! CHECK: fir.call @_QPsub4(%[[VAL_4]]) {{.*}}: (!fir.ref<i32>) -> ()
! CHECK: omp.yield
Expand Down Expand Up @@ -286,7 +287,8 @@ subroutine common_1()
!CHECK: %[[val_c1_i32:.*]] = arith.constant 1 : i32
!CHECK: %[[val_19:.*]] = fir.load %[[val_13]] : !fir.ref<i32>
!CHECK: %[[val_c1_i32_2:.*]] = arith.constant 1 : i32
!CHECK: omp.wsloop for (%[[arg:.*]]) : i32 = (%[[val_c1_i32]]) to (%[[val_19]]) inclusive step (%[[val_c1_i32_2]]) {
!CHECK: omp.wsloop {
!CHECK: omp.loopnest (%[[arg:.*]]) : i32 = (%[[val_c1_i32]]) to (%[[val_19]]) inclusive step (%[[val_c1_i32_2]]) {
!CHECK: fir.store %[[arg]] to %[[val_9]] : !fir.ref<i32>
!CHECK: %[[val_20:.*]] = fir.load %[[val_16]] : !fir.ref<i32>
!CHECK: %[[val_21:.*]] = fir.load %[[val_9]] : !fir.ref<i32>
Expand All @@ -303,7 +305,7 @@ subroutine common_2()
integer :: y
common /d/ x, y
!$omp threadprivate(/d/)

!$omp parallel do copyin(/d/)
do i = 1, x
y = y + i
Expand Down
5 changes: 3 additions & 2 deletions flang/test/Lower/OpenMP/FIR/lastprivate-commonblock.f90
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
! RUN: %flang_fc1 -emit-fir -flang-deprecated-no-hlfir -fopenmp -o - %s 2>&1 | FileCheck %s
! RUN: %flang_fc1 -emit-fir -flang-deprecated-no-hlfir -fopenmp -o - %s 2>&1 | FileCheck %s

!CHECK: func.func @_QPlastprivate_common() {
!CHECK: %[[val_0:.*]] = fir.alloca i32 {adapt.valuebyref, pinned}
Expand All @@ -17,7 +17,8 @@
!CHECK: %[[val_c1_i32:.*]] = arith.constant 1 : i32
!CHECK: %[[val_c100_i32:.*]] = arith.constant 100 : i32
!CHECK: %[[val_c1_i32_0:.*]] = arith.constant 1 : i32
!CHECK: omp.wsloop for (%[[arg:.*]]) : i32 = (%[[val_c1_i32]]) to (%[[val_c100_i32]]) inclusive step (%[[val_c1_i32_0]]) {
!CHECK: omp.wsloop {
!CHECK: omp.loopnest (%[[arg:.*]]) : i32 = (%[[val_c1_i32]]) to (%[[val_c100_i32]]) inclusive step (%[[val_c1_i32_0]]) {
!CHECK: fir.store %[[arg]] to %[[val_0]] : !fir.ref<i32>
!CHECK: %[[val_11:.*]] = arith.addi %[[arg]], %[[val_c1_i32_0]] : i32
!CHECK: %[[val_c0_i32:.*]] = arith.constant 0 : i32
Expand Down
38 changes: 22 additions & 16 deletions flang/test/Lower/OpenMP/FIR/parallel-lastprivate-clause-scalar.f90
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,17 @@
!CHECK-DAG: %[[ARG1_REF:.*]] = fir.convert %[[ARG1_UNBOX]]#0 : (!fir.ref<!fir.char<1,?>>) -> !fir.ref<!fir.char<1,5>>

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

! Check that we are accessing the clone inside the loop
!CHECK-DAG: omp.wsloop for (%[[INDX_WS:.*]]) : {{.*}} {
!CHECK-DAG: omp.wsloop {
!CHECK-DAG: omp.loopnest (%[[INDX_WS:.*]]) : {{.*}} {
!CHECK-DAG: %[[UNIT:.*]] = arith.constant 6 : i32
!CHECK-NEXT: %[[ADDR:.*]] = fir.address_of(@_QQclX
!CHECK-NEXT: %[[CVT0:.*]] = fir.convert %[[ADDR]]
!CHECK-NEXT: %[[CVT0:.*]] = fir.convert %[[ADDR]]
!CHECK-NEXT: %[[CNST:.*]] = arith.constant
!CHECK-NEXT: %[[CALL_BEGIN_IO:.*]] = fir.call @_FortranAioBeginExternalListOutput(%[[UNIT]], %[[CVT0]], %[[CNST]]) {{.*}}: (i32, !fir.ref<i8>, i32) -> !fir.ref<i8>
!CHECK-NEXT: %[[CVT_0_1:.*]] = fir.convert %[[ARG1_PVT]]
!CHECK-NEXT: %[[CVT_0_1:.*]] = fir.convert %[[ARG1_PVT]]
!CHECK-NEXT: %[[CVT_0_2:.*]] = fir.convert %[[FIVE]]
!CHECK-NEXT: %[[CALL_OP_ASCII:.*]] = fir.call @_FortranAioOutputAscii(%[[CALL_BEGIN_IO]], %[[CVT_0_1]], %[[CVT_0_2]])
!CHECK-NEXT: %[[CALL_END_IO:.*]] = fir.call @_FortranAioEndIoStatement(%[[CALL_BEGIN_IO]])
Expand All @@ -37,12 +38,12 @@
!CHECK-DAG: %[[CVT:.*]] = fir.convert %[[ARG1_REF]] : (!fir.ref<!fir.char<1,5>>) -> !fir.ref<i8>
!CHECK-DAG: %[[CVT1:.*]] = fir.convert %[[ARG1_PVT]] : (!fir.ref<!fir.char<1,5>>) -> !fir.ref<i8>
!CHECK-DAG: fir.call @llvm.memmove.p0.p0.i64(%[[CVT]], %[[CVT1]]{{.*}})
!CHECK-DAG: }
!CHECK-DAG: }
!CHECK-DAG: omp.yield

subroutine lastprivate_character(arg1)
character(5) :: arg1
!$OMP PARALLEL
!$OMP PARALLEL
!$OMP DO LASTPRIVATE(arg1)
do n = 1, 5
arg1(n:n) = 'c'
Expand All @@ -55,7 +56,8 @@ subroutine lastprivate_character(arg1)
!CHECK: func @_QPlastprivate_int(%[[ARG1:.*]]: !fir.ref<i32> {fir.bindc_name = "arg1"}) {
!CHECK-DAG: omp.parallel {
!CHECK-DAG: %[[CLONE:.*]] = fir.alloca i32 {bindc_name = "arg1"
!CHECK: omp.wsloop for (%[[INDX_WS:.*]]) : {{.*}} {
!CHECK: omp.wsloop {
!CHECK: omp.loopnest (%[[INDX_WS:.*]]) : {{.*}} {

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

subroutine lastprivate_int(arg1)
integer :: arg1
!$OMP PARALLEL
!$OMP PARALLEL
!$OMP DO LASTPRIVATE(arg1)
do n = 1, 5
arg1 = 2
Expand All @@ -90,7 +92,8 @@ subroutine lastprivate_int(arg1)
!CHECK: omp.parallel {
!CHECK-DAG: %[[CLONE1:.*]] = fir.alloca i32 {bindc_name = "arg1"
!CHECK-DAG: %[[CLONE2:.*]] = fir.alloca i32 {bindc_name = "arg2"
!CHECK: omp.wsloop for (%[[INDX_WS:.*]]) : {{.*}} {
!CHECK: omp.wsloop {
!CHECK: omp.loopnest (%[[INDX_WS:.*]]) : {{.*}} {

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

subroutine mult_lastprivate_int(arg1, arg2)
integer :: arg1, arg2
!$OMP PARALLEL
!$OMP PARALLEL
!$OMP DO LASTPRIVATE(arg1) LASTPRIVATE(arg2)
do n = 1, 5
arg1 = 2
Expand All @@ -127,7 +130,8 @@ subroutine mult_lastprivate_int(arg1, arg2)
!CHECK: omp.parallel {
!CHECK-DAG: %[[CLONE1:.*]] = fir.alloca i32 {bindc_name = "arg1"
!CHECK-DAG: %[[CLONE2:.*]] = fir.alloca i32 {bindc_name = "arg2"
!CHECK: omp.wsloop for (%[[INDX_WS:.*]]) : {{.*}} {
!CHECK: omp.wsloop {
!CHECK: omp.loopnest (%[[INDX_WS:.*]]) : {{.*}} {

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

subroutine mult_lastprivate_int2(arg1, arg2)
integer :: arg1, arg2
!$OMP PARALLEL
!$OMP PARALLEL
!$OMP DO LASTPRIVATE(arg1, arg2)
do n = 1, 5
arg1 = 2
Expand All @@ -169,7 +173,8 @@ subroutine mult_lastprivate_int2(arg1, arg2)
! Lastprivate Allocation
!CHECK-DAG: %[[CLONE2:.*]] = fir.alloca i32 {bindc_name = "arg2"
!CHECK-NOT: omp.barrier
!CHECK: omp.wsloop for (%[[INDX_WS:.*]]) : {{.*}} {
!CHECK: omp.wsloop {
!CHECK: omp.loopnest (%[[INDX_WS:.*]]) : {{.*}} {

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

subroutine firstpriv_lastpriv_int(arg1, arg2)
integer :: arg1, arg2
!$OMP PARALLEL
!$OMP PARALLEL
!$OMP DO FIRSTPRIVATE(arg1) LASTPRIVATE(arg2)
do n = 1, 5
arg1 = 2
Expand All @@ -207,7 +212,8 @@ subroutine firstpriv_lastpriv_int(arg1, arg2)
!CHECK-NEXT: %[[FPV_LD:.*]] = fir.load %[[ARG1]] : !fir.ref<i32>
!CHECK-NEXT: fir.store %[[FPV_LD]] to %[[CLONE1]] : !fir.ref<i32>
!CHECK-NEXT: omp.barrier
!CHECK: omp.wsloop for (%[[INDX_WS:.*]]) : {{.*}} {
!CHECK: omp.wsloop {
!CHECK: omp.loopnest (%[[INDX_WS:.*]]) : {{.*}} {
! Testing last iteration check
!CHECK: %[[V:.*]] = arith.addi %[[INDX_WS]], %{{.*}} : i32
!CHECK: %[[C0:.*]] = arith.constant 0 : i32
Expand All @@ -225,7 +231,7 @@ subroutine firstpriv_lastpriv_int(arg1, arg2)

subroutine firstpriv_lastpriv_int2(arg1)
integer :: arg1
!$OMP PARALLEL
!$OMP PARALLEL
!$OMP DO FIRSTPRIVATE(arg1) LASTPRIVATE(arg1)
do n = 1, 5
arg1 = 2
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@
! CHECK: %[[ONE:.*]] = arith.constant 1 : i32
! CHECK: %[[VAL_3:.*]] = fir.load %[[VAL_4:.*]] : !fir.ref<i32>
! CHECK: %[[VAL_5:.*]] = arith.constant 1 : i32
! CHECK: omp.wsloop for (%[[VAL_6:.*]]) : i32 = (%[[ONE]]) to (%[[VAL_3]]) inclusive step (%[[VAL_5]]) {
! CHECK: omp.wsloop {
! CHECK: omp.loopnest (%[[VAL_6:.*]]) : i32 = (%[[ONE]]) to (%[[VAL_3]]) inclusive step (%[[VAL_5]]) {
! CHECK: fir.store %[[VAL_6]] to %[[PRIV_I]] : !fir.ref<i32>
! CHECK: %[[VAL_7:.*]] = arith.constant 1 : i32
! CHECK: %[[VAL_8:.*]] = fir.convert %[[VAL_7]] : (i32) -> index
Expand Down
9 changes: 6 additions & 3 deletions flang/test/Lower/OpenMP/FIR/parallel-private-clause.f90
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,8 @@ subroutine simple_loop_1
! FIRDialect: %[[WS_UB:.*]] = arith.constant 9 : i32
! FIRDialect: %[[WS_STEP:.*]] = arith.constant 1 : i32

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

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

! FIRDialect: omp.wsloop for (%[[I:.*]]) : i32 = (%[[WS_LB]]) to (%[[WS_UB]]) inclusive step (%[[WS_STEP]])
! FIRDialect: omp.wsloop {
! FIRDialect: omp.loopnest (%[[I:.*]]) : i32 = (%[[WS_LB]]) to (%[[WS_UB]]) inclusive step (%[[WS_STEP]])
!$OMP PARALLEL DO PRIVATE(r)
do i=1, 9
! FIRDialect: fir.store %[[I]] to %[[ALLOCA_IV:.*]] : !fir.ref<i32>
Expand Down
10 changes: 6 additions & 4 deletions flang/test/Lower/OpenMP/FIR/parallel-wsloop-firstpriv.f90
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

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

! CHECK: func @_QPomp_do_firstprivate(%[[ARG0:.*]]: !fir.ref<i32> {fir.bindc_name = "a"})
! CHECK: func @_QPomp_do_firstprivate(%[[ARG0:.*]]: !fir.ref<i32> {fir.bindc_name = "a"})
subroutine omp_do_firstprivate(a)
integer::a
integer::n
Expand All @@ -17,7 +17,8 @@ subroutine omp_do_firstprivate(a)
! CHECK: %[[LB:.*]] = arith.constant 1 : i32
! CHECK-NEXT: %[[UB:.*]] = fir.load %[[CLONE]] : !fir.ref<i32>
! CHECK-NEXT: %[[STEP:.*]] = arith.constant 1 : i32
! CHECK-NEXT: omp.wsloop for (%[[ARG1:.*]]) : i32 = (%[[LB]]) to (%[[UB]]) inclusive step (%[[STEP]])
! CHECK-NEXT: omp.wsloop {
! CHECK-NEXT: omp.loopnest (%[[ARG1:.*]]) : i32 = (%[[LB]]) to (%[[UB]]) inclusive step (%[[STEP]])
! CHECK-NEXT: fir.store %[[ARG1]] to %[[REF]] : !fir.ref<i32>
! CHECK-NEXT: fir.call @_QPfoo(%[[REF]], %[[CLONE]]) {{.*}}: (!fir.ref<i32>, !fir.ref<i32>) -> ()
! CHECK-NEXT: omp.yield
Expand All @@ -29,7 +30,7 @@ subroutine omp_do_firstprivate(a)
call bar(a)
end subroutine omp_do_firstprivate

! CHECK: func @_QPomp_do_firstprivate2(%[[ARG0:.*]]: !fir.ref<i32> {fir.bindc_name = "a"}, %[[ARG1:.*]]: !fir.ref<i32> {fir.bindc_name = "n"})
! CHECK: func @_QPomp_do_firstprivate2(%[[ARG0:.*]]: !fir.ref<i32> {fir.bindc_name = "a"}, %[[ARG1:.*]]: !fir.ref<i32> {fir.bindc_name = "n"})
subroutine omp_do_firstprivate2(a, n)
integer::a
integer::n
Expand All @@ -48,7 +49,8 @@ subroutine omp_do_firstprivate2(a, n)
! CHECK: %[[LB:.*]] = fir.load %[[CLONE]] : !fir.ref<i32>
! CHECK-NEXT: %[[UB:.*]] = fir.load %[[CLONE1]] : !fir.ref<i32>
! CHECK-NEXT: %[[STEP:.*]] = arith.constant 1 : i32
! CHECK-NEXT: omp.wsloop for (%[[ARG2:.*]]) : i32 = (%[[LB]]) to (%[[UB]]) inclusive step (%[[STEP]])
! CHECK-NEXT: omp.wsloop {
! CHECK-NEXT: omp.loopnest (%[[ARG2:.*]]) : i32 = (%[[LB]]) to (%[[UB]]) inclusive step (%[[STEP]])
! CHECK-NEXT: fir.store %[[ARG2]] to %[[REF]] : !fir.ref<i32>
! CHECK-NEXT: fir.call @_QPfoo(%[[REF]], %[[CLONE]]) {{.*}}: (!fir.ref<i32>, !fir.ref<i32>) -> ()
! CHECK-NEXT: omp.yield
Expand Down
24 changes: 16 additions & 8 deletions flang/test/Lower/OpenMP/FIR/parallel-wsloop.f90
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ subroutine simple_parallel_do
! CHECK: %[[WS_LB:.*]] = arith.constant 1 : i32
! CHECK: %[[WS_UB:.*]] = arith.constant 9 : i32
! CHECK: %[[WS_STEP:.*]] = arith.constant 1 : i32
! CHECK: omp.wsloop for (%[[I:.*]]) : i32 = (%[[WS_LB]]) to (%[[WS_UB]]) inclusive step (%[[WS_STEP]])
! CHECK: omp.wsloop {
! CHECK: omp.loopnest (%[[I:.*]]) : i32 = (%[[WS_LB]]) to (%[[WS_UB]]) inclusive step (%[[WS_STEP]])
!$OMP PARALLEL DO
do i=1, 9
! CHECK: fir.store %[[I]] to %[[IV_ADDR:.*]] : !fir.ref<i32>
Expand All @@ -35,7 +36,8 @@ subroutine parallel_do_with_parallel_clauses(cond, nt)
! CHECK: %[[WS_LB:.*]] = arith.constant 1 : i32
! CHECK: %[[WS_UB:.*]] = arith.constant 9 : i32
! CHECK: %[[WS_STEP:.*]] = arith.constant 1 : i32
! CHECK: omp.wsloop for (%[[I:.*]]) : i32 = (%[[WS_LB]]) to (%[[WS_UB]]) inclusive step (%[[WS_STEP]])
! CHECK: omp.wsloop {
! CHECK: omp.loopnest (%[[I:.*]]) : i32 = (%[[WS_LB]]) to (%[[WS_UB]]) inclusive step (%[[WS_STEP]])
!$OMP PARALLEL DO IF(cond) NUM_THREADS(nt) PROC_BIND(close)
do i=1, 9
! CHECK: fir.store %[[I]] to %[[IV_ADDR:.*]] : !fir.ref<i32>
Expand All @@ -58,7 +60,8 @@ subroutine parallel_do_with_clauses(nt)
! CHECK: %[[WS_LB:.*]] = arith.constant 1 : i32
! CHECK: %[[WS_UB:.*]] = arith.constant 9 : i32
! CHECK: %[[WS_STEP:.*]] = arith.constant 1 : i32
! CHECK: omp.wsloop schedule(dynamic) for (%[[I:.*]]) : i32 = (%[[WS_LB]]) to (%[[WS_UB]]) inclusive step (%[[WS_STEP]])
! CHECK: omp.wsloop schedule(dynamic) {
! CHECK: omp.loopnest (%[[I:.*]]) : i32 = (%[[WS_LB]]) to (%[[WS_UB]]) inclusive step (%[[WS_STEP]])
!$OMP PARALLEL DO NUM_THREADS(nt) SCHEDULE(dynamic)
do i=1, 9
! CHECK: fir.store %[[I]] to %[[IV_ADDR:.*]] : !fir.ref<i32>
Expand Down Expand Up @@ -90,7 +93,8 @@ subroutine parallel_do_with_privatisation_clauses(cond,nt)
! CHECK: %[[WS_LB:.*]] = arith.constant 1 : i32
! CHECK: %[[WS_UB:.*]] = arith.constant 9 : i32
! CHECK: %[[WS_STEP:.*]] = arith.constant 1 : i32
! CHECK: omp.wsloop for (%[[I:.*]]) : i32 = (%[[WS_LB]]) to (%[[WS_UB]]) inclusive step (%[[WS_STEP]])
! CHECK: omp.wsloop {
! CHECK: omp.loopnest (%[[I:.*]]) : i32 = (%[[WS_LB]]) to (%[[WS_UB]]) inclusive step (%[[WS_STEP]])
!$OMP PARALLEL DO PRIVATE(cond) FIRSTPRIVATE(nt)
do i=1, 9
! CHECK: fir.store %[[I]] to %[[IV_ADDR:.*]] : !fir.ref<i32>
Expand Down Expand Up @@ -140,7 +144,8 @@ end subroutine parallel_private_do
! CHECK: %[[VAL_7:.*]] = arith.constant 1 : i32
! CHECK: %[[VAL_8:.*]] = arith.constant 9 : i32
! CHECK: %[[VAL_9:.*]] = arith.constant 1 : i32
! CHECK: omp.wsloop for (%[[I:.*]]) : i32 = (%[[VAL_7]]) to (%[[VAL_8]]) inclusive step (%[[VAL_9]]) {
! CHECK: omp.wsloop {
! CHECK: omp.loopnest (%[[I:.*]]) : i32 = (%[[VAL_7]]) to (%[[VAL_8]]) inclusive step (%[[VAL_9]]) {
! CHECK: fir.store %[[I]] to %[[I_PRIV]] : !fir.ref<i32>
! CHECK: fir.call @_QPfoo(%[[I_PRIV]], %[[COND_ADDR]], %[[NT_ADDR]]) {{.*}}: (!fir.ref<i32>, !fir.ref<!fir.logical<4>>, !fir.ref<i32>) -> ()
! CHECK: omp.yield
Expand Down Expand Up @@ -182,7 +187,8 @@ end subroutine omp_parallel_multiple_firstprivate_do
! CHECK: %[[VAL_8:.*]] = arith.constant 1 : i32
! CHECK: %[[VAL_9:.*]] = arith.constant 10 : i32
! CHECK: %[[VAL_10:.*]] = arith.constant 1 : i32
! CHECK: omp.wsloop for (%[[I:.*]]) : i32 = (%[[VAL_8]]) to (%[[VAL_9]]) inclusive step (%[[VAL_10]]) {
! CHECK: omp.wsloop {
! CHECK: omp.loopnest (%[[I:.*]]) : i32 = (%[[VAL_8]]) to (%[[VAL_9]]) inclusive step (%[[VAL_10]]) {
! CHECK: fir.store %[[I]] to %[[I_PRIV_ADDR]] : !fir.ref<i32>
! CHECK: fir.call @_QPbar(%[[I_PRIV_ADDR]], %[[A_PRIV_ADDR]]) {{.*}}: (!fir.ref<i32>, !fir.ref<i32>) -> ()
! CHECK: omp.yield
Expand Down Expand Up @@ -224,7 +230,8 @@ end subroutine parallel_do_private
! CHECK: %[[VAL_7:.*]] = arith.constant 1 : i32
! CHECK: %[[VAL_8:.*]] = arith.constant 9 : i32
! CHECK: %[[VAL_9:.*]] = arith.constant 1 : i32
! CHECK: omp.wsloop for (%[[I:.*]]) : i32 = (%[[VAL_7]]) to (%[[VAL_8]]) inclusive step (%[[VAL_9]]) {
! CHECK: omp.wsloop {
! CHECK: omp.loopnest (%[[I:.*]]) : i32 = (%[[VAL_7]]) to (%[[VAL_8]]) inclusive step (%[[VAL_9]]) {
! CHECK: fir.store %[[I]] to %[[I_PRIV_ADDR]] : !fir.ref<i32>
! CHECK: fir.call @_QPfoo(%[[I_PRIV_ADDR]], %[[COND_ADDR]], %[[NT_ADDR]]) {{.*}}: (!fir.ref<i32>, !fir.ref<!fir.logical<4>>, !fir.ref<i32>) -> ()
! CHECK: omp.yield
Expand Down Expand Up @@ -266,7 +273,8 @@ end subroutine omp_parallel_do_multiple_firstprivate
! CHECK: %[[VAL_8:.*]] = arith.constant 1 : i32
! CHECK: %[[VAL_9:.*]] = arith.constant 10 : i32
! CHECK: %[[VAL_10:.*]] = arith.constant 1 : i32
! CHECK: omp.wsloop for (%[[I:.*]]) : i32 = (%[[VAL_8]]) to (%[[VAL_9]]) inclusive step (%[[VAL_10]]) {
! CHECK: omp.wsloop {
! CHECK: omp.loopnest (%[[I:.*]]) : i32 = (%[[VAL_8]]) to (%[[VAL_9]]) inclusive step (%[[VAL_10]]) {
! CHECK: fir.store %[[I]] to %[[I_PRIV_ADDR]] : !fir.ref<i32>
! CHECK: fir.call @_QPbar(%[[I_PRIV_ADDR]], %[[A_PRIV_ADDR]]) {{.*}}: (!fir.ref<i32>, !fir.ref<i32>) -> ()
! CHECK: omp.yield
Expand Down
3 changes: 2 additions & 1 deletion flang/test/Lower/OpenMP/FIR/stop-stmt-in-region.f90
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,8 @@ subroutine test_stop_in_region3()
! CHECK: %[[VAL_3:.*]] = arith.constant 1 : i32
! CHECK: %[[VAL_4:.*]] = arith.constant 10 : i32
! CHECK: %[[VAL_5:.*]] = arith.constant 1 : i32
! CHECK: omp.wsloop for (%[[VAL_6:.*]]) : i32 = (%[[VAL_3]]) to (%[[VAL_4]]) inclusive step (%[[VAL_5]]) {
! CHECK: omp.wsloop {
! CHECK: omp.loopnest (%[[VAL_6:.*]]) : i32 = (%[[VAL_3]]) to (%[[VAL_4]]) inclusive step (%[[VAL_5]]) {
! CHECK: fir.store %[[VAL_6]] to %[[VAL_0]] : !fir.ref<i32>
! CHECK: cf.br ^bb1
! CHECK: ^bb1:
Expand Down
3 changes: 2 additions & 1 deletion flang/test/Lower/OpenMP/FIR/target.f90
Original file line number Diff line number Diff line change
Expand Up @@ -487,7 +487,8 @@ subroutine omp_target_parallel_do
!CHECK: %[[VAL_5:.*]] = arith.constant 1 : i32
!CHECK: %[[VAL_6:.*]] = arith.constant 1024 : i32
!CHECK: %[[VAL_7:.*]] = arith.constant 1 : i32
!CHECK: omp.wsloop for (%[[VAL_8:.*]]) : i32 = (%[[VAL_5]]) to (%[[VAL_6]]) inclusive step (%[[VAL_7]]) {
!CHECK: omp.wsloop {
!CHECK: omp.loopnest (%[[VAL_8:.*]]) : i32 = (%[[VAL_5]]) to (%[[VAL_6]]) inclusive step (%[[VAL_7]]) {
!CHECK: fir.store %[[VAL_8]] to %[[VAL_4]] : !fir.ref<i32>
!CHECK: %[[VAL_9:.*]] = arith.constant 10 : i32
!CHECK: %[[VAL_10:.*]] = fir.load %[[VAL_4]] : !fir.ref<i32>
Expand Down
Loading

0 comments on commit f3747e5

Please sign in to comment.