Skip to content

bloqade.stim.passes.hint_const_in_loops.HintPureFromConcrete

← Module overview

classHintPureFromConcretesource

bloqade.stim.passes.hint_const_in_loops.HintPureFromConcrete

Bases: RewriteRule

Generic const-folder mimicking ``const.Propagate``'s pure fallback.

class HintPureFromConcrete(dialects: ir.DialectGroup)

For any Pure statement whose args all carry const.Value hints, run the concrete impl on the const data and stamp each result with a const.Value hint. Subsumes per-stmt hand-rolled folders for Constant, TupleNew, IListNew, Range, Slice, USub, and similar.

Parameters

NameTypeDescription
dialectsir.DialectGroup

Attributes

NameTypeDescription
dialectsir.DialectGroup

methodrewrite_Statementsource

bloqade.stim.passes.hint_const_in_loops.HintPureFromConcrete.rewrite_Statement

def rewrite_Statement(node: ir.Statement) -> RewriteResult

Parameters

NameTypeDescription
nodeir.Statement

Returns

RewriteResult

source