Stream: t-compiler/wg-mir-opt

Topic: MLIR

Vytautas Astrauskas (Apr 29 2019 at 13:31, on Zulip):

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.)

oli (Apr 29 2019 at 13:35, on Zulip):

oh sweet

oli (Apr 29 2019 at 13:36, on Zulip):

That would be so cool if we could share optimizations in a language agnostic way

rkruppe (Apr 29 2019 at 17:39, on Zulip):

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.)

oli (Apr 29 2019 at 18:11, on Zulip):

oh, I was hoping for some high level optimization language that we'd just need to build DSL parsers for

oli (Apr 29 2019 at 18:12, on Zulip):

(I did not look at MLIR at all, my comment was just to the above)

Last update: Mar 31 2020 at 02:40UTC