Author: Alex Gaynor <alex.gay...@gmail.com>
Branch: 
Changeset: r46260:22863ec20f46
Date: 2011-08-03 17:00 -0700
http://bitbucket.org/pypy/pypy/changeset/22863ec20f46/

Log:    a commented out, failing, optimizeopt test. it fails because of how
        bounds are propogated. it is known that the result of the rshift is
        precisely bounded at 0, however it isn't actually a constant.

diff --git a/pypy/jit/metainterp/optimizeopt/test/test_optimizebasic.py 
b/pypy/jit/metainterp/optimizeopt/test/test_optimizebasic.py
--- a/pypy/jit/metainterp/optimizeopt/test/test_optimizebasic.py
+++ b/pypy/jit/metainterp/optimizeopt/test/test_optimizebasic.py
@@ -4644,6 +4644,24 @@
         """
         self.optimize_loop(ops, expected)
 
+        # This the sequence of resoperations that is generated for a Python
+        # app-level int % int, when the modulus is constant it should be
+        # optimized to a single CPU instruction.
+        # ops = """
+        # [i0]
+        # i1 = int_mod(i0, 2)
+        # i2 = int_rshift(i1, 63)
+        # i3 = int_and(2, i2)
+        # i4 = int_add(i1, i3)
+        # finish(i4)
+        # """
+        # expected = """
+        # [i0]
+        # i1 = int_mod(i0, 2)
+        # finish(i1)
+        # """
+        # self.optimize_loop(ops, expected)
+
 
 class TestLLtype(BaseTestOptimizeBasic, LLtypeMixin):
     pass
diff --git a/pypy/jit/tool/oparser.py b/pypy/jit/tool/oparser.py
--- a/pypy/jit/tool/oparser.py
+++ b/pypy/jit/tool/oparser.py
@@ -240,7 +240,7 @@
             fail_args = None
             if opnum == rop.FINISH:
                 if descr is None and self.invent_fail_descr:
-                    descr = self.invent_fail_descr(self.model)
+                    descr = self.invent_fail_descr(self.model, fail_args)
             elif opnum == rop.JUMP:
                 if descr is None and self.invent_fail_descr:
                     descr = self.looptoken
_______________________________________________
pypy-commit mailing list
pypy-commit@python.org
http://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to