[Mlir-commits] [mlir] [MLIR][OpenMP] Add `omp.private` op (PR #80955)

llvmlistbot at llvm.org llvmlistbot at llvm.org
Mon Feb 12 20:35:48 PST 2024


NimishMishra wrote:

Thank you for the work on this merge.

I was playing around with the patch, and have one small question. It seems for firstprivate, we are offloading the responsibility of ensuring correct copying elsewhere, which I am not able to pinpoint. Is it the responsibility of the lowering to MLIR to ensure correct copying?

For instance, currently, the following firstprivate op is getting accepted:

```mlir
omp.private {type=firstprivate} @x.privatizer : i32 alloc{
      ^bb0(%arg0 : i32):
                %0 = arith.constant 0 : i32
                omp.yield(%0 : i32)
} copy {
     ^bb0(%arg0: i32, %arg1: i32):
                    %0 = llvm.add %arg1, %arg0 : i32
                     omp.yield(%0 : i32)
}
```

So which phase of compilation bears the responsibility of correctly creating the `copy` region?

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


More information about the Mlir-commits mailing list