Aggressive unroll
AggressiveUnroll
dataclass
AggressiveUnroll(
additional_inline_heuristic: Callable[
[Statement], bool
] = lambda node: True,
)
Bases: Pass
flowchart TD
bloqade.rewrite.passes.aggressive_unroll.AggressiveUnroll[AggressiveUnroll]
click bloqade.rewrite.passes.aggressive_unroll.AggressiveUnroll href "" "bloqade.rewrite.passes.aggressive_unroll.AggressiveUnroll"
A pass to unroll structured control flow
inline_heuristic
inline_heuristic(node: Statement) -> bool
The heuristic to decide whether to inline a function call or not. inside loops and if-else, only inline simple functions, i.e. functions with a single block
Source code in .venv/lib/python3.12/site-packages/bloqade/rewrite/passes/aggressive_unroll.py
94 95 96 97 98 99 100 101 102 103 | |