Changeset View
Changeset View
Standalone View
Standalone View
flang/test/Lower/OpenMP/simd.f90
Show First 20 Lines • Show All 83 Lines • ▼ Show 20 Lines | integer, parameter :: simdlen = 2; | ||||
do i = 1, n | do i = 1, n | ||||
! CHECK: fir.store %[[I]] to %[[LOCAL:.*]] : !fir.ref<i32> | ! CHECK: fir.store %[[I]] to %[[LOCAL:.*]] : !fir.ref<i32> | ||||
! CHECK: %[[LD:.*]] = fir.load %[[LOCAL]] : !fir.ref<i32> | ! CHECK: %[[LD:.*]] = fir.load %[[LOCAL]] : !fir.ref<i32> | ||||
! CHECK: fir.call @_FortranAioOutputInteger32({{.*}}, %[[LD]]) : (!fir.ref<i8>, i32) -> i1 | ! CHECK: fir.call @_FortranAioOutputInteger32({{.*}}, %[[LD]]) : (!fir.ref<i8>, i32) -> i1 | ||||
print*, i | print*, i | ||||
end do | end do | ||||
!$OMP END SIMD | !$OMP END SIMD | ||||
end subroutine | end subroutine | ||||
!CHECK-LABEL: func @_QPsimdloop_with_collapse_clause | |||||
!CHECK: %[[VAL_0:.*]] = fir.alloca i32 {adapt.valuebyref} | |||||
!CHECK: %[[VAL_1:.*]] = fir.alloca i32 {adapt.valuebyref} | |||||
!CHECK: %[[LOWER_I:.*]] = arith.constant 1 : i32 | |||||
!CHECK: %[[UPPER_I:.*]] = fir.load %[[PARAM_ARG:.*]] : !fir.ref<i32> | |||||
!CHECK: %[[STEP_I:.*]] = arith.constant 1 : i32 | |||||
!CHECK: %[[LOWER_J:.*]] = arith.constant 1 : i32 | |||||
!CHECK: %[[UPPER_J:.*]] = fir.load %[[PARAM_ARG:.*]] : !fir.ref<i32> | |||||
!CHECK: %[[STEP_J:.*]] = arith.constant 1 : i32 | |||||
! CHECK-LABEL: omp.simdloop for ( | |||||
! CHECK: %[[ARG_0:.*]], %[[ARG_1:.*]]) : i32 = ( | |||||
! CHECK: %[[LOWER_I]], | |||||
! CHECK: %[[LOWER_J]]) to ( | |||||
! CHECK: %[[UPPER_I]], | |||||
! CHECK: %[[UPPER_J]]) inclusive step ( | |||||
! CHECK: %[[STEP_I]], | |||||
! CHECK: %[[STEP_J]]) { | |||||
kiranchandramohan: All the above checks can either be with the same CHECK line or with the CHECK-SAME directive. | |||||
domadaAuthorUnsubmitted Done domada: Done | |||||
! CHECK: fir.store %[[ARG_0]] to %[[VAL_1]] : !fir.ref<i32> | |||||
! CHECK: fir.store %[[ARG_1]] to %[[VAL_0]] : !fir.ref<i32> | |||||
! CHECK: fir.call @_QPfoo(%[[VAL_1]]) : (!fir.ref<i32>) -> () | |||||
! CHECK: fir.call @_QPbar(%[[VAL_0]]) : (!fir.ref<i32>) -> () | |||||
! CHECK: omp.yield | |||||
! CHECK: } | |||||
! CHECK: return | |||||
subroutine simdloop_with_collapse_clause(n) | |||||
integer :: i, j, n | |||||
!$OMP SIMD collapse(2) | |||||
do i = 1, n | |||||
do j = 1, n | |||||
call foo(i) | |||||
peixinUnsubmitted Not Done ReplyInline ActionsThis is not one good test case for SIMD directive. Can you replace it with the one that can be vectorized? peixin: This is not one good test case for SIMD directive. Can you replace it with the one that can be… | |||||
domadaAuthorUnsubmitted Not Done ReplyInline Actions@peixin done: please look at https://reviews.llvm.org/D132023 domada: @peixin done: please look at https://reviews.llvm.org/D132023 | |||||
call bar(j) | |||||
end do | |||||
end do | |||||
!$OMP END SIMD | |||||
end subroutine |
All the above checks can either be with the same CHECK line or with the CHECK-SAME directive.