view python/optimize.py @ 264:f8b5da5784b8

Test
author Windel Bouwman
date Fri, 09 Aug 2013 16:30:26 +0200
parents 7416c923a02a
children 5ec7580976d9
line wrap: on
line source

from mem2reg import Mem2RegPromotor
from transform import CommonSubexpressionElimination, CleanPass
from transform import DeadCodeDeleter, ConstantFolder

def optimize(ir):
    cf = ConstantFolder()
    dcd = DeadCodeDeleter()
    m2r = Mem2RegPromotor()
    clr = CleanPass()
    cse = CommonSubexpressionElimination()
    cf.run(ir)
    dcd.run(ir)
    clr.run(ir)
    m2r.run(ir)
    cse.run(ir)
    cf.run(ir)
    dcd.run(ir)