[flang-commits] [flang] [flang][OpenMP] Improve reduction of Scalar ArrayElement types (PR #163940)

Krzysztof Parzyszek via flang-commits flang-commits at lists.llvm.org
Fri Oct 17 12:32:16 PDT 2025


kparzysz wrote:

I'm ok with this approach, but I think we need to develop a solution in lowering in the longer term.

I'm concerned that doing something like the example above could potentially introduce subtle race conditions
```
tmp = a(10)
!$omp parallel reduction(+: tmp)
...
tmp = tmp + 10 
!$omp end parallel  ! a(10) would normally be up-to-date here on exit from the parallel region
a(10) = tmp         ! but it isn't until here
```

I think we can probably get away with this for now.

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


More information about the flang-commits mailing list