MLIR step-through
How it works
mlir-opt runs in this tab.
Walk the pipeline
Pick a pipeline above the panes, or choose Edit… ← → move pass by pass; in an open list, type a step number.
Compare outputs of two passes…
Last in the pass list: pick a step per side; ← → move the right. Show this pass alone goes back.
Compare pipelines…
Last in the pipeline list: runs a second pipeline, same input, on the right.
Also
- Dialect chips: filled is new, struck out gone; click to walk its ops.
- Edit… renames, reorders or rewrites a pipeline; changes run as made and go into the Share link. Drag a pass by its handle, or focus the handle and press ↑ ↓; in its text, ⌘/Ctrl Enter runs now.
- Editor bar: drag or ↑ ↓ to resize, double-click to fold.
- Esc closes lists. The URL holds the view.
mlir-opt diagnostics
Passes
No run yet.
What runs on every edit.
The binary is the stock mlir-opt driver with every upstream dialect and pass registered, built from LLVM with Emscripten. It takes the same command line as the one on your machine, and this page passes it:
mlir-opt in.mlir --pass-pipeline='…' \
--mlir-print-ir-after-all --mlir-print-ir-module-scope \
--mlir-disable-threading -o out.mlirEach step is one of the IR dumps that --mlir-print-ir-after-all writes to stderr; anything else on stderr is shown as a diagnostic, verbatim. Step 0 is your input after one run with an empty pipeline, printed the same way the dumps are, so the first diff shows the first pass and not the printer.
Your IR never leaves the tab: there is no server to send it to. Share packs your source, both pipelines and the two steps on screen into the link itself, after the #, the part of a URL browsers never send to a server. mlir-opt runs in a worker, so the page stays responsive while it works.
How to read it, with the examples: Stepping through an MLIR pass pipeline in the browser.
Found a bug, or missing a pass? File an issue on GitHub (opens in a new tab); it takes a GitHub account.