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

Kareem Ergawy via All-commits all-commits at lists.llvm.org
Thu Jun 26 21:18:05 PDT 2025


  Branch: refs/heads/users/ergawy/convert_locality_specs_to_clauses_5
  Home:   https://github.com/llvm/llvm-project
  Commit: 5ffd881b382ac0416dfb0732d331a1962a193895
      https://github.com/llvm/llvm-project/commit/5ffd881b382ac0416dfb0732d331a1962a193895
  Author: ergawy <kareem.ergawy at amd.com>
  Date:   2025-06-26 (Thu, 26 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: c7fd3b9e58c1b9df17fd60dcffd27c0e3582b11f
      https://github.com/llvm/llvm-project/commit/c7fd3b9e58c1b9df17fd60dcffd27c0e3582b11f
  Author: ergawy <kareem.ergawy at amd.com>
  Date:   2025-06-26 (Thu, 26 Jun 2025)

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

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


Compare: https://github.com/llvm/llvm-project/compare/13c79845c623...c7fd3b9e58c1

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