[all-commits] [llvm/llvm-project] 9e6aa2: [mlir][flang][openmp] Rework parallel reduction op...

Kiran Chandramohan via All-commits all-commits at lists.llvm.org
Mon Feb 12 08:41:43 PST 2024


  Branch: refs/heads/users/davidtruby/reduction
  Home:   https://github.com/llvm/llvm-project
  Commit: 9e6aa2ff97d9a917b44c3bdb28a05f5e58a6964e
      https://github.com/llvm/llvm-project/commit/9e6aa2ff97d9a917b44c3bdb28a05f5e58a6964e
  Author: David Truby <david at truby.dev>
  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
    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.


  Commit: c84f5259490ef697d2f0271af7d62dd888b2c094
      https://github.com/llvm/llvm-project/commit/c84f5259490ef697d2f0271af7d62dd888b2c094
  Author: Kiran Chandramohan <kiran.chandramohan at arm.com>
  Date:   2024-02-12 (Mon, 12 Feb 2024)

  Changed paths:
    A flang/test/Lower/OpenMP/parallel-reduction.f90

  Log Message:
  -----------
  [Flang][OpenMP] Add new test to demonstrate reduction


Compare: https://github.com/llvm/llvm-project/compare/1ed4bc39de92...c84f5259490e


More information about the All-commits mailing list