brintos

brintos / llvm-project-archived public Read only

0
0
Text · 2.2 KiB · d0316d1 Raw
79 lines · plain
1! This test checks lowering of OpenMP DISTRIBUTE SIMD composite constructs.2 3! RUN: bbc -fopenmp -emit-hlfir %s -o - | FileCheck %s4! RUN: %flang_fc1 -fopenmp -emit-hlfir %s -o - | FileCheck %s5 6! CHECK-LABEL: func.func @_QPdistribute_simd_aligned(7subroutine distribute_simd_aligned(A)8  use iso_c_binding9  type(c_ptr) :: A10 11  !$omp teams12 13  ! CHECK:      omp.distribute14  ! CHECK-NOT:  aligned({{.*}})15  ! CHECK-SAME: {16  ! CHECK-NEXT: omp.simd17  ! CHECK-SAME: aligned({{.*}})18  !$omp distribute simd aligned(A:256)19  do index_ = 1, 1020    call c_test_call(A)21  end do22  !$omp end distribute simd23 24  !$omp end teams25end subroutine distribute_simd_aligned26 27! CHECK-LABEL: func.func @_QPdistribute_simd_safelen(28subroutine distribute_simd_safelen()29  !$omp teams30 31  ! CHECK:      omp.distribute32  ! CHECK-NOT:  safelen({{.*}})33  ! CHECK-SAME: {34  ! CHECK-NEXT: omp.simd35  ! CHECK-SAME: safelen({{.*}})36  !$omp distribute simd safelen(4)37  do index_ = 1, 1038  end do39  !$omp end distribute simd40 41  !$omp end teams42end subroutine distribute_simd_safelen43 44! CHECK-LABEL: func.func @_QPdistribute_simd_simdlen(45subroutine distribute_simd_simdlen()46  !$omp teams47 48  ! CHECK:      omp.distribute49  ! CHECK-NOT:  simdlen({{.*}})50  ! CHECK-SAME: {51  ! CHECK-NEXT: omp.simd52  ! CHECK-SAME: simdlen({{.*}})53  !$omp distribute simd simdlen(4)54  do index_ = 1, 1055  end do56  !$omp end distribute simd57 58  !$omp end teams59end subroutine distribute_simd_simdlen60 61! CHECK-LABEL: func.func @_QPdistribute_simd_private(62subroutine distribute_simd_private()63  integer, allocatable :: tmp64  ! CHECK:      omp.teams65  !$omp teams66  ! CHECK:      omp.distribute67  ! CHECK:      omp.simd68  ! CHECK-SAME: private(@[[PRIV_BOX_SYM:.*]] %{{.*}} -> %[[PRIV_BOX:.*]], @[[PRIV_IVAR_SYM:.*]] %{{.*}} -> %[[PRIV_IVAR:.*]] : !fir.ref<!fir.box<!fir.heap<i32>>>, !fir.ref<i32>)69  ! CHECK-NEXT: omp.loop_nest (%[[IVAR:.*]]) : i3270  !$omp distribute simd private(tmp)71  do index_ = 1, 1072  ! CHECK:      %[[PRIV_BOX_DECL:.*]]:2 = hlfir.declare %[[PRIV_BOX]]73  ! CHECK:      %[[PRIV_IVAR_DECL:.*]]:2 = hlfir.declare %[[PRIV_IVAR]]74  ! CHECK:      hlfir.assign %[[IVAR]] to %[[PRIV_IVAR_DECL]]#075  end do76  !$omp end distribute simd77  !$omp end teams78end subroutine distribute_simd_private79