[Mlir-commits] [mlir] [OpenMP Dialect] Add omp.canonical_loop operation. (PR #65380)

llvmlistbot at llvm.org llvmlistbot at llvm.org
Tue Sep 5 14:31:58 PDT 2023


shraiysh wrote:

So, are we planning to modify a loop in-place when `omp.unroll` is called on that loop, or is this a new canonical loop object that would be used to create a loop nest? That is, while running the operation `omp.unroll` do we also do the following change:
```
[[in memory representation of canonical loop object]]
%tiled#0 = omp.canonical_loop [0, %tc) step = 4
|-[child] %tiled#1 = omp.canonical_loop [%i, %i+4) step = 1
```
changes to 
```
[[in memory representation of canonical loop object]]
%tiled#0 = omp.canonical_loop [0, %tc) step=4
|-[child] %unrolled = omp.canonical_loop [0, 1) step=1
```

If this change is happening in-place on calling the operation `omp.unroll` then we do not need a result on LHS of `omp.unroll`. If it is not happening in-place, then we need another operation to now generate the second nested loop above. Is this correct or am I missing something? 

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


More information about the Mlir-commits mailing list