[flang-commits] [flang] Reapply "[Flang][OpenMP][Lower] NFC: Move clause processing helpers into the ClauseProcessor (#85258)" (PR #85807)

Sergio Afonso via flang-commits flang-commits at lists.llvm.org
Wed Mar 20 07:30:20 PDT 2024


skatrak wrote:

> What was the gfortran test failure caused by?

It happened for cases such as `!$omp do reduction(+:x) reduction(min:y)`. The problem was basically that each call to the lambda passed to `findRepeatableClause<omp::clause::Reduction>` would append to `reductionTypes` the types of the whole list of `reductionVars`, which meant adding the ones associated to the first clause twice.

Looking into a solution, I noticed that the whole list of `reductionVars` is already queried in the `ReductionProcessor` to figure out whether to do the reduction by ref as well. So, we can't actually pass the output list or previous instances of the clause could impact the processing of following ones. Hence the solution involving creating local arrays and copying them out.

https://github.com/llvm/llvm-project/pull/85807


More information about the flang-commits mailing list