Mercurial > lcfOS
annotate python/optimize.py @ 264:f8b5da5784b8
Test
author | Windel Bouwman |
---|---|
date | Fri, 09 Aug 2013 16:30:26 +0200 |
parents | 7416c923a02a |
children | 5ec7580976d9 |
rev | line source |
---|---|
253 | 1 from mem2reg import Mem2RegPromotor |
2 from transform import CommonSubexpressionElimination, CleanPass | |
3 from transform import DeadCodeDeleter, ConstantFolder | |
4 | |
5 def optimize(ir): | |
6 cf = ConstantFolder() | |
7 dcd = DeadCodeDeleter() | |
8 m2r = Mem2RegPromotor() | |
9 clr = CleanPass() | |
10 cse = CommonSubexpressionElimination() | |
11 cf.run(ir) | |
12 dcd.run(ir) | |
13 clr.run(ir) | |
14 m2r.run(ir) | |
15 cse.run(ir) | |
255 | 16 cf.run(ir) |
17 dcd.run(ir) | |
253 | 18 |
19 | |
20 |