view python/optimize.py @ 253:74c6a20302d5

Added better logging
author Windel Bouwman
date Wed, 31 Jul 2013 17:57:03 +0200
parents
children 7416c923a02a
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()
    ir.check()
    cf.run(ir)
    dcd.run(ir)
    ir.check()
    clr.run(ir)
    ir.check()
    m2r.run(ir)
    ir.check()
    cse.run(ir)
    ir.check()