Flang cannot convert to LLVM IR the following Fortran code:
subroutine simdloop_with_nested_loop
integer :: i, j
integer :: a(10)
!$OMP SIMD
do i=1, 10
do j=1, 10
a(i) = i
end do
end do
!$OMP END SIMD
end subroutineCommand:
bin/bbc simdloop_with_nested_loop.f90 -fopenmp -emit-fir -o - | bin/tco
Fails with the error message:
loc("<stdin>":16:10): error: failed to legalize operation 'cf.br'
This patch enables compilation of the test case with SIMD directive and nested loop.
This is not expected. You should add the test in flang/test/Fir/convert-to-llvm-openmp-and-fir.fir.