bloqade.rewrite.passes.callgraph.CallGraphPass
← Module overview
class
method
source
classCallGraphPass¶source
bloqade.rewrite.passes.callgraph.CallGraphPass
Bases: passes.Pass
Copy all functions in the call graph and apply a rule to each of them.
class CallGraphPass(rule: RewriteRule)Note: This pass modifies the input method in place, but copies all methods invoked within it before applying the rule to them.
Usage
rule = Walk(SomeRewriteRule()) pass_ = CallGraphPass(rule=rule, dialects=…) pass_(some_method)
Parameters
| Name | Type | Description |
|---|---|---|
rule | RewriteRule |
Attributes
| Name | Type | Default | Description |
|---|---|---|---|
rule | RewriteRule | required | The rule to apply to each function in the call graph. |
fold_pass | passes.Fold | field(init=False) |
methodunsafe_run¶source
bloqade.rewrite.passes.callgraph.CallGraphPass.unsafe_run
def unsafe_run(mt: ir.Method) -> RewriteResultParameters
| Name | Type | Description |
|---|---|---|
mt | ir.Method |
Returns
RewriteResult