[flang-commits] [flang] [mlir] [flang][OpenMP] Enable delayed privatization by default `omp.wsloop` (PR #122471)

Kareem Ergawy via flang-commits flang-commits at lists.llvm.org
Wed Jan 15 05:21:05 PST 2025


ergawy wrote:

> I found a bug (I think) unrelated to the workaround:

It is indeed a bug and a weird one 🤔. When `lastprivate` is used, the arguments of `copy` block in the privatizer are swtiched:
```
copy {
^bb0(%arg0: !fir.ref<i32>, %arg1: !fir.ref<i32>):
  %0 = fir.load %arg1 : !fir.ref<i32>
  hlfir.assign %0 to %arg0 : i32, !fir.ref<i32>
  omp.yield(%arg1 : !fir.ref<i32>)
}
```
so it stores from the private copy to the original host one and not the other way around like it should. The weird thing is, the last private update is emitted properly in the body of the op itself.

Might be a problem with how values are managed by the symbol table. But not sure yet, looking ....

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


More information about the flang-commits mailing list