Skip to main content

Crate cljrs_ir

Crate cljrs_ir 

Source
Expand description

Intermediate representation for clojurust program analysis and optimization.

The IR is a control-flow graph of basic blocks containing instructions in A-normal form (all sub-expressions bound to named temporaries). It supports SSA construction via phi nodes at join points.

The IR serves multiple purposes:

  1. Escape analysis and optimization hints
  2. IR interpreter (Tier 1 execution)
  3. Cranelift-based JIT/AOT code generation (Tier 2 execution)

Modules§

lower
Pure-Rust ANF lowering, escape analysis, and region optimization.

Structs§

Block
A basic block: a linear sequence of instructions followed by a terminator.
BlockId
A basic block identifier within an IR function.
ClosureTemplate
Template for a closure — the static parts of an fn* form.
IrBundle
A bundle of pre-lowered IR functions, keyed by a string identifier.
IrFunction
An IR function — the unit of analysis.
VarId
A unique variable identifier within an IR function.

Enums§

Const
A constant value in the IR. Kept separate from Value to avoid requiring GC allocation for IR analysis.
Effect
Effect classification for IR instructions.
Inst
An IR instruction. Each instruction produces at most one result (the dst field in variants that have one).
KnownFn
Built-in functions the IR knows about for precise effect tracking.
RegionAllocKind
The kind of object allocated in a region.
Terminator
A block terminator — controls flow between basic blocks.

Constants§

COMPILER_ANF_SOURCE
Clojure source for the ANF lowering namespace.
COMPILER_ESCAPE_SOURCE
Clojure source for the escape analysis namespace.
COMPILER_IR_SOURCE
Clojure source for the IR builder namespace.
COMPILER_KNOWN_SOURCE
Clojure source for the known function resolution namespace.
COMPILER_OPTIMIZE_SOURCE
Clojure source for the optimization pass namespace.

Functions§

deserialize_bundle
Deserialize an IrBundle from bytes.
serialize_bundle
Serialize an IrBundle to bytes.