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

llvmlistbot at llvm.org llvmlistbot at llvm.org
Tue Oct 17 14:34:32 PDT 2023


MaheshRavishankar wrote:

> > That seems a bit of a convoluted reasoning. Might be making things unnecessarily complicated....
> 
> I don't see anything simpler that would still be sound actually.
> 
> You can replace "stack alloc" by "private register file" or any conceptual abstract storage space you'd like, but I don't quite see how you can avoid the communication of the information, because it actually exists!! This is just what the ops do here...
> 
> > 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.
> 
> There is no "pessimizing" semantics here: I can't see any other simpler semantics actually... Feel free to propose an alternative: but "magic behavior" is just not in scope!

The only real alternative is to add basic block arguments to all `linalg.generic` which represent the induction variable as well, and deprecate `linalg.index`. Thats a big change though and disruptive. I dont really think it is justified. I understand your concern though. Maybe we just add a new side-effect mode which is meant to represent CSE-able within a basic block. (FTR I am not tied to `linalg.index` in any way... my only concern is that it exists and sort of works, and the original issue that triggered this path is actually the unsupported path).

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


More information about the Mlir-commits mailing list