Treffer: Extendable and Decoupled Multi-Level Intermediate Representation (MLIR) Compilation with JavaScript
Weitere Informationen
The promise of the MLIR framework is to be a universal Intermediate Representation (IR) that can be used on all processing steps of the compiler, from the high-level Abstract Syntax Tree (AST) down to the low-level representation. To achieve this, MLIR introduces the concept of dialects, to encapsulate specific abstractions, and allows the co-existence of any combination of dialects in the same IR. However, MLIR faces composability and extensibility issues, which hinder the original objective of providing a "reusable and extensible compiler infrastructure". Extending the MLIR ecosystem with a new dialect usually requires modifications to the framework, immediately causing fragmentation. Additionally, the MLIR ecosystem has a steep learning curve, which hinders adoption by new developers. In this paper, we propose an approach that intends to lower the entry barrier and improve the composability and extensibility of MLIR, as well as a concrete solution for the first steps of obtaining and parsing MLIR. Since the MLIR language itself is open to extensions, this requires a more agile and dynamic approach to processing it. Our solution is based on a compiler, built on top of the LARA framework, which does not pre-impose restrictions on the code that it can parse and transform.