Skip to content

bloqade.lanes.rewrite.stackify.stackify

← Module overview

functionstackifysource

bloqade.lanes.rewrite.stackify.stackify

def stackify(method: ir.Method) -> None

Normalise a single-block stack_move ir.Method for bytecode encoding.

Applies all three stackification sub-passes in sequence (CloneConstants, DCE, Dup/Swap insertion) so that dump_program can walk the block in statement order and emit correct bytecode.

Raises ValueError if the method contains more than one block. All IR produced by the current compiler pipeline is single-block; call this function after RewriteMoveToStackMove and before dump_program.

Parameters

NameTypeDescription
methodir.Method
source