view python/optimize.py @ 267:e7c8f7eb3f59

Added tag Working chain 1 for changeset 649884d9dc61
author Windel Bouwman
date Mon, 12 Aug 2013 20:14:47 +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)