diff options
| author | Kareem Ergawy <kareem.ergawy@amd.com> | 2025-07-11 06:39:30 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-07-11 06:39:30 +0200 |
| commit | eba35cc1c0e4e2c59f9fd1f7a6f3b17cb4d8c765 (patch) | |
| tree | 41b0c888d857482f7862b3cd6947d525dcf20ec5 /flang/test/Transforms | |
| parent | b6b64f49c422e6d52db3bce556ae13d4d8fe2ea1 (diff) | |
[flang][do concurrent] Re-model `reduce` to match reductions are modelled in OpenMP and OpenACC (#145837)
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.
This PR goes in the same direction we went for `private/local`
speicifiers. Now the `do concurrent` and OpenMP (and OpenACC) dialects
are modelled in essentially the same way which makes mapping between
them more trivial, hopefully.
PR stack:
- https://github.com/llvm/llvm-project/pull/145837 (this one)
- https://github.com/llvm/llvm-project/pull/146025
- https://github.com/llvm/llvm-project/pull/146028
- https://github.com/llvm/llvm-project/pull/146033
Diffstat (limited to 'flang/test/Transforms')
| -rw-r--r-- | flang/test/Transforms/do_concurrent-to-do_loop-unodered.fir | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/flang/test/Transforms/do_concurrent-to-do_loop-unodered.fir b/flang/test/Transforms/do_concurrent-to-do_loop-unodered.fir index d9ef36b17559..c550ab8a97d4 100644 --- a/flang/test/Transforms/do_concurrent-to-do_loop-unodered.fir +++ b/flang/test/Transforms/do_concurrent-to-do_loop-unodered.fir @@ -86,7 +86,7 @@ func.func @dc_2d_reduction(%i_lb: index, %i_ub: index, %i_st: index, %j = fir.alloca i32 fir.do_concurrent.loop (%i_iv, %j_iv) = (%i_lb, %j_lb) to (%i_ub, %j_ub) step (%i_st, %j_st) - reduce(#fir.reduce_attr<add> -> %sum : !fir.ref<i32>) { + reduce(@add_reduction_i32 #fir.reduce_attr<add> %sum -> %sum_arg : !fir.ref<i32>) { %0 = fir.convert %i_iv : (index) -> i32 fir.store %0 to %i : !fir.ref<i32> |
