[all-commits] [llvm/llvm-project] 3be535: [flang][do concurrent] Re-model `reduce` to match ...

Kareem Ergawy via All-commits all-commits at lists.llvm.org
Sun Jun 29 21:18:04 PDT 2025


  Branch: refs/heads/users/ergawy/convert_locality_specs_to_clauses_5
  Home:   https://github.com/llvm/llvm-project
  Commit: 3be535d7404b4659d2d0015da589a6ddc6cb5896
      https://github.com/llvm/llvm-project/commit/3be535d7404b4659d2d0015da589a6ddc6cb5896
  Author: ergawy <kareem.ergawy at amd.com>
  Date:   2025-06-29 (Sun, 29 Jun 2025)

  Changed paths:
    M flang/include/flang/Optimizer/Dialect/FIRAttr.td
    M flang/include/flang/Optimizer/Dialect/FIROps.td
    M flang/lib/Lower/Bridge.cpp
    M flang/lib/Lower/OpenMP/ClauseProcessor.cpp
    M flang/lib/Lower/OpenMP/ClauseProcessor.h
    M flang/lib/Lower/OpenMP/Clauses.h
    M flang/lib/Lower/OpenMP/OpenMP.cpp
    M flang/lib/Lower/OpenMP/ReductionProcessor.cpp
    M flang/lib/Lower/OpenMP/ReductionProcessor.h
    M flang/lib/Lower/Support/Utils.cpp
    M flang/lib/Optimizer/CodeGen/CodeGen.cpp
    M flang/lib/Optimizer/Dialect/FIROps.cpp
    M flang/lib/Optimizer/Transforms/SimplifyFIROperations.cpp
    M flang/test/Fir/do_concurrent.fir
    M flang/test/Fir/invalid.fir
    A flang/test/Lower/do_concurrent_reduce.f90
    M flang/test/Lower/loops.f90
    M flang/test/Lower/loops3.f90
    M flang/test/Transforms/do_concurrent-to-do_loop-unodered.fir

  Log Message:
  -----------
  [flang][do concurrent] Re-model `reduce` to match reductions are modelled in OpenMP and OpenACC

This PR proposes re-modelling `reduce` specifiers to match OpenMP and
OpenACC. In particular, this PR includes the following:

* A new `fir` op: `fir.delcare_reduction` which is identical to OpenMP's
  `omp.declare_reduction` op.
* Updating the `reduce` clause on `fir.do_concurrent.loop` to use the
  new op.
* Re-uses the `ReductionProcessor` component to emit reductions for `do
  concurrent` just like we do for OpenMP. To do this, the
  `ReductionProcessor` had to be refactored to be more generalized.
* Upates mapping `do concurrent` to `fir.loop ... unordered` nests using
  the new reduction model.

Unfortunately, this is a big PR that would be difficult to divide up in
smaller parts because the bottom of the changes are the `fir` table-gen
changes to `do concurrent`. However, doing these MLIR changes cascades
to the other parts that have to be modified to not break things.


  Commit: 3d66aaaa7b8517b23c5eefb9ebd567850f407918
      https://github.com/llvm/llvm-project/commit/3d66aaaa7b8517b23c5eefb9ebd567850f407918
  Author: ergawy <kareem.ergawy at amd.com>
  Date:   2025-06-29 (Sun, 29 Jun 2025)

  Changed paths:
    M flang/include/flang/Optimizer/Dialect/FIROps.td
    M flang/lib/Lower/Bridge.cpp

  Log Message:
  -----------
  review comments


  Commit: 51e15e603c76a2c0fb558d60d5fff9d0364b14de
      https://github.com/llvm/llvm-project/commit/51e15e603c76a2c0fb558d60d5fff9d0364b14de
  Author: ergawy <kareem.ergawy at amd.com>
  Date:   2025-06-29 (Sun, 29 Jun 2025)

  Changed paths:
    M flang/lib/Optimizer/Dialect/FIROps.cpp
    M flang/test/Fir/do_concurrent.fir

  Log Message:
  -----------
  byref printing and parsing


Compare: https://github.com/llvm/llvm-project/compare/be636dd39dac...51e15e603c76

To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list