Skip to content

Callgraph

CallGraphPass dataclass

CallGraphPass(rule: RewriteRule)

Bases: Pass


              flowchart TD
              bloqade.rewrite.passes.callgraph.CallGraphPass[CallGraphPass]

              

              click bloqade.rewrite.passes.callgraph.CallGraphPass href "" "bloqade.rewrite.passes.callgraph.CallGraphPass"
            

Copy all functions in the call graph and apply a rule to each of them.

Usage

rule = Walk(SomeRewriteRule()) pass_ = CallGraphPass(rule=rule, dialects=...) pass_(some_method)

Note: This pass modifies the input method in place, but copies all methods invoked within it before applying the rule to them.

rule instance-attribute

rule: RewriteRule

The rule to apply to each function in the call graph.

UpdateDialectsOnCallGraph dataclass

UpdateDialectsOnCallGraph()

Bases: Pass


              flowchart TD
              bloqade.rewrite.passes.callgraph.UpdateDialectsOnCallGraph[UpdateDialectsOnCallGraph]

              

              click bloqade.rewrite.passes.callgraph.UpdateDialectsOnCallGraph href "" "bloqade.rewrite.passes.callgraph.UpdateDialectsOnCallGraph"
            

Update All dialects on the call graph to a new set of dialects given to this pass.

Usage

pass_ = UpdateDialectsOnCallGraph(rule=rule, dialects=new_dialects) pass_(some_method)

Note: This pass does not update the dialects of the input method, but copies all other methods invoked within it before updating their dialects.