Skip to content

bloqade.lanes.rewrite.move2stack_move.RewriteMoveToStackMove

← Module overview

classRewriteMoveToStackMovesource

bloqade.lanes.rewrite.move2stack_move.RewriteMoveToStackMove

Bases: RewriteRule

Rewrite a move-dialect block into stack_move dialect in place.

class RewriteMoveToStackMove(arch_spec: ArchSpec)

Constructor args:

  • arch_spec: required. GetFutureResult lowering uses arch_spec.yield_zone_locations and arch_spec.get_zone_index to resolve the flat index of a (zone, location) pair into the AwaitMeasure result array.

Mutable state carried across the block walk:

  • _first_fill_emitted: True after the first move.Fill is processed, so subsequent fills lower to stack_move.Fill instead of InitialFill.
  • _future_to_sm_measure: maps move.Measure.future SSA → (stack_move.Measure stmt, zone_addresses tuple). Populated by move.Measure; used by GetFutureResult to emit AwaitMeasure lazily on first access.
  • _future_to_await: maps move.Measure.future SSA → AwaitMeasure result SSA. Populated on the first GetFutureResult for each future so that the AwaitMeasure is inserted at the right program point.

Parameters

NameTypeDescription
arch_specArchSpec

Attributes

NameTypeDescription
arch_specArchSpec

methodrewrite_Blocksource

bloqade.lanes.rewrite.move2stack_move.RewriteMoveToStackMove.rewrite_Block

def rewrite_Block(node: ir.Block) -> RewriteResult

Parameters

NameTypeDescription
nodeir.Block

Returns

RewriteResult

source