[pypy-svn] pypy default: generalized floordiv intbound propagation

hakanardo commits-noreply at bitbucket.org
Thu Jan 6 17:53:55 CET 2011


Author: Hakan Ardo <hakan at debian.org>
Branch: 
Changeset: r40417:1529a3488b0a
Date: 2011-01-06 11:14 +0100
http://bitbucket.org/pypy/pypy/changeset/1529a3488b0a/

Log:	generalized floordiv intbound propagation

diff --git a/pypy/jit/metainterp/optimizeopt/intbounds.py b/pypy/jit/metainterp/optimizeopt/intbounds.py
--- a/pypy/jit/metainterp/optimizeopt/intbounds.py
+++ b/pypy/jit/metainterp/optimizeopt/intbounds.py
@@ -114,10 +114,8 @@
         v1 = self.getvalue(op.getarg(0))
         v2 = self.getvalue(op.getarg(1))
         self.emit_operation(op)
-        if v1.intbound.known_ge(IntBound(0, 0)) and \
-           v2.intbound.known_ge(IntBound(0, 0)):
-            r = self.getvalue(op.result)
-            r.intbound.make_ge(IntLowerBound(0))
+        r = self.getvalue(op.result)
+        r.intbound.intersect(v1.intbound.div_bound(v2.intbound))
 
     def optimize_INT_ADD_OVF(self, op):
         v1 = self.getvalue(op.getarg(0))


More information about the Pypy-commit mailing list