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

Kareem Ergawy via All-commits all-commits at lists.llvm.org
Wed Jul 2 08:35:33 PDT 2025


  Branch: refs/heads/users/ergawy/convert_locality_specs_to_clauses_5
  Home:   https://github.com/llvm/llvm-project
  Commit: bf252b5e85e8c09ddd70c5c4edd49d5215fb6ecc
      https://github.com/llvm/llvm-project/commit/bf252b5e85e8c09ddd70c5c4edd49d5215fb6ecc
  Author: ergawy <kareem.ergawy at amd.com>
  Date:   2025-07-02 (Wed, 02 Jul 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: 7b1680e42a014ffbede691d7d8ba71e656a8dfd3
      https://github.com/llvm/llvm-project/commit/7b1680e42a014ffbede691d7d8ba71e656a8dfd3
  Author: ergawy <kareem.ergawy at amd.com>
  Date:   2025-07-02 (Wed, 02 Jul 2025)

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

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


  Commit: 0095db8a5f72b58527c84d1ff8eb0cbf8aa7445f
      https://github.com/llvm/llvm-project/commit/0095db8a5f72b58527c84d1ff8eb0cbf8aa7445f
  Author: ergawy <kareem.ergawy at amd.com>
  Date:   2025-07-02 (Wed, 02 Jul 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/51e15e603c76...0095db8a5f72

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