This patch simplifies the representation of OpenMP loop wrapper operations by introducing the `NoTerminator` trait and updating accordingly the verifier for the `LoopWrapperInterface`. Since loop wrappers are already limited to having exactly one region containing exactly one block, and this block can only hold a single `omp.loop_nest` or loop wrapper and an `omp.terminator` that does not return any values, it makes sense to simplify the representation of loop wrappers by removing the terminator. There is an extensive list of Lit tests that needed updating to remove the `omp.terminator`s adding some noise to this patch, but actual changes are limited to the definition of the `omp.wsloop`, `omp.simd`, `omp.distribute` and `omp.taskloop` loop wrapper ops, Flang lowering for those, `LoopWrapperInterface::verifyImpl()`, SCF to OpenMP conversion and OpenMP dialect documentation.
37 lines
1.2 KiB
Fortran
37 lines
1.2 KiB
Fortran
! This test checks lowering of OpenMP DO Directive(Worksharing) with
|
|
! simd schedule modifier.
|
|
|
|
! RUN: bbc -fopenmp -emit-hlfir %s -o - | FileCheck %s
|
|
|
|
program wsloop_dynamic
|
|
integer :: i
|
|
!CHECK-LABEL: func @_QQmain()
|
|
|
|
!$OMP PARALLEL
|
|
!CHECK: omp.parallel {
|
|
|
|
!$OMP DO SCHEDULE(simd: runtime)
|
|
!CHECK: %[[WS_LB:.*]] = arith.constant 1 : i32
|
|
!CHECK: %[[WS_UB:.*]] = arith.constant 9 : i32
|
|
!CHECK: %[[WS_STEP:.*]] = arith.constant 1 : i32
|
|
!CHECK: omp.wsloop nowait schedule(runtime, simd) {
|
|
!CHECK-NEXT: omp.loop_nest (%[[I:.*]]) : i32 = (%[[WS_LB]]) to (%[[WS_UB]]) inclusive step (%[[WS_STEP]]) {
|
|
!CHECK: fir.store %[[I]] to %[[STORE:.*]]#1 : !fir.ref<i32>
|
|
|
|
do i=1, 9
|
|
print*, i
|
|
!CHECK: %[[RTBEGIN:.*]] = fir.call @_FortranAioBeginExternalListOutput
|
|
!CHECK: %[[LOAD:.*]] = fir.load %[[STORE]]#0 : !fir.ref<i32>
|
|
!CHECK: fir.call @_FortranAioOutputInteger32(%[[RTBEGIN]], %[[LOAD]]) {{.*}}: (!fir.ref<i8>, i32) -> i1
|
|
!CHECK: fir.call @_FortranAioEndIoStatement(%[[RTBEGIN]]) {{.*}}: (!fir.ref<i8>) -> i32
|
|
end do
|
|
!CHECK: omp.yield
|
|
!CHECK: }
|
|
!CHECK: }
|
|
!CHECK: omp.terminator
|
|
!CHECK: }
|
|
|
|
!$OMP END DO NOWAIT
|
|
!$OMP END PARALLEL
|
|
end
|