Skip to content

bloqade.rewrite.passes.callgraph.CallGraphPass

← Module overview

classCallGraphPasssource

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

NameTypeDescription
ruleRewriteRule

Attributes

NameTypeDefaultDescription
ruleRewriteRulerequiredThe rule to apply to each function in the call graph.
fold_passpasses.Foldfield(init=False)

methodunsafe_runsource

bloqade.rewrite.passes.callgraph.CallGraphPass.unsafe_run

def unsafe_run(mt: ir.Method) -> RewriteResult

Parameters

NameTypeDescription
mtir.Method

Returns

RewriteResult

source