[pypy-svn] r17560 - in pypy/dist/pypy/translator/backendopt: . test

arigo at codespeak.net arigo at codespeak.net
Wed Sep 14 15:16:04 CEST 2005


Author: arigo
Date: Wed Sep 14 15:16:03 2005
New Revision: 17560

Modified:
   pypy/dist/pypy/translator/backendopt/all.py
   pypy/dist/pypy/translator/backendopt/test/test_all.py
Log:
Disable inlining and malloc removal for now -- it seems
to produce strange infinite loops in 'pypy-c'.


Modified: pypy/dist/pypy/translator/backendopt/all.py
==============================================================================
--- pypy/dist/pypy/translator/backendopt/all.py	(original)
+++ pypy/dist/pypy/translator/backendopt/all.py	Wed Sep 14 15:16:03 2005
@@ -6,7 +6,9 @@
 from pypy.translator import simplify
 
 
-def backend_optimizations(translator, inline_threshold=1, ssa_form=True):
+def backend_optimizations(translator, inline_threshold=0,   # XXX in-progress, should be 1
+                                      mallocs=False,        # XXX in-progress
+                                      ssa_form=True):
     # remove obvious no-ops
     for graph in translator.flowgraphs.values():
         remove_same_as(graph)
@@ -17,12 +19,13 @@
         auto_inlining(translator, inline_threshold)
 
     # vaporize mallocs
-    for graph in translator.flowgraphs.values():
-        if remove_simple_mallocs(graph):
-            # remove typical leftovers from malloc removal
-            remove_same_as(graph)
-            simplify.eliminate_empty_blocks(graph)
-            simplify.transform_dead_op_vars(graph)
+    if mallocs:
+        for graph in translator.flowgraphs.values():
+            if remove_simple_mallocs(graph):
+                # remove typical leftovers from malloc removal
+                remove_same_as(graph)
+                simplify.eliminate_empty_blocks(graph)
+                simplify.transform_dead_op_vars(graph)
 
     if ssa_form:
         for graph in translator.flowgraphs.values():

Modified: pypy/dist/pypy/translator/backendopt/test/test_all.py
==============================================================================
--- pypy/dist/pypy/translator/backendopt/test/test_all.py	(original)
+++ pypy/dist/pypy/translator/backendopt/test/test_all.py	Wed Sep 14 15:16:03 2005
@@ -42,7 +42,7 @@
     t = Translator(big)
     t.annotate([])
     t.specialize()
-    backend_optimizations(t, inline_threshold=100)
+    backend_optimizations(t, inline_threshold=100, mallocs=True)
 
     graph = t.getflowgraph()
     check_malloc_removed(graph)
@@ -62,7 +62,7 @@
     t = Translator(f)
     t.annotate([int])
     t.specialize()
-    t.backend_optimizations()
+    t.backend_optimizations(inline_threshold=1, mallocs=True)
     # this also checks that the BASE_INLINE_THRESHOLD is enough for 'for' loops
 
     graph = t.getflowgraph()



More information about the Pypy-commit mailing list