[all-commits] [llvm/llvm-project] c7ea79: [mlir][flang][openmp] Rework parallel reduction op...
David Truby via All-commits
all-commits at lists.llvm.org
Fri Jan 26 06:11:00 PST 2024
Branch: refs/heads/users/davidtruby/reduction
Home: https://github.com/llvm/llvm-project
Commit: c7ea791524de2998f4581620a57ae5c7ec95f079
https://github.com/llvm/llvm-project/commit/c7ea791524de2998f4581620a57ae5c7ec95f079
Author: David Truby <david at truby.dev>
Date: 2024-01-26 (Fri, 26 Jan 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
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
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.
More information about the All-commits
mailing list