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 subroutine
Command:
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.
SectionsOp is already there. Why do you add it repeatedly?