[Mlir-commits] [mlir] Remove Pure attribute from Linalg::IndexOp. (PR #68894)
llvmlistbot at llvm.org
llvmlistbot at llvm.org
Mon Oct 16 19:18:37 PDT 2023
MaheshRavishankar wrote:
> > Well, Pure is meant to allow CSE within the body of linalg.generic .
>
> I understand this is a transformation you'd like to enable, but that's not a semantics rationale!!
>
> > It isn't expected that are linalg operations nested within linalg operations
>
> That seems like a totally orthogonal discussion to me... (also to think about whether that composes, with inlining and other transformations)
>
> > I think marking it Pure still makes sense to me.
>
> I don't quite get this... How can an operation that produces different values without any input/operand possibly match the definition of "Pure"?
Well maybe some context might help. At some point there used to be `linalg.indexed_generic` which was similar to `linalg.generic` , i.e. a single block region, but in addition to the basic block arguments that represents values from each of the input and init operands, also had basic block arguments that represented the value of the induction variables of the iteration space of the `linalg` op. When these two ops were unified, then `linalg.index` was added to effectively represent the basic block arguments that were dropped from the `linalg.indexed_generic`.
I am not tied to it being `Pure`. It just should be CSE-able within a basic block.
https://github.com/llvm/llvm-project/pull/68894
More information about the Mlir-commits
mailing list