[pypy-commit] pypy ssa-flow: transform_dead_op_vars() is compatible with SSA

rlamy noreply at buildbot.pypy.org
Fri Nov 14 19:06:34 CET 2014


Author: Ronan Lamy <ronan.lamy at gmail.com>
Branch: ssa-flow
Changeset: r74524:c18905e4bc4f
Date: 2014-11-14 04:05 +0000
http://bitbucket.org/pypy/pypy/changeset/c18905e4bc4f/

Log:	transform_dead_op_vars() is compatible with SSA

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
@@ -1291,6 +1291,17 @@
         assert isinstance(link.args[0], Constant)
         assert link.args[0].value == 5
 
+    def test_remove_dead_ops(self):
+        def f():
+            a = [1]
+            b = (a, a)
+            c = type(b)
+        graph = self.codetest(f)
+        simplify_graph(graph)
+        assert graph.startblock.operations == []
+        [link] = graph.startblock.exits
+        assert link.target is graph.returnblock
+
 
 DATA = {'x': 5,
         'y': 6}
diff --git a/rpython/translator/simplify.py b/rpython/translator/simplify.py
--- a/rpython/translator/simplify.py
+++ b/rpython/translator/simplify.py
@@ -1002,9 +1002,10 @@
     eliminate_empty_blocks,
     remove_assertion_errors,
     remove_trivial_links,
-    SSA_to_SSI,
     coalesce_bool,
     transform_dead_op_vars,
+    eliminate_empty_blocks,
+    SSA_to_SSI,
     remove_identical_vars,
     transform_ovfcheck,
     simplify_exceptions,


More information about the pypy-commit mailing list