0x0LearnReferenceLibraries0x0.jmp0x1b.com

Multi-Level Typed SSA Pipeline

The multi-level typed SSA pipeline splits compiler lowering into four explicit

levels:


HIR -> MIR -> LIR -> MachineIR

The goal is to preserve semantic facts early and introduce target details only

at the documented lowering boundary.

Run the bounded gate with:


make typed-ssa-pipeline-check
make native-ir-check

native-ir-check depends on typed-ssa-pipeline-check, so native IR validation

cannot run without first validating the full IR stack evidence. These gates do

not run self-host, release, deployment, emulator, or broad benchmark jobs.

Evidence Files

decisions.

evidence.

HIR

HIR owns parsed, resolved, and typed source structure. It carries source spans,

symbol ids, type ids, effect sets, and stable textual ids. HIR must not contain

target-specific decisions such as ISA, registers, ABI classes, stack slots,

relocations, or object sections.

MIR

MIR is typed and effect-aware SSA. MIR carries:

MIR must stay target-independent. Target leakage in MIR is rejected.

LIR

LIR is the ABI and legal-type boundary. It introduces legal value types, ABI

classes, call conventions, stack slots, and runtime calls. It may record ABI and

runtime decisions, but it must not select target instructions, allocate

registers, define frame layout, emit relocations, or choose object sections.

MachineIR

MachineIR owns target-specific machine lowering: instruction selection,

scheduling, register allocation, frame layout, branch forms, relocations, and

object metadata. MachineIR instructions must carry source spans so diagnostics

and validation can still trace generated code back to source.

Diagnostics

The verifier rejects malformed or unsafe IR evidence with stable diagnostics:


MULTI_IR_SCHEMA
MULTI_IR_TARGET_LEAK
MULTI_IR_SSA
MULTI_IR_LEGAL_TYPE
MULTI_IR_MACHINE_METADATA
MULTI_IR_LOWERING_INVARIANT
MULTI_IR_SPAN

These diagnostics are release-relevant. A backend may not satisfy this pipeline

by redoing frontend decisions or by dropping type, effect, source-span, ABI, or

machine metadata.

Backend Consumption

Backends either consume an appropriate IR level or carry explicit transition

evidence in release/multi-ir-backend-transition.tsv.

Current rows classify:

optimization semantics.