bloqade.stim.passes.constprop_override.StimConstProp
classStimConstProp¶source
bloqade.stim.passes.constprop_override.StimConstProp
Bases: ForwardExtra[const.Frame, const.Result]
Constant propagation with early-termination for scf.For loops.
class StimConstPropLike kirin’s Propagate, but uses the “stim.constprop” key to pick up the early-termination handler for scf.For, falling back to “constprop” for everything else.
NOTE: This duplicates Propagate’s logic because Propagate is @final. Once the early termination is upstreamed into kirin, this class and the “stim.constprop” registration can be removed entirely.
Attributes
| Name | Type | Default | Description |
|---|---|---|---|
keys | — | ('stim.constprop', 'constprop') | |
lattice | — | const.Result |
methodinitialize¶source
bloqade.stim.passes.constprop_override.StimConstProp.initialize
def initialize()methodinitialize_frame¶source
bloqade.stim.passes.constprop_override.StimConstProp.initialize_frame
Signature
def initialize_frame(node: ir.Statement, *, has_parent_access: bool = False) -> const.FrameParameters
| Name | Type | Default | Description |
|---|---|---|---|
node | ir.Statement | required | |
has_parent_access | bool | False |
Returns
const.Frame
methodmethod_self¶source
bloqade.stim.passes.constprop_override.StimConstProp.method_self
def method_self(method: ir.Method) -> const.ResultParameters
| Name | Type | Description |
|---|---|---|
method | ir.Method |
Returns
const.Result
methodframe_eval¶source
bloqade.stim.passes.constprop_override.StimConstProp.frame_eval
Signature
def frame_eval(frame: const.Frame, node: ir.Statement) -> interp.StatementResult[const.Result]Parameters
| Name | Type | Description |
|---|---|---|
frame | const.Frame | |
node | ir.Statement |
Returns
interp.StatementResult[const.Result]
methodtry_eval_const_pure¶source
bloqade.stim.passes.constprop_override.StimConstProp.try_eval_const_pure
Signature
def try_eval_const_pure(frame: const.Frame, stmt: ir.Statement, values: tuple[const.Value, ...]) -> interp.StatementResult[const.Result]Parameters
| Name | Type | Description |
|---|---|---|
frame | const.Frame | |
stmt | ir.Statement | |
values | tuple[const.Value, ...] |
Returns
interp.StatementResult[const.Result]