Move2stack move
move2stack_move — in-place rewrite from move dialect → stack_move dialect.
Inverse of RewriteStackMoveToMove in stack_move2move.py.
Strips move.Load / move.Store state threading, materialises address attributes as stack_move.Const* SSA values, converts py.Constant float/int values to stack_move.ConstFloat/Int, and reconstructs stack_move.Measure + stack_move.AwaitMeasure + stack_move.GetItem from the move.Measure + move.GetFutureResult pattern.
RewriteMoveToStackMove
dataclass
RewriteMoveToStackMove(arch_spec: ArchSpec)
Bases: RewriteRule
flowchart TD
bloqade.lanes.rewrite.move2stack_move.RewriteMoveToStackMove[RewriteMoveToStackMove]
click bloqade.lanes.rewrite.move2stack_move.RewriteMoveToStackMove href "" "bloqade.lanes.rewrite.move2stack_move.RewriteMoveToStackMove"
Rewrite a move-dialect block into stack_move dialect in place.
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.