github/workflows/pycopy-test: Upgrade Pycopy to 3.6.1.
[ScratchABlock.git] / script_propagate_dce.py
blobf40c35ed8c4ed004a3795b53603b36846fcabeb9
1 from xform import *
2 from dataflow import *
5 def apply(cfg):
6 # Various algos below don't work with no explicit entry in CFG
7 cfg_preheader(cfg)
8 # Also don't work with >1 entries
9 remove_unreachable_entries(cfg)
10 # Various algos below require single-exit CFG
11 cfg_single_exit(cfg)
13 foreach_inst(cfg, sub_const_to_add)
14 # Initial pass on simplifying expressions
15 foreach_inst(cfg, simplify_inst)
17 analyze_live_vars(cfg)
18 insert_initial_regs(cfg)
20 analyze_reach_defs(cfg)
21 make_du_chains(cfg)
22 #const_propagation(cfg)
23 #copy_propagation(cfg)
24 #mem_propagation(cfg)
25 expr_propagation(cfg)
27 analyze_live_vars(cfg)
28 estimate_params(cfg)
29 foreach_bblock(cfg, dead_code_elimination)
31 collect_calls(cfg)