[Mlir-commits] [mlir] [OpenMP][MLIR] Add omp.distribute op to the OMP dialect (PR #67720)

Jan Leyonberg llvmlistbot at llvm.org
Tue Oct 3 07:26:06 PDT 2023


jsjodin wrote:

> > The example lowering created a `omp.wsloop` operation for an `omp.distribute` eventhough there was no `parallel do`. Hence the question. https://github.com/llvm/llvm-project/pull/67798/files#diff-0652f88238afa05fb262dcebab875780ab553b3914ba7239512c45986198240d
> 
> Thanks for bringing attention to this. I think that example should not produce an `omp.wsloop` in that situation. We would need to have the `omp.distribute` operation somehow represent that loop by itself, since the semantics for `omp.wsloop` are not the same (worksharing iterations across threads in a team vs worksharing iterations across teams in a league).
> 
> To me, at this time the options to achieve this are either to adopt `omp.canonical_loop` and to integrate it with both `omp.distribute` and `omp.wsloop` or to follow `omp.wsloop` design in `omp.distribute` so that it defines its own loop indices as block arguments after being given the bounds and step. I understand that the first option would be what we'd like to have long term, but the second would allow us to keep adding offloading features while the `omp.canonical_loop` design is finalized.

I guess it depends on how we want to handle the collapse clause and how to handle loops that are both workshare and distribute.

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


More information about the Mlir-commits mailing list