Author: Carl Friedrich Bolz <[email protected]>
Branch: better-storesink
Changeset: r88501:38b30af12c5c
Date: 2016-11-20 22:46 +0100
http://bitbucket.org/pypy/pypy/changeset/38b30af12c5c/

Log:    remove the ability to deal with elidable calls: this is never useful
        anywhere in pypy

diff --git a/rpython/translator/backendopt/cse.py 
b/rpython/translator/backendopt/cse.py
--- a/rpython/translator/backendopt/cse.py
+++ b/rpython/translator/backendopt/cse.py
@@ -301,18 +301,7 @@
 
             can_fold_op = can_fold(op)
             has_side_effects_op = has_side_effects(op)
-            if op.opname == "direct_call":
-                funcobj = op.args[0].value._obj
-                func = getattr(funcobj, '_callable', None)
-                elidable = getattr(func, "_elidable_function_", False)
-                if elidable:
-                    # can't hash pointers, so use the graph directly
-                    key = ("direct_call", op.result.concretetype,
-                           (funcobj.graph, ) +
-                               tuple([self._var_rep(arg)
-                                   for arg in op.args[1:]]))
-                    can_fold_op = True
-            elif can_fold_op:
+            if can_fold_op:
                 key = (op.opname, op.result.concretetype,
                        tuple([self._var_rep(arg) for arg in op.args]))
 
diff --git a/rpython/translator/backendopt/test/test_cse.py 
b/rpython/translator/backendopt/test/test_cse.py
--- a/rpython/translator/backendopt/test/test_cse.py
+++ b/rpython/translator/backendopt/test/test_cse.py
@@ -557,28 +557,6 @@
             return len(l)
         self.check(f, [int], fullopts=True, getarraysize=0)
 
-    def test_remove_duplicate_elidable_call(self):
-        @jit.elidable
-        def p(x):
-            return x + 1
-
-        def f(x):
-            return p(x) + p(x)
-
-        self.check(f, [int], direct_call=1)
-
-    def test_remove_duplicate_elidable_call_raises(self):
-        @jit.elidable
-        def p(x):
-            return x + 1
-
-        def f(x):
-            try:
-                return p(x) + p(x)
-            except IndexError:
-                return -5
-
-        self.check(f, [int], direct_call=2)
 
 def fakevar(name='v'):
     var = Variable(name)
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to