[all-commits] [llvm/llvm-project] ec1f5e: [flang][OpenMP] Sink intervening code unguarded in...
Caroline Newcombe via All-commits
all-commits at lists.llvm.org
Thu Oct 1 04:43:27 PDT 2026
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: ec1f5ecb04250392ed48388621050d7cdcc5f3f3
https://github.com/llvm/llvm-project/commit/ec1f5ecb04250392ed48388621050d7cdcc5f3f3
Author: Caroline Newcombe <caroline.newcombe at hpe.com>
Date: 2026-10-01 (Thu, 01 Oct 2026)
Changed paths:
M flang/docs/OpenMPSupport.md
M flang/lib/Lower/OpenMP/OpenMP.cpp
M flang/test/Lower/OpenMP/collapse-imperfect-nest.f90
R flang/test/Lower/OpenMP/collapse-target-intervening-todo.f90
A offload/test/offloading/fortran/target-teams-distribute-collapse-intervening.f90
Log Message:
-----------
[flang][OpenMP] Sink intervening code unguarded into collapsed loop body (#225159)
### Summary
Lower intervening code in a collapsed imperfect loop nest by sinking it
unguarded into the innermost `omp.loop_nest` body, so it executes once
per collapsed logical iteration. Per OpenMP 6.0 6.4.3.
An earlier implementation of this work guarded intervening code so that
it ran once per enclosing iteration. That required recomputing the inner
loop's bounds inside the region — and in a `target` region, either
accessing or re-evaluating
the enclosing `omp.target`'s `host_eval` bounds (#223475) — which
overcomplicates the solution and is not required by the spec. Sinking
the intervening code removes all bound arithmetic from the region, while
the execution count remains within the permitted range.
### Notes
Fixes #199092
Assisted-by: Copilot
To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications
More information about the All-commits
mailing list