[pypy-commit] pypy exc-later: Move specialize_exceptions() call to simplify_graph()

rlamy noreply at buildbot.pypy.org
Tue Mar 17 20:29:32 CET 2015


Author: Ronan Lamy <ronan.lamy at gmail.com>
Branch: exc-later
Changeset: r76441:62249e9c633f
Date: 2015-03-13 04:19 +0000
http://bitbucket.org/pypy/pypy/changeset/62249e9c633f/

Log:	Move specialize_exceptions() call to simplify_graph()

diff --git a/rpython/flowspace/flowcontext.py b/rpython/flowspace/flowcontext.py
--- a/rpython/flowspace/flowcontext.py
+++ b/rpython/flowspace/flowcontext.py
@@ -385,8 +385,6 @@
             block = self.pendingblocks.popleft()
             if not block.dead:
                 self.record_block(block)
-        from rpython.translator.simplify import specialize_exceptions
-        specialize_exceptions(graph)
 
     def record_block(self, block):
         self.setstate(block.framestate)
diff --git a/rpython/flowspace/test/test_objspace.py b/rpython/flowspace/test/test_objspace.py
--- a/rpython/flowspace/test/test_objspace.py
+++ b/rpython/flowspace/test/test_objspace.py
@@ -1033,6 +1033,7 @@
             f2 = types.FunctionType(new_c, locals(), 'f')
 
             graph = self.codetest(f2)
+            simplify_graph(graph)
             all_ops = self.all_operations(graph)
             assert all_ops == {'newlist': 1, 'getattr': 1, 'simple_call': 1,
                                'iter': 1, 'next': 1}
@@ -1239,6 +1240,7 @@
         def f(iterable):
             return [5 for x in iterable]
         graph = self.codetest(f)
+        simplify_graph(graph)
         assert self.all_operations(graph) == {'getattr': 1,
                                               'iter': 1, 'newlist': 1,
                                               'next': 1, 'simple_call': 1}
diff --git a/rpython/translator/simplify.py b/rpython/translator/simplify.py
--- a/rpython/translator/simplify.py
+++ b/rpython/translator/simplify.py
@@ -1116,11 +1116,12 @@
 all_passes = [
     transform_dead_op_vars,
     eliminate_empty_blocks,
-    remove_assertion_errors,
     remove_identical_vars_SSA,
     constfold_exitswitch,
     remove_trivial_links,
     SSA_to_SSI,
+    specialize_exceptions,
+    remove_assertion_errors,
     coalesce_bool,
     transform_ovfcheck,
     simplify_exceptions,
@@ -1132,6 +1133,7 @@
     """inplace-apply all the existing optimisations to the graph."""
     if passes is True:
         passes = all_passes
+    #import pdb; pdb.set_trace()
     for pass_ in passes:
         pass_(graph)
     checkgraph(graph)


More information about the pypy-commit mailing list