Skip to content

bloqade.lanes.bytecode.encode.dump_program

← Module overview

functiondump_programsource

bloqade.lanes.bytecode.encode.dump_program

Signature
def dump_program(method: ir.Method, version: tuple[int, int] = (1, 0)) -> Program

Encode a stack_move ir.Method into a bytecode Program.

Inverse of load_program in decode.py: load_program(dump_program(method)) round-trips through bytecode and back to an equivalent ir.Method.

The method must be stack-consistent (each SSA value used exactly once, defining statements in stack order). load_program always produces stack-consistent output; IR from compiler rewrites must be normalised by stackify before calling this function.

Parameters

NameTypeDefaultDescription
methodir.Methodrequired
versiontuple[int, int](1, 0)

Returns

Program

source