[all-commits] [llvm/llvm-project] f0fe3b: [flang] Let a directive keep the loop it owns when...
Kareem Ergawy via All-commits
all-commits at lists.llvm.org
Thu Oct 1 00:43:38 PDT 2026
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: f0fe3b560a7935fe2625f02a3bd52c67f048dcc0
https://github.com/llvm/llvm-project/commit/f0fe3b560a7935fe2625f02a3bd52c67f048dcc0
Author: Kareem Ergawy <kergawy at nvidia.com>
Date: 2026-10-01 (Thu, 01 Oct 2026)
Changed paths:
M flang/lib/Lower/Bridge.cpp
M flang/lib/Lower/PFTBuilder.cpp
M flang/test/Lower/OpenACC/Todo/acc-unstructured-combined-construct.f90
M flang/test/Lower/OpenACC/Todo/acc-unstructured-loop-construct.f90
A flang/test/Lower/OpenACC/acc-collapse-force-unstructured-body.f90
A flang/test/Lower/OpenACC/acc-directive-loop-bounds.f90
A flang/test/Lower/OpenACC/acc-unstructured-combined-construct.f90
M flang/test/Lower/OpenACC/acc-unstructured-internals.f90
A flang/test/Lower/OpenACC/acc-unstructured-loop-construct.f90
M flang/test/Lower/OpenACC/acc-unstructured.f90
A flang/test/Lower/OpenMP/wsloop-directive-loop-bounds.f90
Log Message:
-----------
[flang] Let a directive keep the loop it owns when its body branches (#227707)
A loop whose branching is confined to its body keeps its structured
form, but the construct holding it stayed Unstructured. A directive does
not merely contain such a loop, it owns it, and its lowering reads the
construct's own classification to decide whether the loop op carries its
bounds. The directive was left with a bounds-free loop that nothing
could partition, and the loop it owns became a second one nested inside.
Reclassify a directive construct once the loops it holds no longer need
it to stay Unstructured. Children are visited first, so those loops have
already been reclassified by the time the construct is reached. A
construct whose branching leaves it is untouched, as is one holding a
branch of its own.
Taking a loop over also means genFIR(DoConstruct) -- where a plain loop
folds a body whose branching stays inside it into a region -- never runs
for that loop, so fold its body through the same helper. A construct
that takes over no loop, acc data or acc parallel without a loop
directive, keeps having its own evaluations lowered.
The cases this enables move out of the Todo tests, which asserted the
lowering was not yet implemented. The one whose EXIT leaves the loop
stays there.
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