stgraph.compiler.passes package¶
Submodules¶
stgraph.compiler.passes.cf module¶
stgraph.compiler.passes.cse module¶
stgraph.compiler.passes.dce module¶
stgraph.compiler.passes.dependency_analysis module¶
- stgraph.compiler.passes.dependency_analysis.dep_program(target_var, stopping_vars)[source]¶
Step1: Analyze the part of the program that computes a “target_var”. Recursively 1. find the stmt that creates the current var 2. find the dependant stmts of its inputs until encounter “stopping_vars”.
Step2: Set the dependent stmt of stopping var to be None
Returns a copy of the dependency program of target_var
stgraph.compiler.passes.fusion module¶
- class stgraph.compiler.passes.fusion.FusionStateMachine(init_stmt=None)[source]¶
Bases:
object- state_trans = {0: {'a2d': 1, 'a2s': 1, 'd': 3, 'e': 1, 's': 5}, 1: {'d': 2, 'e': 1, 's': 2}, 2: {'d': 2, 's': 2}, 3: {'a2d': 1, 'd': 3, 's': 4}, 4: {'d': 4, 's': 4}, 5: {'a2s': 1, 'd': 4, 's': 5}}¶
- stgraph.compiler.passes.fusion.fusable(downstream_s, upstream_s, stmt2state_machine, new_fsm)[source]¶
- stgraph.compiler.passes.fusion.fuse(progs, outputs)[source]¶
Generate one/multiple execution units from one or more programs, which are used for code generation. Parallel mode of execution unit is determined by the ValType of ret var.