[Mlir-commits] [mlir] [OpenMP][MLIR] Add omp.distribute op to the OMP dialect (PR #67720)
Kiran Chandramohan
llvmlistbot at llvm.org
Fri Nov 17 08:12:17 PST 2023
kiranchandramohan wrote:
> I'm not quite sure I understand the example. Are the construct(%cli... ) the "outputs" and the loops(%cli, ..) the ones being operated on, or do I have it backwards? Does the modified example below make sense?
>
> ```
> omp.distribute loops(%tloop1) {
> bb0 (%tloop1 : !omp.cli, %tloop2 : !omp.cli): // Is it legal to have %tloop2 without it being in omp.distribute? We only care about one of the loops.
> omp.tile loops(%loop), construct(%tloop1:!omp.cli, %tloop2:!omp.cli) { // Input 1 loop, output 2 loops
> bb0 (%loop : !omp.cli):
> omp.canonical_loop %iv : i32 in [0, %tc), construct(%inner : !omp.cli) {
> %a = load %arrA[%iv] : memref<?x?xf32>
> store %a, %arrB[%iv] : memref<?x?xf32>
> }
> }
> }
> ```
```
omp.distribute loops(%tloop1) {
bb0 (%tloop1 : !omp.cli):
omp.tile loops(%loop), construct(%tloop1:!omp.cli) { // Input 1 loop, output is two but further transformation by distribute only affects outermost.
bb0 (%loop : !omp.cli):
omp.canonical_loop %iv : i32 in [0, %tc), construct(%loop : !omp.cli) {
%a = load %arrA[%iv] : memref<?x?xf32>
store %a, %arrB[%iv] : memref<?x?xf32>
}
}
}
```
https://github.com/llvm/llvm-project/pull/67720
More information about the Mlir-commits
mailing list