[all-commits] [llvm/llvm-project] 9ecf4d: [mlir][flang][openmp] Rework parallel reduction op...
David Truby via All-commits
all-commits at lists.llvm.org
Mon Feb 12 09:20:02 PST 2024
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: 9ecf4d20bbfabdcd11c9058363903f975a652e7b
https://github.com/llvm/llvm-project/commit/9ecf4d20bbfabdcd11c9058363903f975a652e7b
Author: David Truby <david.truby at arm.com>
Date: 2024-02-12 (Mon, 12 Feb 2024)
Changed paths:
M flang/lib/Lower/OpenMP.cpp
M flang/test/Lower/OpenMP/FIR/parallel-reduction-add.f90
M flang/test/Lower/OpenMP/parallel-reduction-add.f90
A flang/test/Lower/OpenMP/parallel-reduction.f90
M mlir/include/mlir/Dialect/OpenMP/OpenMPOps.td
M mlir/lib/Dialect/OpenMP/IR/OpenMPDialect.cpp
M mlir/lib/Target/LLVMIR/Dialect/OpenMP/OpenMPToLLVMIRTranslation.cpp
M mlir/test/Dialect/OpenMP/ops.mlir
M mlir/test/Target/LLVMIR/openmp-reduction.mlir
Log Message:
-----------
[mlir][flang][openmp] Rework parallel reduction operations (#79308)
This patch reworks the way that parallel reduction operations function
to better match the expected semantics from the OpenMP specification.
Previously specific omp.reduction operations were used inside the
region, meaning that the reduction only applied when the correct
operation was used, whereas the specification states that any change to
the variable inside the region should be taken into account for the
reduction.
The new semantics create a private reduction variable as a block
argument which should be used normally for all operations on that
variable in the region; this private variable is then combined with the
others into the shared variable. This way no special omp.reduction
operations are needed inside the region.
This patch only makes the change for the `parallel` operation, the
change for the `wsloop` operation will be in a separate patch.
---------
Co-authored-by: Kiran Chandramohan <kiran.chandramohan at arm.com>
More information about the All-commits
mailing list