|
|
|
|
|
by erichocean
1141 days ago
|
|
LLVM IR is just one IR dialect in the MLIR ecosystem, and there are a bunch of (included) higher-level IR dialects that can be transformed (usually, automatically) into the LLVM IR dialect, and from there, the normal LLVM compiler can take over and produce runnable machine code. Your own languages can target the higher-level IR dialects in MLIR, or directly target the LLVM IR dialect, or both: MLIR is unique in that multiple IR dialects are allowed to be "live" at any time in the compiler, there are no strict "phases" where one IR is lowered, one-shot, into a lower-lever IR, like most compilers require (and compiler books teach). MLIR is a really, really neat bit of technology. |
|
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.