[flang-commits] [flang] [flang] Skip processing reductions for unstructured `do concurrent` loops (PR #150188)
Kareem Ergawy via flang-commits
flang-commits at lists.llvm.org
Wed Jul 23 02:48:18 PDT 2025
ergawy wrote:
> This does seem like a reasonable approach.
>
> What do you think about the following program:
>
> ```
> program test
> integer i,r
>
> do concurrent (i=1:10) reduce(+:r)
> r = 1
> enddo
>
> print *,r
> end
> ```
>
> As I understand it, this should print the number of threads the loop actually used (because that will be the number of threadprivate values of `r` which were created). This would make something like what is done here user-visible. But I guess that is okay because the standard does not seem to require that do concurrent is actually run over multiple threads?
I probably missed what you are asking. This is a structured loop so reduction attributes will be emitted as usual. The changes in this PR only affect unstructured loops which are serialized so `r` will be `1` indeed.
https://github.com/llvm/llvm-project/pull/150188
More information about the flang-commits
mailing list