THE MULTIPASS the optimizer i13 would actually keep
Batch 35 threw 16 classic compiler-optimization passes at i13 — a single-pass, correctness-first validator whose creed is ARRIVAL ≠ EXECUTION, EXECUTION ≠ COMMIT. An optimizer's job is to rewrite your code invisibly; i13's job is to prove it never lies about what runs. So the real question is not “how do we bolt an optimizer on” but which passes survive the creed. Sorted honestly, most do not — and the few that do share one property: they only ever delete what can never run, or they are already true by i13's design. Click any pass for its verdict and its grounded number.
The honest multipass is short on purpose. A compiler whose product is a proof keeps only the passes that a proof licenses: it removes checks it has discharged, deletes ops that can never execute, and inherits the rest from a language that never created the problem. Everything that would rewrite your code behind your back is refused, by design — not missing.
THE 16, SORTED BY THE CREED
FIT — adopt as a real passFREE — already true by designREPORT — show it, do not rewriteN/A — a stance, not a gap
● FIT — adopt
bounds-check elimination4/5 removable
peephole (dead-op)4 removed
● FREE — by design
def-use chainsnear-SSA
escape analysis0 escape
scalar replacementidiomatic
basic block2 regions
reaching definitions1-bit already
● REPORT — do not rewrite
common-subexpression elimwarn only
available expressionswarn only
cyclomatic complexitywaste metric
● N/A — a stance
loop-invariant motionno loops
induction variableno loops
interference graphno registers
branch predictionno speculation
inliningopt-in only
sea of nodesopposite IR
Click a pass above for i13's verdict and the number it was grounded on.
THE PIPELINE i13 WOULD SHIP
Two passes clear the creed — both only ever delete what can never run, so neither breaks EXECUTION ≠ COMMIT:
check (region validate)→bounds-check elimination drop a guard the validator PROVED redundant→dead-op peephole remove an op constructed nowhere (already done: Op::Attr, 18→17)→emit
Everything else is refused (invisible rewrite), free (value semantics + single assignment), or absent (no loops, no registers, no speculation). The optimizer that survives a proof is a short one — and that is the point.
See the compiler this pipeline runs inside — single-pass, self-contained WASM, the COVERED / NOT COVERED ledger: