1 ! This test checks lowering of OpenMP DO SIMD composite constructs.
3 ! RUN: bbc -fopenmp -emit-hlfir %s -o - | FileCheck %s
4 ! RUN: %flang_fc1 -fopenmp -emit-hlfir %s -o - | FileCheck %s
6 ! CHECK-LABEL: func.func @_QPdo_simd_aligned(
7 subroutine do_simd_aligned(A
)
12 ! CHECK-NOT: aligned({{.*}})
14 ! CHECK-NEXT: omp.simd
15 ! CHECK-SAME: aligned({{.*}})
16 !$omp do simd aligned(A:256)
21 end subroutine do_simd_aligned
23 ! CHECK-LABEL: func.func @_QPdo_simd_safelen(
24 subroutine do_simd_safelen()
26 ! CHECK-NOT: safelen({{.*}})
28 ! CHECK-NEXT: omp.simd
29 ! CHECK-SAME: safelen({{.*}})
30 !$omp do simd safelen(4)
34 end subroutine do_simd_safelen
36 ! CHECK-LABEL: func.func @_QPdo_simd_simdlen(
37 subroutine do_simd_simdlen()
39 ! CHECK-NOT: simdlen({{.*}})
41 ! CHECK-NEXT: omp.simd
42 ! CHECK-SAME: simdlen({{.*}})
43 !$omp do simd simdlen(4)
47 end subroutine do_simd_simdlen
49 ! CHECK-LABEL: func.func @_QPdo_simd_reduction(
50 subroutine do_simd_reduction()
54 ! CHECK-SAME: reduction(@[[RED_SYM:.*]] %{{.*}} -> %[[RED_OUTER:.*]] : !fir.ref<i32>)
55 ! CHECK-NEXT: omp.simd
56 ! CHECK-SAME: reduction(@[[RED_SYM]] %[[RED_OUTER]] -> %[[RED_INNER:.*]] : !fir.ref<i32>)
57 ! CHECK-NEXT: omp.loop_nest
58 ! CHECK: %[[RED_DECL:.*]]:2 = hlfir.declare %[[RED_INNER]]
59 ! CHECK: %[[RED:.*]] = fir.load %[[RED_DECL]]#0 : !fir.ref<i32>
60 ! CHECK: %[[RESULT:.*]] = arith.addi %[[RED]], %{{.*}} : i32
61 ! CHECK: hlfir.assign %[[RESULT]] to %[[RED_DECL]]#0 : i32, !fir.ref<i32>
62 ! CHECK-NEXT: omp.yield
63 !$omp do simd reduction(+:sum)
68 end subroutine do_simd_reduction