Skip to content

Commit 02636ca

Browse files
committed
[flang][OpenMP] do concurrent to device mapping lit tests
Adds more lit tests for `do concurrent` device mapping.
1 parent 26e7330 commit 02636ca

9 files changed

+478
-77
lines changed
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
! Verifies that proper `omp.map.bounds` ops are emitted when an allocatable is
2+
! implicitly mapped by a `do concurrent` loop.
3+
4+
! RUN: %flang_fc1 -emit-hlfir -fopenmp -fdo-concurrent-to-openmp=device %s -o - \
5+
! RUN: | FileCheck %s
6+
program main
7+
implicit none
8+
9+
integer,parameter :: n = 1000000
10+
real, allocatable, dimension(:) :: y
11+
integer :: i
12+
13+
allocate(y(1:n))
14+
15+
do concurrent(i=1:n)
16+
y(i) = 42
17+
end do
18+
19+
deallocate(y)
20+
end program main
21+
22+
! CHECK: %[[Y_DECL:.*]]:2 = hlfir.declare %{{.*}} {fortran_attrs = #fir.var_attrs<allocatable>, uniq_name = "_QFEy"}
23+
! CHECK: %[[Y_VAL:.*]] = fir.load %[[Y_DECL]]#0
24+
! CHECK: %[[Y_DIM0:.*]]:3 = fir.box_dims %[[Y_VAL]], %{{c0_.*}}
25+
! CHECK: %[[Y_LB:.*]] = arith.constant 0 : index
26+
! CHECK: %[[Y_UB:.*]] = arith.subi %[[Y_DIM0]]#1, %{{c1_.*}} : index
27+
! CHECK: %[[Y_BOUNDS:.*]] = omp.map.bounds lower_bound(%[[Y_LB]] : index) upper_bound(%[[Y_UB]] : index) extent(%[[Y_DIM0]]#1 : index)
28+
! CHECK: %[[MEM_MAP:.*]] = omp.map.info {{.*}} bounds(%[[Y_BOUNDS]])
29+
! CHECK: omp.map.info var_ptr(%[[Y_DECL]]#1 : {{.*}}) {{.*}} members(%[[MEM_MAP]] : {{.*}})
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
! Tests `host_eval` clause code-gen and loop nest bounds on host vs. device.
2+
3+
! RUN: %flang_fc1 -emit-hlfir -fopenmp -fopenmp-targets=amdgcn-amd-amdhsa \
4+
! RUN: -fdo-concurrent-to-openmp=device %s -o - \
5+
! RUN: | FileCheck %s --check-prefix=HOST -vv
6+
7+
! RUN: %flang_fc1 -triple amdgcn-amd-amdhsa -emit-hlfir -fopenmp \
8+
! RUN: -fopenmp-is-target-device -fdo-concurrent-to-openmp=device %s -o - \
9+
! RUN: | FileCheck %s --check-prefix=DEVICE
10+
11+
program do_concurrent_host_eval
12+
implicit none
13+
integer :: i, j
14+
15+
do concurrent (i=1:10, j=1:20)
16+
end do
17+
end program do_concurrent_host_eval
18+
19+
! HOST: omp.target host_eval(
20+
! HOST-SAME: %{{[^[:space:]]+}} -> %[[I_LB:[^,]+]],
21+
! HOST-SAME: %{{[^[:space:]]+}} -> %[[I_UB:[^,]+]],
22+
! HOST-SAME: %{{[^[:space:]]+}} -> %[[I_ST:[^,]+]],
23+
! HOST-SAME: %{{[^[:space:]]+}} -> %[[J_LB:[^,]+]],
24+
! HOST-SAME: %{{[^[:space:]]+}} -> %[[J_UB:[^,]+]],
25+
! HOST-SAME: %{{[^[:space:]]+}} -> %[[J_ST:[^,]+]] : {{.*}}) map_entries
26+
27+
! HOST: omp.loop_nest ({{.*}}, {{.*}}) : index = (%[[I_LB]], %[[J_LB]]) to
28+
! HOST-SAME: (%[[I_UB]], %[[J_UB]]) inclusive step
29+
! HOST-SAME: (%[[I_ST]], %[[J_ST]])
30+
31+
! DEVICE: omp.target map_entries(
32+
! DEVICE-SAME: %{{[^[:space:]]+}} -> %[[I_LB_MAP:[^,]+]],
33+
! DEVICE-SAME: %{{[^[:space:]]+}} -> %[[I_UB_MAP:[^,]+]],
34+
! DEVICE-SAME: %{{[^[:space:]]+}} -> %[[I_ST_MAP:[^,]+]],
35+
36+
! DEVICE-SAME: %{{[^[:space:]]+}} -> %[[J_LB_MAP:[^,]+]],
37+
! DEVICE-SAME: %{{[^[:space:]]+}} -> %[[J_UB_MAP:[^,]+]],
38+
! DEVICE-SAME: %{{[^[:space:]]+}} -> %[[J_ST_MAP:[^,]+]],
39+
40+
! DEVICE-SAME: %{{[^[:space:]]+}} -> %{{[^,]+}},
41+
! DEVICE-SAME: %{{[^[:space:]]+}} -> %{{[^,]+}} : {{.*}})
42+
43+
! DEVICE: %[[I_LB_DECL:.*]]:2 = hlfir.declare %[[I_LB_MAP]]
44+
! DEVICE: %[[I_LB:.*]] = fir.load %[[I_LB_DECL]]#1 : !fir.ref<index>
45+
46+
! DEVICE: %[[I_UB_DECL:.*]]:2 = hlfir.declare %[[I_UB_MAP]]
47+
! DEVICE: %[[I_UB:.*]] = fir.load %[[I_UB_DECL]]#1 : !fir.ref<index>
48+
49+
! DEVICE: %[[I_ST_DECL:.*]]:2 = hlfir.declare %[[I_ST_MAP]]
50+
! DEVICE: %[[I_ST:.*]] = fir.load %[[I_ST_DECL]]#1 : !fir.ref<index>
51+
52+
! DEVICE: %[[J_LB_DECL:.*]]:2 = hlfir.declare %[[J_LB_MAP]]
53+
! DEVICE: %[[J_LB:.*]] = fir.load %[[J_LB_DECL]]#1 : !fir.ref<index>
54+
55+
! DEVICE: %[[J_UB_DECL:.*]]:2 = hlfir.declare %[[J_UB_MAP]]
56+
! DEVICE: %[[J_UB:.*]] = fir.load %[[J_UB_DECL]]#1 : !fir.ref<index>
57+
58+
! DEVICE: %[[J_ST_DECL:.*]]:2 = hlfir.declare %[[J_ST_MAP]]
59+
! DEVICE: %[[J_ST:.*]] = fir.load %[[J_ST_DECL]]#1 : !fir.ref<index>
60+
61+
! DEVICE: omp.loop_nest ({{.*}}, {{.*}}) : index = (%[[I_LB]], %[[J_LB]]) to
62+
! DEVICE-SAME: (%[[I_UB]], %[[J_UB]]) inclusive step
63+
! DEVICE-SAME: (%[[I_ST]], %[[J_ST]])

flang/test/Transforms/DoConcurrent/locally_destroyed_temp.f90

Lines changed: 28 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,14 @@
1+
! Fails until we update the pass to use the `fir.do_concurrent` op.
2+
13
! Tests that "loop-local values" are properly handled by localizing them to the
24
! body of the loop nest. See `collectLoopLocalValues` and `localizeLoopLocalValue`
35
! for a definition of "loop-local values" and how they are handled.
46

57
! RUN: %flang_fc1 -emit-hlfir -fopenmp -fdo-concurrent-to-openmp=host %s -o - \
6-
! RUN: | FileCheck %s
8+
! RUN: | FileCheck %s --check-prefixes=COMMON
9+
10+
! RUN: %flang_fc1 -emit-hlfir -fopenmp -fdo-concurrent-to-openmp=device %s -o - \
11+
! RUN: | FileCheck %s --check-prefixes=COMMON,DEVICE
712
module struct_mod
813
type test_struct
914
integer, allocatable :: x_
@@ -46,17 +51,25 @@ program main
4651
print *, "total =", total
4752
end program main
4853

49-
! CHECK: omp.parallel {
50-
! CHECK: %[[LOCAL_TEMP:.*]] = fir.alloca !fir.type<_QMstruct_modTtest_struct{x_:!fir.box<!fir.heap<i32>>}> {bindc_name = ".result"}
51-
! CHECK: omp.wsloop {
52-
! CHECK: omp.loop_nest {{.*}} {
53-
! CHECK: %[[TEMP_VAL:.*]] = fir.call @_QMstruct_modPconstruct_from_components
54-
! CHECK: fir.save_result %[[TEMP_VAL]] to %[[LOCAL_TEMP]]
55-
! CHECK: %[[EMBOXED_LOCAL:.*]] = fir.embox %[[LOCAL_TEMP]]
56-
! CHECK: %[[CONVERTED_LOCAL:.*]] = fir.convert %[[EMBOXED_LOCAL]]
57-
! CHECK: fir.call @_FortranADestroy(%[[CONVERTED_LOCAL]])
58-
! CHECK: omp.yield
59-
! CHECK: }
60-
! CHECK: }
61-
! CHECK: omp.terminator
62-
! CHECK: }
54+
! DEVICE: omp.target {{.*}} {
55+
! DEVICE: omp.teams {
56+
! COMMON: omp.parallel {
57+
! COMMON: %[[LOCAL_TEMP:.*]] = fir.alloca !fir.type<_QMstruct_modTtest_struct{x_:!fir.box<!fir.heap<i32>>}> {bindc_name = ".result"}
58+
! DEVICE: omp.distribute {
59+
! COMMON: omp.wsloop {
60+
! COMMON: omp.loop_nest {{.*}} {
61+
! COMMON: %[[TEMP_VAL:.*]] = fir.call @_QMstruct_modPconstruct_from_components
62+
! COMMON: fir.save_result %[[TEMP_VAL]] to %[[LOCAL_TEMP]]
63+
! COMMON: %[[EMBOXED_LOCAL:.*]] = fir.embox %[[LOCAL_TEMP]]
64+
! COMMON: %[[CONVERTED_LOCAL:.*]] = fir.convert %[[EMBOXED_LOCAL]]
65+
! COMMON: fir.call @_FortranADestroy(%[[CONVERTED_LOCAL]])
66+
! COMMON: omp.yield
67+
! COMMON: }
68+
! COMMON: }
69+
! DEVICE: }
70+
! COMMON: omp.terminator
71+
! COMMON: }
72+
! DEVICE: omp.terminator
73+
! DEVICE: }
74+
! DEVICE: omp.terminator
75+
! DEVICE: }
Lines changed: 104 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,104 @@
1+
! Tests mapping of a basic `do concurrent` loop to
2+
! `!$omp target teams distribute parallel do`.
3+
! RUN: %flang_fc1 -emit-hlfir -fopenmp -fdo-concurrent-to-openmp=device %s -o - \
4+
! RUN: | FileCheck %s
5+
6+
program do_concurrent_shape
7+
implicit none
8+
integer :: a(10, 20)
9+
integer :: i, j
10+
11+
do concurrent (i=1:10, j=1:20)
12+
a(i, j) = i * j
13+
end do
14+
end program do_concurrent_shape
15+
16+
! CHECK: fir.store %{{c10.*}} to %[[DIM0_EXT:.*]] : !fir.ref<index>
17+
! CHECK: fir.store %{{c20.*}} to %[[DIM1_EXT:.*]] : !fir.ref<index>
18+
19+
! CHECK: omp.map.info
20+
! CHECK: omp.map.info
21+
! CHECK: omp.map.info
22+
23+
! CHECK: omp.map.info
24+
! CHECK: omp.map.info
25+
! CHECK: omp.map.info
26+
27+
! CHECK: omp.map.info
28+
! CHECK: omp.map.info
29+
! CHECK: omp.map.info
30+
31+
! CHECK: %[[DIM0_EXT_MAP:.*]] = omp.map.info
32+
! CHECK-SAME: var_ptr(%[[DIM0_EXT]] : !fir.ref<index>, index)
33+
! CHECK-SAME: map_clauses(implicit, exit_release_or_enter_alloc)
34+
! CHECK-SAME: capture(ByCopy) -> !fir.ref<index> {name = "_QFEa.extent.dim0"}
35+
36+
! CHECK: %[[DIM1_EXT_MAP:.*]] = omp.map.info
37+
! CHECK-SAME: var_ptr(%[[DIM1_EXT]] : !fir.ref<index>, index)
38+
! CHECK-SAME: map_clauses(implicit, exit_release_or_enter_alloc)
39+
! CHECK-SAME: capture(ByCopy) -> !fir.ref<index> {name = "_QFEa.extent.dim1"}
40+
41+
! CHECK: omp.target host_eval({{.*}}) map_entries(
42+
! CHECK-SAME: %{{[^[:space:]]+}} -> %{{[^,]+}},
43+
! CHECK-SAME: %{{[^[:space:]]+}} -> %{{[^,]+}},
44+
! CHECK-SAME: %{{[^[:space:]]+}} -> %{{[^,]+}},
45+
! CHECK-SAME: %{{[^[:space:]]+}} -> %{{[^,]+}},
46+
! CHECK-SAME: %{{[^[:space:]]+}} -> %{{[^,]+}},
47+
! CHECK-SAME: %{{[^[:space:]]+}} -> %{{[^,]+}},
48+
! CHECK-SAME: %{{[^[:space:]]+}} -> %{{[^,]+}},
49+
! CHECK-SAME: %{{[^[:space:]]+}} -> %{{[^,]+}},
50+
! CHECK-SAME: %{{[^[:space:]]+}} -> %{{[^,]+}},
51+
! CHECK-SAME: %[[DIM0_EXT_MAP]] -> %[[DIM0_EXT_ARG:[^,]+]],
52+
! CHECK-SAME: %[[DIM1_EXT_MAP]] -> %[[DIM1_EXT_ARG:[^,]+]] : {{.*}})
53+
54+
! CHECK-DAG: %[[DIM0_EXT_DEV:.*]] = fir.load %[[DIM0_EXT_ARG]]
55+
! CHECK-DAG: %[[DIM1_EXT_DEV:.*]] = fir.load %[[DIM1_EXT_ARG]]
56+
57+
! CHECK: %[[SHAPE:.*]] = fir.shape %[[DIM0_EXT_DEV]], %[[DIM1_EXT_DEV]]
58+
! CHECK: %{{.*}}:2 = hlfir.declare %{{.*}}(%[[SHAPE]]) {uniq_name = "_QFEa"}
59+
60+
subroutine do_concurrent_shape_shift
61+
implicit none
62+
integer :: a(2:10)
63+
integer :: i
64+
65+
do concurrent (i=1:10)
66+
a(i) = i
67+
end do
68+
end subroutine do_concurrent_shape_shift
69+
70+
! CHECK: fir.store %{{c2.*}} to %[[DIM0_STRT:.*]] : !fir.ref<index>
71+
! CHECK: fir.store %{{c9.*}} to %[[DIM0_EXT:.*]] : !fir.ref<index>
72+
73+
! CHECK: omp.map.info
74+
! CHECK: omp.map.info
75+
! CHECK: omp.map.info
76+
77+
! CHECK: omp.map.info
78+
! CHECK: omp.map.info
79+
80+
! CHECK: %[[DIM0_STRT_MAP:.*]] = omp.map.info
81+
! CHECK-SAME: var_ptr(%[[DIM0_STRT]] : !fir.ref<index>, index)
82+
! CHECK-SAME: map_clauses(implicit, exit_release_or_enter_alloc)
83+
! CHECK-SAME: capture(ByCopy) -> !fir.ref<index> {name = "_QF{{.*}}Ea.start_idx.dim0"}
84+
85+
! CHECK: %[[DIM0_EXT_MAP:.*]] = omp.map.info
86+
! CHECK-SAME: var_ptr(%[[DIM0_EXT]] : !fir.ref<index>, index)
87+
! CHECK-SAME: map_clauses(implicit, exit_release_or_enter_alloc)
88+
! CHECK-SAME: capture(ByCopy) -> !fir.ref<index> {name = "_QF{{.*}}Ea.extent.dim0"}
89+
90+
! CHECK: omp.target host_eval({{.*}}) map_entries(
91+
! CHECK-SAME: %{{[^[:space:]]+}} -> %{{[^,]+}},
92+
! CHECK-SAME: %{{[^[:space:]]+}} -> %{{[^,]+}},
93+
! CHECK-SAME: %{{[^[:space:]]+}} -> %{{[^,]+}},
94+
! CHECK-SAME: %{{[^[:space:]]+}} -> %{{[^,]+}},
95+
! CHECK-SAME: %{{[^[:space:]]+}} -> %{{[^,]+}},
96+
! CHECK-SAME: %[[DIM0_STRT_MAP]] -> %[[DIM0_STRT_ARG:[^,]+]],
97+
! CHECK-SAME: %[[DIM0_EXT_MAP]] -> %[[DIM0_EXT_ARG:[^,]+]] : {{.*}})
98+
99+
! CHECK-DAG: %[[DIM0_STRT_DEV:.*]] = fir.load %[[DIM0_STRT_ARG]]
100+
! CHECK-DAG: %[[DIM0_EXT_DEV:.*]] = fir.load %[[DIM0_EXT_ARG]]
101+
102+
! CHECK: %[[SHAPE_SHIFT:.*]] = fir.shape_shift %[[DIM0_STRT_DEV]], %[[DIM0_EXT_DEV]]
103+
! CHECK: %{{.*}}:2 = hlfir.declare %{{.*}}(%[[SHAPE_SHIFT]]) {uniq_name = "_QF{{.*}}Ea"}
104+
Lines changed: 65 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,14 @@
1+
! Fails until we update the pass to use the `fir.do_concurrent` op.
2+
13
! Tests mapping of a `do concurrent` loop with multiple iteration ranges.
24

35
! RUN: split-file %s %t
46

57
! RUN: %flang_fc1 -emit-hlfir -fopenmp -fdo-concurrent-to-openmp=host %t/multi_range.f90 -o - \
6-
! RUN: | FileCheck %s
8+
! RUN: | FileCheck %s --check-prefixes=HOST,COMMON
9+
10+
! RUN: %flang_fc1 -emit-hlfir -fopenmp -fdo-concurrent-to-openmp=device %t/multi_range.f90 -o - \
11+
! RUN: | FileCheck %s --check-prefixes=DEVICE,COMMON
712

813
!--- multi_range.f90
914
program main
@@ -17,56 +22,75 @@ program main
1722
end do
1823
end
1924

20-
! CHECK: func.func @_QQmain
25+
! COMMON: func.func @_QQmain
26+
27+
! COMMON: %[[C3:.*]] = arith.constant 3 : i32
28+
! COMMON: %[[LB_I:.*]] = fir.convert %[[C3]] : (i32) -> index
29+
! COMMON: %[[C20:.*]] = arith.constant 20 : i32
30+
! COMMON: %[[UB_I:.*]] = fir.convert %[[C20]] : (i32) -> index
31+
! COMMON: %[[STEP_I:.*]] = arith.constant 1 : index
32+
33+
! COMMON: %[[C5:.*]] = arith.constant 5 : i32
34+
! COMMON: %[[LB_J:.*]] = fir.convert %[[C5]] : (i32) -> index
35+
! COMMON: %[[C40:.*]] = arith.constant 40 : i32
36+
! COMMON: %[[UB_J:.*]] = fir.convert %[[C40]] : (i32) -> index
37+
! COMMON: %[[STEP_J:.*]] = arith.constant 1 : index
38+
39+
! COMMON: %[[C7:.*]] = arith.constant 7 : i32
40+
! COMMON: %[[LB_K:.*]] = fir.convert %[[C7]] : (i32) -> index
41+
! COMMON: %[[C60:.*]] = arith.constant 60 : i32
42+
! COMMON: %[[UB_K:.*]] = fir.convert %[[C60]] : (i32) -> index
43+
! COMMON: %[[STEP_K:.*]] = arith.constant 1 : index
44+
45+
! DEVICE: omp.target host_eval(
46+
! DEVICE-SAME: %[[LB_I]] -> %[[LB_I:[[:alnum:]]+]],
47+
! DEVICE-SAME: %[[UB_I]] -> %[[UB_I:[[:alnum:]]+]],
48+
! DEVICE-SAME: %[[STEP_I]] -> %[[STEP_I:[[:alnum:]]+]],
49+
! DEVICE-SAME: %[[LB_J]] -> %[[LB_J:[[:alnum:]]+]],
50+
! DEVICE-SAME: %[[UB_J]] -> %[[UB_J:[[:alnum:]]+]],
51+
! DEVICE-SAME: %[[STEP_J]] -> %[[STEP_J:[[:alnum:]]+]],
52+
! DEVICE-SAME: %[[LB_K]] -> %[[LB_K:[[:alnum:]]+]],
53+
! DEVICE-SAME: %[[UB_K]] -> %[[UB_K:[[:alnum:]]+]],
54+
! DEVICE-SAME: %[[STEP_K]] -> %[[STEP_K:[[:alnum:]]+]] :
55+
! DEVICE-SAME: index, index, index, index, index, index, index, index, index)
2156

22-
! CHECK: %[[C3:.*]] = arith.constant 3 : i32
23-
! CHECK: %[[LB_I:.*]] = fir.convert %[[C3]] : (i32) -> index
24-
! CHECK: %[[C20:.*]] = arith.constant 20 : i32
25-
! CHECK: %[[UB_I:.*]] = fir.convert %[[C20]] : (i32) -> index
26-
! CHECK: %[[STEP_I:.*]] = arith.constant 1 : index
57+
! DEVICE: omp.teams
2758

28-
! CHECK: %[[C5:.*]] = arith.constant 5 : i32
29-
! CHECK: %[[LB_J:.*]] = fir.convert %[[C5]] : (i32) -> index
30-
! CHECK: %[[C40:.*]] = arith.constant 40 : i32
31-
! CHECK: %[[UB_J:.*]] = fir.convert %[[C40]] : (i32) -> index
32-
! CHECK: %[[STEP_J:.*]] = arith.constant 1 : index
59+
! HOST-NOT: omp.target
60+
! HOST-NOT: omp.teams
3361

34-
! CHECK: %[[C7:.*]] = arith.constant 7 : i32
35-
! CHECK: %[[LB_K:.*]] = fir.convert %[[C7]] : (i32) -> index
36-
! CHECK: %[[C60:.*]] = arith.constant 60 : i32
37-
! CHECK: %[[UB_K:.*]] = fir.convert %[[C60]] : (i32) -> index
38-
! CHECK: %[[STEP_K:.*]] = arith.constant 1 : index
62+
! COMMON: omp.parallel {
3963

40-
! CHECK: omp.parallel {
64+
! COMMON-NEXT: %[[ITER_VAR_I:.*]] = fir.alloca i32 {bindc_name = "i"}
65+
! COMMON-NEXT: %[[BINDING_I:.*]]:2 = hlfir.declare %[[ITER_VAR_I]] {uniq_name = "_QFEi"}
4166

42-
! CHECK-NEXT: %[[ITER_VAR_I:.*]] = fir.alloca i32 {bindc_name = "i"}
43-
! CHECK-NEXT: %[[BINDING_I:.*]]:2 = hlfir.declare %[[ITER_VAR_I]] {uniq_name = "_QFEi"}
67+
! COMMON-NEXT: %[[ITER_VAR_J:.*]] = fir.alloca i32 {bindc_name = "j"}
68+
! COMMON-NEXT: %[[BINDING_J:.*]]:2 = hlfir.declare %[[ITER_VAR_J]] {uniq_name = "_QFEj"}
4469

45-
! CHECK-NEXT: %[[ITER_VAR_J:.*]] = fir.alloca i32 {bindc_name = "j"}
46-
! CHECK-NEXT: %[[BINDING_J:.*]]:2 = hlfir.declare %[[ITER_VAR_J]] {uniq_name = "_QFEj"}
70+
! COMMON-NEXT: %[[ITER_VAR_K:.*]] = fir.alloca i32 {bindc_name = "k"}
71+
! COMMON-NEXT: %[[BINDING_K:.*]]:2 = hlfir.declare %[[ITER_VAR_K]] {uniq_name = "_QFEk"}
4772

48-
! CHECK-NEXT: %[[ITER_VAR_K:.*]] = fir.alloca i32 {bindc_name = "k"}
49-
! CHECK-NEXT: %[[BINDING_K:.*]]:2 = hlfir.declare %[[ITER_VAR_K]] {uniq_name = "_QFEk"}
73+
! DEVICE: omp.distribute
5074

51-
! CHECK: omp.wsloop {
52-
! CHECK-NEXT: omp.loop_nest
53-
! CHECK-SAME: (%[[ARG0:[^[:space:]]+]], %[[ARG1:[^[:space:]]+]], %[[ARG2:[^[:space:]]+]])
54-
! CHECK-SAME: : index = (%[[LB_I]], %[[LB_J]], %[[LB_K]])
55-
! CHECK-SAME: to (%[[UB_I]], %[[UB_J]], %[[UB_K]]) inclusive
56-
! CHECK-SAME: step (%[[STEP_I]], %[[STEP_J]], %[[STEP_K]]) {
75+
! COMMON: omp.wsloop {
76+
! COMMON-NEXT: omp.loop_nest
77+
! COMMON-SAME: (%[[ARG0:[^[:space:]]+]], %[[ARG1:[^[:space:]]+]], %[[ARG2:[^[:space:]]+]])
78+
! COMMON-SAME: : index = (%[[LB_I]], %[[LB_J]], %[[LB_K]])
79+
! COMMON-SAME: to (%[[UB_I]], %[[UB_J]], %[[UB_K]]) inclusive
80+
! COMMON-SAME: step (%[[STEP_I]], %[[STEP_J]], %[[STEP_K]]) {
5781

58-
! CHECK-NEXT: %[[IV_IDX_I:.*]] = fir.convert %[[ARG0]]
59-
! CHECK-NEXT: fir.store %[[IV_IDX_I]] to %[[BINDING_I]]#0
82+
! COMMON-NEXT: %[[IV_IDX_I:.*]] = fir.convert %[[ARG0]]
83+
! COMMON-NEXT: fir.store %[[IV_IDX_I]] to %[[BINDING_I]]#0
6084

61-
! CHECK-NEXT: %[[IV_IDX_J:.*]] = fir.convert %[[ARG1]]
62-
! CHECK-NEXT: fir.store %[[IV_IDX_J]] to %[[BINDING_J]]#0
85+
! COMMON-NEXT: %[[IV_IDX_J:.*]] = fir.convert %[[ARG1]]
86+
! COMMON-NEXT: fir.store %[[IV_IDX_J]] to %[[BINDING_J]]#0
6387

64-
! CHECK-NEXT: %[[IV_IDX_K:.*]] = fir.convert %[[ARG2]]
65-
! CHECK-NEXT: fir.store %[[IV_IDX_K]] to %[[BINDING_K]]#0
88+
! COMMON-NEXT: %[[IV_IDX_K:.*]] = fir.convert %[[ARG2]]
89+
! COMMON-NEXT: fir.store %[[IV_IDX_K]] to %[[BINDING_K]]#0
6690

67-
! CHECK: omp.yield
68-
! CHECK-NEXT: }
69-
! CHECK-NEXT: }
91+
! COMMON: omp.yield
92+
! COMMON-NEXT: }
93+
! COMMON-NEXT: }
7094

71-
! CHECK-NEXT: omp.terminator
72-
! CHECK-NEXT: }
95+
! HOST-NEXT: omp.terminator
96+
! HOST-NEXT: }

0 commit comments

Comments
 (0)