[flang][openacc] Support assumed shape arrays in reduction (#67610)
commitef1eb502e01c55e8370a392bf259d624489c37e5
authorValentin Clement (バレンタイン クレメン) <clementval@gmail.com>
Thu, 28 Sep 2023 15:36:19 +0000 (28 08:36 -0700)
committerGitHub <noreply@github.com>
Thu, 28 Sep 2023 15:36:19 +0000 (28 08:36 -0700)
tree5ebafb36b732afafaba34830dd2273835210e6d5
parent989173c09c2930a9f523ccb455111ef446e9f96d
[flang][openacc] Support assumed shape arrays in reduction (#67610)

Assumed shape array are using descriptor and must be handled differently
than known shape arrays. This patch adds support to generate the `init`
and `combiner` region for the reduction recipe operation with assumed
shape array by using the descriptor and the HLFIR lowering path.

`createTempFromMold` function is moved from
`flang/lib/Optimizer/HLFIR/Transforms/BufferizeHLFIR.cpp` to
`flang/include/flang/Optimizer/Builder/HLFIRTools.h` to be reused to
create the private copy.
flang/include/flang/Optimizer/Builder/HLFIRTools.h
flang/lib/Lower/OpenACC.cpp
flang/lib/Optimizer/Builder/HLFIRTools.cpp
flang/lib/Optimizer/HLFIR/Transforms/BufferizeHLFIR.cpp
flang/test/Lower/OpenACC/acc-reduction.f90