MLIR
Generated by scripts/gen-format-pages.py from docs/data/format-metadata/, FILE_FORMATS.csv and docs/formats-master.csv. Do not edit by hand: change the source, then run the script.
MLIR Preview.
At a glance
| Purpose | MLIR (Multi-Level Intermediate Representation) in text form: operations from compiler dialects such as func, arith, linalg and tensor. |
| Extensions | .mlir |
| Poka parser | poka-mlir |
| Viewer | poka-metadata-card-viewer |
| Depth tier | Metadata card (see Depth tiers) |
| Breadth tier | B4 Summary (see Breadth tiers) |
How much Poka reads
B4 Summary. The container and metadata are read and summarised (counts, properties, structure), but the main content is not rendered.
Confidence: medium (the reviewer read the code). Basis: Reviewed 2026-10-26: read parsers/poka-mlir/src/main.rs (217 lines) and plugin.json in full. The crate has no unit tests and no tests/samples.rs, and the corpus has no .mlir sample, so the tier rests on reading the code. Covers .mlir. The output is a metadata card of counts found by matching text line by line: module blocks, func.func declarations, block arguments, regions, return statements, SSA value tokens, attribute blocks, private visibility, operations of well-known dialects and the most used dialects. Judgement: B4, because the structure is summarised but the source itself is never shown.
What Poka does not read
- The source text is not shown: the card carries only counts and a few sample names, with no code view or highlighting
- Constructs are found by matching text line by line, not by parsing, so multi-line declarations, nested or indented definitions and keywords inside strings or comments can be miscounted
- Files over 256 MiB are cut to the first 256 MiB (the card says so)
- Text that is not UTF-8 is decoded with replacement characters; no other encoding is tried
- Operations are counted only for a list of well-known dialects; others are not identified
- Function names, signatures and bodies are not shown
Libraries
Libraries Poka uses or has assessed for this format, with the status, licence and language the registry records.
- melior (candidate; Apache-2.0; Rust; https://github.com/mlir-rs/melior) — Rust wrapper over the MLIR C API; source has Module::parse(context, &str). Needs an installed LLVM/MLIR, alpha API.
- MLIR (LLVM project) parser and Python bindings (candidate; Apache-2.0 WITH LLVM-exception; C++, Python; https://mlir.llvm.org/docs/Bindings/Python/) — Reference parser; Python bindings show Module.parse on MLIR assembly. Licence from llvm-project LICENSE.TXT. Not portable to wasm easily.
Sources
- parsers/poka-mlir/src/main.rs
- parsers/poka-mlir/plugin.json