Hacker News new | ask | show | jobs
by Findecanor 1141 days ago
As I understand it, MLIR is the new subsystem that the LLVM project is transitioning to in the long term, and LLVM IR is the old.

As such, LLVM IR isn't a proper subset of MLIR. Rather, there is a LLVM "dialect" in the MLIR system which can be translated 1:1 to LLVM IR.

MLIR in its structure and textual syntax is a bit different. A "dialect" is more like a namespace for your ops than a different language, in my view.

2 comments

In the transition, traditional LLVM IR isn’t being left behind. It’s simply a later step in the compilation process. All MLIR is (eventually) translated through LLLVM IR before machine code.
>As I understand it, MLIR is the new subsystem that the LLVM project is transitioning to in the long term, and LLVM IR is the old.

this is very much not a forgone conclusion and many people in LLVM would boo vociferously at the idea (see last year's LLVM US meeting where Johannes Doerfert actually argued the exact opposite - extending LLVM IR to do some/many of the things that MLIR does).

It depends what you mean by "new subsystem" and "transitioning to": what seems like a given is that the notion of "one size fits all" of LLVM IR is behind us and the need to multi-level IR is embraced. LLVM IR is evolving to accommodate this better, within reason (that is: it stay organized around a pretty well defined core instruction set and type system), and MLIR is just the fully extensible framework beyond this. It is to be seen if anyone would have the appetite to port LLVM IR (and the LLVM framework) to be a dialect, I think there are challenges for this.