Hello, I have just been in a talk on Tensorflow MLIR, which (if I understood correctly) is an approach to design an infrastructure that allows easily defining intermediate representations that can share optimisation/transformation passes. Has anyone looked into it? It feels that their ideas could be useful for designing a more optimisable MIR. (I am mostly curious about this because it seems that MLIR ideas would allow Rust consumers to define their own IRs that are better suited for their uses, for example, verification.)
That would be so cool if we could share optimizations in a language agnostic way
I am very skeptical about using MLIR for Rust as-is, because it's all C++ (in pretty-hard-to-bridge ways) and I don't think anyone wants to take all the rustc code that works with MIR and rewrite it in C++.
The ideas behind it are interesting more broadly, but I also think that a large part of MLIR's strengths (if it indeed bears out in practice) will be the large number of potential clients amortizing the engineering cost of creating all this infrastructure. Reimplementing similar ideas from scratch in rustc, where it's only amortized over a much smaller ecosystem of tools that consume Rust, may not be economical. (Or conversely, some of the stuff MLIR is doing may be overkill for the smaller Rust-consuming ecosystem.)
oh, I was hoping for some high level optimization language that we'd just need to build DSL parsers for
(I did not look at MLIR at all, my comment was just to the above)