view python/optimize.py @ 262:ed14e077124c

Added conditional branch instructions
author Windel Bouwman
date Fri, 09 Aug 2013 11:30:11 +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)