[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:25:54 PST 2023
kiranchandramohan wrote:
I guess you are pointing towards a situation where there are two generated loops and the construct needs to work on both. For an example like the following:
```
!$omp distribute collapse(2)
!$omp.tile size(4)
do i=0, tripcount
arrB(i) = arrA(i)
end do
```
I was suggesting something like the following:
```
omp.distribute loops(%dloop) {
bb0 (%dloop : !omp.cli):
omp.collapse loops(%outer, %inner), construct(%dloop:!omp.cli) {
bb0 (%outer, %inner : !omp.cli, !omp.cli):
omp.tile loops(%loop) size(4) construct(%outer:!omp.cli, %inner:!omp.cli) {
bb0(%loop: !omp.cli):
omp.canonical_loop %iv1 : i32 in [0, %tripcount), construct(%loop : !omp.cli){
%a = load %arrA[%iv1] : memref<?xf32>
store %a, %arrB[%iv1] : memref<?xf32>
}
}
}
}
```
https://github.com/llvm/llvm-project/pull/67720
More information about the Mlir-commits
mailing list