[Mlir-commits] [mlir] [OpenMP][MLIR] Add omp.distribute op to the OMP dialect (PR #67720)
Kiran Chandramohan
llvmlistbot at llvm.org
Mon Oct 2 10:36:58 PDT 2023
kiranchandramohan wrote:
> Since the canonical loop proposal might take some time before it's finished, in my opinion a good approach could be to mimic `omp.wsloop` and produce new loop index variables as entry block arguments to this op's region. I guess in that case we'd have to think about what the `omp.distribute` loop bounds and steps would be for a given nested Do loop, and how they might interoperate with the corresponding `omp.wsloop` operation.
Are you suggesting a different approach here? To have `omp.distribute` the same as `omp.wsloop`, i.e a loop-like operation? Currently `omp.wsloop` subsumes the nested `Do loop`.
In the lowering in https://github.com/llvm/llvm-project/pull/67798, an `omp.wsloop` is created for `!$omp distribute`. Is this always correct to do as per the standard? Is it based on existing Clang lowering?
> > Could you share your plan before we proceed? The proposal of this patch of a distribute operation that (possibly) nests a loop seems to be different from both the existing worksharing-loop design (that includes the loop) and the canonical-loop proposal under design where the distribute will accept a CLI value that represents a loop.
>
> The plan is to have some representation of 'distribute' that does not rely on meta-values (CLI) for now, since there are still a lot of unanswered questions. The version of the omp.distribute op in this patch basically works as a wrapper op that modified how the contained loop(s) execute. It does rely on there being a contained loop or (several if we want to consider collapse).
Will the contained loop be an `omp.wsloop` always?
Regarding the new proposal, we might still have to propagate CLIs if atleast one of the CLI is generated. Like in the following example, where the inner loop is unrolled partially. That unrolling generates a new CLI that has to be somehow propagated up right?
```
!$omp tile (4,5)
do i=1,n
!$omp unroll partial
do j=1,m
end do
end o
```
https://github.com/llvm/llvm-project/pull/67720
More information about the Mlir-commits
mailing list