llvm-project/flang/test/Lower/OpenMP/nested-loop-transformation-construct01.f90
Michael Kruse b487f9a7bd
[Flang] Implement !$omp unroll using omp.unroll_heuristic (#144785)
Add support for `!$omp unroll` in Flang and basic MLIR
`omp.canonical_loop` modeling.

First step to add `omp.canonical_loop` modeling to the MLIR OpenMP
dialect with the goal of being more general than the current
`omp.loop_nest` approach:
 * Support for non-perfectly nested loops
 * Support for non-rectangular loops
 * Support for arbitrary compositions of loop transformations

This patch is functional end-to-end and adds support for `!$omp unroll`
to Flang. `!$omp unroll` is lowered to `omp.new_cli`,
`omp.canonical_loop`, and `omp.unroll_heuristic` in MLIR, which are
lowered to LLVM-IR using the OpenMPIRBuilder
(https://reviews.llvm.org/D107764).
2025-07-22 11:39:01 +02:00

21 lines
473 B
Fortran

! Test to ensure TODO message is emitted for tile OpenMP 5.1 Directives when they are nested.
!RUN: not %flang_fc1 -emit-hlfir -fopenmp -fopenmp-version=51 -o - %s 2>&1 | FileCheck %s
subroutine loop_transformation_construct
implicit none
integer :: I = 10
integer :: x
integer :: y(I)
!$omp do
!$omp tile
do i = 1, I
y(i) = y(i) * 5
end do
!$omp end tile
!$omp end do
end subroutine
!CHECK: not yet implemented: Unhandled loop directive (tile)