[all-commits] [llvm/llvm-project] 9f5597: [OpenMP] Honor barrier and last iteration flags in...
Nicole Aschenbrenner via All-commits
all-commits at lists.llvm.org
Wed Sep 16 07:44:42 PDT 2026
Branch: refs/heads/users/nicebert/flang-openmp-loop-lowering-flags
Home: https://github.com/llvm/llvm-project
Commit: 9f5597247638429a44c1ac393c87f1e74844b9eb
https://github.com/llvm/llvm-project/commit/9f5597247638429a44c1ac393c87f1e74844b9eb
Author: Nicole Aschenbrenner <nicole.aschenbrenner at amd.com>
Date: 2026-09-16 (Wed, 16 Sep 2026)
Changed paths:
M flang/lib/Lower/OpenMP/DataSharingProcessor.cpp
A flang/test/Integration/OpenMP/privatization-barrier.f90
M flang/test/Lower/OpenMP/taskloop.f90
M llvm/include/llvm/Frontend/OpenMP/OMPIRBuilder.h
M llvm/lib/Frontend/OpenMP/OMPIRBuilder.cpp
M mlir/lib/Target/LLVMIR/Dialect/OpenMP/OpenMPToLLVMIRTranslation.cpp
M mlir/test/Target/LLVMIR/omptarget-wsloop.mlir
Log Message:
-----------
[OpenMP] Honor barrier and last iteration flags in loop lowering
Emitting loop-free kernels for no-loop target regions in Clang requires
the shared OpenMP lowering to honor flags that reach it today and are
then discarded.
applyWorkshareLoop takes a NeedsBarrier flag, but the device path drops
it, so a worksharing loop without nowait emits no barrier at its exit.
The device path also never sets the canonical loop's last iteration
variable, which the linear clause finalization reads. Forward the flag
to applyWorkshareLoopTarget and compute the last iteration in the loop
body, mirroring how the host runtime reports it.
Auditing the surrounding lowering for the same class of problem turned
up one more. The barrier that follows privatization is emitted as part
of the firstprivate copy region, so a construct with lastprivate and no
firstprivate never gets one. Emit it independently of the copy region.
Flang skips it for taskloop, where the write-back already happens after
the reads.
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