[Mlir-commits] [mlir] [MLIR][OpenMP] Support basic materialization for `omp.private` ops (PR #81715)
Kareem Ergawy
llvmlistbot at llvm.org
Thu Feb 22 20:49:10 PST 2024
ergawy wrote:
Thanks everyone for the discussion.
Just to clarify what I meant, please have a look this new commit: https://github.com/llvm/llvm-project/pull/81715/commits/d9a97e68ff3c44866a097c048c3c5ec7c58c1a4f. With this approach, there is not cloning, and the MLIR op is restored to its original state after conversion.
> Is the privatizer callback called after outlining?
@kiranchandramohan I might have misunderstood what you mean, but the problem is not really related to when the callback is called, it is purely on the MLIR level. The callback will not be called unless an input is detected by the `CodeExtractor`. No input will be detected by the `CodeExtractor` if the value does not cross into the parallel op's region. Hence the need for the mapping I did on the MLIR level.
@NimishMishra both your points are correct yes. We want to restore the MLIR op so that we don't accidentally invalidate it and make it difficult to debug (for example, printing might crash). We also want to reduce the cost by not cloning.
Is this RAII approach better?
https://github.com/llvm/llvm-project/pull/81715
More information about the Mlir-commits
mailing list