[Mlir-commits] [mlir] Remove Pure attribute from Linalg::IndexOp. (PR #68894)
llvmlistbot at llvm.org
llvmlistbot at llvm.org
Mon Oct 16 23:17:18 PDT 2023
MaheshRavishankar wrote:
> > Why is it a load. It resolves to induction variable value when the linalg op is lowered to loops.
>
> Because I don't see another way for the generic to pass the indices index op other than via some private variable. That is conceptually a linalg op with a 2D indexing space is stack allocating a `memref<2 x index>` for the current iteration indices, and the `linalg.index` op is a load...
That seems a bit of a convoluted reasoning. Might be making things unnecessarily complicated....
>
> > Well, it has no side-effects. So not sure it is a lie.
>
> Sorry but we're working on a compiler, you don't have a magic wand to escape reality :)
We also dont want a compiler to attach unnecessarily pessimizing semantics to something as simple as an induction variable. Thats where compilers (and presumably compiler writers) make their own life difficult.
https://github.com/llvm/llvm-project/pull/68894
More information about the Mlir-commits
mailing list