bloqade.rewrite.passes.aggressive_unroll.AggressiveUnroll
← Module overview
class
method
sourcemethod
source
classAggressiveUnroll¶source
bloqade.rewrite.passes.aggressive_unroll.AggressiveUnroll
Bases: Pass
A pass to unroll structured control flow
Signature
class AggressiveUnroll(additional_inline_heuristic: Callable[[ir.Statement], bool] = lambda node: True)Parameters
| Name | Type | Default | Description |
|---|---|---|---|
additional_inline_heuristic | Callable[[ir.Statement], bool] | lambda node: True |
Attributes
| Name | Type | Default | Description |
|---|---|---|---|
additional_inline_heuristic | Callable[[ir.Statement], bool] | lambda node: True | |
fold | Fold | field(init=False) | |
typeinfer | TypeInfer | field(init=False) | |
scf_unroll | UnrollScf | field(init=False) | |
canonicalize_ilist | CanonicalizeIList | field(init=False) |
methodunsafe_run¶source
bloqade.rewrite.passes.aggressive_unroll.AggressiveUnroll.unsafe_run
def unsafe_run(mt: Method) -> RewriteResultParameters
| Name | Type | Description |
|---|---|---|
mt | Method |
Returns
RewriteResult
methodinline_heuristic¶source
bloqade.rewrite.passes.aggressive_unroll.AggressiveUnroll.inline_heuristic
def inline_heuristic(node: ir.Statement) -> boolThe 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
Parameters
| Name | Type | Description |
|---|---|---|
node | ir.Statement |
Returns
bool