[Mlir-commits] [mlir] Remove Pure attribute from Linalg::IndexOp. (PR #68894)

llvmlistbot at llvm.org llvmlistbot at llvm.org
Mon Dec 11 18:59:33 PST 2023


MaheshRavishankar wrote:

> > we make nested linalg ops illegal then the above issue is potentially mute cause you would never have case where it would be illegal to cse linalg.index ops. This issue came about because someone tried to use nested linalg ops.
> 
> Correction: I used inlining and a function call that uses linalg operations was inlined inside a linalg op.

Having an operation of that granularity is also not the preferred path.

> 
> What is the limitation of linalg and why can't linalg be nested? This seems a bit of an arbitrary restriction but I don't have all the context, so I am happy to learn more about this.

Its about how it composes with transformations. For example such a nested operation does not vectorize with `linalg::vectorize`, nor does lower to loops result in conversion of linalg operations to scalar code. That is not to say that isnt one way of modeling a compilation flow, but the path that is developed under the structured op based lowering does not expect nested linalg operations (or more broadly tensor operations within the body of a linalg op).


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


More information about the Mlir-commits mailing list