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

David Truby via All-commits all-commits at lists.llvm.org
Tue Feb 13 11:14:05 PST 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: be9f8ffd8141f7cadf04b1bef5dfc65a7b8a7fd7
      https://github.com/llvm/llvm-project/commit/be9f8ffd8141f7cadf04b1bef5dfc65a7b8a7fd7
  Author: David Truby <david.truby at arm.com>
  Date:   2024-02-13 (Tue, 13 Feb 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/Conversion/SCFToOpenMP/SCFToOpenMP.cpp
    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/Conversion/SCFToOpenMP/reductions.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 (#80019)

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.

---------

Co-authored-by: Kiran Chandramohan <kiran.chandramohan at arm.com>




More information about the All-commits mailing list