Skip to content

bloqade.stim.passes.hint_const_in_loops

hint_const_in_loops

bloqade.stim.passes.hint_const_in_loops

Set const hints on statements inside preserved scf.For bodies.

The standard kirin pipeline runs const.Propagate once at the top-level method scope, so SSA values inside preserved scf.For bodies don’t pick up const hints. This module fills that gap with a generic rule that mimics const.Propagate’s pure-fallback logic (run each Pure statement’s concrete impl on its const-hinted args, stamp the result back as a const hint), plus a few specialized rules for cases that need static-type info or scf.For-aware traversal.