[all-commits] [llvm/llvm-project] 78d3a7: [mlir][flang][openmp] Rework wsloop reduction oper...

David Truby via All-commits all-commits at lists.llvm.org
Tue Jan 30 07:10:29 PST 2024


  Branch: refs/heads/users/davidtruby/wsreduction
  Home:   https://github.com/llvm/llvm-project
  Commit: 78d3a7fcbf42bda54342403b762642a8a580e00f
      https://github.com/llvm/llvm-project/commit/78d3a7fcbf42bda54342403b762642a8a580e00f
  Author: David Truby <david at truby.dev>
  Date:   2024-01-30 (Tue, 30 Jan 2024)

  Changed paths:
    M flang/lib/Lower/OpenMP.cpp
    M flang/test/Fir/convert-to-llvm-openmp-and-fir.fir
    M flang/test/Lower/OpenMP/FIR/wsloop-reduction-add.f90
    M flang/test/Lower/OpenMP/FIR/wsloop-reduction-iand.f90
    M flang/test/Lower/OpenMP/FIR/wsloop-reduction-ieor.f90
    M flang/test/Lower/OpenMP/FIR/wsloop-reduction-ior.f90
    R flang/test/Lower/OpenMP/FIR/wsloop-reduction-logical-and.f90
    M flang/test/Lower/OpenMP/FIR/wsloop-reduction-logical-eqv.f90
    M flang/test/Lower/OpenMP/FIR/wsloop-reduction-logical-neqv.f90
    R flang/test/Lower/OpenMP/FIR/wsloop-reduction-logical-or.f90
    M flang/test/Lower/OpenMP/FIR/wsloop-reduction-max.f90
    M flang/test/Lower/OpenMP/FIR/wsloop-reduction-min.f90
    R flang/test/Lower/OpenMP/FIR/wsloop-reduction-mul.f90
    M flang/test/Lower/OpenMP/default-clause.f90
    M flang/test/Lower/OpenMP/wsloop-reduction-add-hlfir.f90
    M flang/test/Lower/OpenMP/wsloop-reduction-add.f90
    M flang/test/Lower/OpenMP/wsloop-reduction-iand.f90
    M flang/test/Lower/OpenMP/wsloop-reduction-ieor.f90
    M flang/test/Lower/OpenMP/wsloop-reduction-ior.f90
    M flang/test/Lower/OpenMP/wsloop-reduction-logical-and.f90
    M flang/test/Lower/OpenMP/wsloop-reduction-logical-eqv.f90
    M flang/test/Lower/OpenMP/wsloop-reduction-logical-neqv.f90
    M flang/test/Lower/OpenMP/wsloop-reduction-logical-or.f90
    M flang/test/Lower/OpenMP/wsloop-reduction-max-2.f90
    M flang/test/Lower/OpenMP/wsloop-reduction-max-hlfir.f90
    M flang/test/Lower/OpenMP/wsloop-reduction-max.f90
    M flang/test/Lower/OpenMP/wsloop-reduction-min.f90
    M flang/test/Lower/OpenMP/wsloop-reduction-mul.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/Conversion/OpenMPToLLVM/convert-to-llvmir.mlir
    M mlir/test/Dialect/OpenMP/invalid.mlir
    M mlir/test/Dialect/OpenMP/ops.mlir
    M mlir/test/Target/LLVMIR/openmp-reduction.mlir

  Log Message:
  -----------
  [mlir][flang][openmp] Rework wsloop reduction operations

This patch reworks the way that wsloop reduction operations function to better
match the expected semantics from the OpenMP specification, following the rework
of parallel reductions.

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. These
block arguments follow the loop control block arguments.




More information about the All-commits mailing list