bloqade.lanes.transform.move_to_stack.MoveToStackMove
classMoveToStackMove¶source
bloqade.lanes.transform.move_to_stack.MoveToStackMove
Lower a ``move``-dialect kernel to a canonicalized ``stack_move`` kernel.
class MoveToStackMove(arch_spec: ArchSpec)emit runs the full move → stack_move lowering pipeline, producing an
ir.Method that is stack-consistent and ready for bytecode emission:
RewriteMoveToStackMove— in-place move → stack_move rewrite (strips Load/Store state threading, materialises address attributes asConst*SSA values, rebuilds Measure/AwaitMeasure/GetItem).- DCE + CSE to a fixpoint — the cleanup the encoder pipeline expects
before stackification (see
stackify’s docstring). stackify— normalise into stack-consistent form (single block, each SSA value used at most once, defining statements in stack order).
RewriteMoveToStackMove only lowers the subset of move statements
the bytecode path supports. When no_raise is False, emit runs
raise_if_statements_outside_dialect_group right after dropping move
from the group — before stackify, so an unlowered statement is reported
precisely instead of garbled by a later stage. Kirin’s verify() does not
check dialect-group membership, so such a statement would otherwise slip
through and fail lazily inside dump_program.
emit_bytecode runs emit and encodes the result to a bytecode
Program via dump_program.
Parameters
| Name | Type | Description |
|---|---|---|
arch_spec | ArchSpec |
Attributes
| Name | Type | Description |
|---|---|---|
arch_spec | ArchSpec |
methodemit¶source
bloqade.lanes.transform.move_to_stack.MoveToStackMove.emit
def emit(main: ir.Method, no_raise: bool = True) -> ir.MethodParameters
| Name | Type | Default | Description |
|---|---|---|---|
main | ir.Method | required | |
no_raise | bool | True |
Returns
ir.Method
methodemit_bytecode¶source
bloqade.lanes.transform.move_to_stack.MoveToStackMove.emit_bytecode
Signature
def emit_bytecode(main: ir.Method, version: tuple[int, int] = (1, 0), no_raise: bool = True) -> ProgramParameters
| Name | Type | Default | Description |
|---|---|---|---|
main | ir.Method | required | |
version | tuple[int, int] | (1, 0) | |
no_raise | bool | True |
Returns
Program