diff 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 diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/python/optimize.py	Wed Jul 31 17:57:03 2013 +0200
@@ -0,0 +1,23 @@
+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()
+
+
+