bloqade.lanes.rewrite.move2stack_move.RewriteMoveToStackMove
← Module overview
class
method
source
classRewriteMoveToStackMove¶source
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_locationsandarch_spec.get_zone_indexto 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
| Name | Type | Description |
|---|---|---|
arch_spec | ArchSpec |
Attributes
| Name | Type | Description |
|---|---|---|
arch_spec | ArchSpec |
methodrewrite_Block¶source
bloqade.lanes.rewrite.move2stack_move.RewriteMoveToStackMove.rewrite_Block
def rewrite_Block(node: ir.Block) -> RewriteResultParameters
| Name | Type | Description |
|---|---|---|
node | ir.Block |
Returns
RewriteResult