This patch enables tiling in flang. In MLIR tiling is handled by changing the the omp.loop_nest op to be able to represent both collapse and tiling, so the flang front-end will combine the nested constructs into a single MLIR op. The MLIR->LLVM-IR lowering of the LoopNestOp is enhanced to first do the tiling if present, then collapse.
41 lines
873 B
Fortran
41 lines
873 B
Fortran
!RUN: %python %S/../test_errors.py %s %flang -fopenmp
|
|
|
|
integer :: i, j
|
|
! ERROR: DO CONCURRENT loops cannot be used with the COLLAPSE clause.
|
|
!$omp parallel do collapse(2)
|
|
do i = 1, 1
|
|
! ERROR: DO CONCURRENT loops cannot form part of a loop nest.
|
|
do concurrent (j = 1:2)
|
|
print *, j
|
|
end do
|
|
end do
|
|
|
|
!$omp parallel do
|
|
do i = 1, 1
|
|
! This should not lead to an error because it is not part of a loop nest:
|
|
do concurrent (j = 1:2)
|
|
print *, j
|
|
end do
|
|
end do
|
|
|
|
!$omp parallel do
|
|
! ERROR: DO CONCURRENT loops cannot form part of a loop nest.
|
|
do concurrent (j = 1:2)
|
|
print *, j
|
|
end do
|
|
|
|
!$omp loop
|
|
! Do concurrent is explicitly allowed inside of omp loop
|
|
do concurrent (j = 1:2)
|
|
print *, j
|
|
end do
|
|
|
|
! ERROR: DO CONCURRENT loops cannot be used with the COLLAPSE clause.
|
|
!$omp loop collapse(2)
|
|
do i = 1, 1
|
|
do concurrent (j = 1:2)
|
|
print *, j
|
|
end do
|
|
end do
|
|
end
|