Author: Maciej Fijalkowski <[email protected]>
Branch: result-in-resops
Changeset: r58494:4db10840977e
Date: 2012-10-27 11:28 +0200
http://bitbucket.org/pypy/pypy/changeset/4db10840977e/
Log: hooray 11 tests passing
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
@@ -238,18 +238,18 @@
return op
def optimize_INT_GT(self, op):
- v1 = self.getvalue(op.getarg(0))
- v2 = self.getvalue(op.getarg(1))
+ v1 = self.getforwarded(op.getarg(0))
+ v2 = self.getforwarded(op.getarg(1))
if v1.getintbound().known_gt(v2.getintbound()):
self.make_constant_int(op, 1)
elif v1.getintbound().known_le(v2.getintbound()) or v1 is v2:
self.make_constant_int(op, 0)
else:
- self.emit_operation(op)
+ return op
def optimize_INT_LE(self, op):
- v1 = self.getvalue(op.getarg(0))
- v2 = self.getvalue(op.getarg(1))
+ v1 = self.getforwarded(op.getarg(0))
+ v2 = self.getforwarded(op.getarg(1))
if v1.getintbound().known_le(v2.getintbound()) or v1 is v2:
self.make_constant_int(op, 1)
elif v1.getintbound().known_gt(v2.getintbound()):
@@ -365,9 +365,9 @@
self.make_int_le(op.getarg(0), op.getarg(1))
def propagate_bounds_INT_LE(self, op):
- r = self.getvalue(op)
+ r = self.getforwarded(op)
if r.is_constant():
- if r.op.same_constant(CONST_1):
+ if r.same_constant(CONST_1):
self.make_int_le(op.getarg(0), op.getarg(1))
else:
self.make_int_gt(op.getarg(0), op.getarg(1))
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
@@ -285,15 +285,15 @@
ops = """
[i0]
i1 = int_gt(i0, 0)
- guard_true(i1) []
+ guard_true(i1)
i2 = int_le(i0, 0)
- guard_false(i2) []
+ guard_false(i2)
jump(i0)
"""
expected = """
[i0]
i1 = int_gt(i0, 0)
- guard_true(i1) []
+ guard_true(i1)
jump(i0)
"""
self.optimize_loop(ops, expected)
@@ -302,15 +302,15 @@
ops = """
[i0]
i1 = int_gt(i0, 0)
- guard_true(i1) []
+ guard_true(i1)
i2 = int_lt(0, i0)
- guard_true(i2) []
+ guard_true(i2)
jump(i0)
"""
expected = """
[i0]
i1 = int_gt(i0, 0)
- guard_true(i1) []
+ guard_true(i1)
jump(i0)
"""
self.optimize_loop(ops, expected)
@@ -319,15 +319,15 @@
ops = """
[i0]
i1 = int_gt(i0, 0)
- guard_true(i1) []
+ guard_true(i1)
i2 = int_ge(0, i0)
- guard_false(i2) []
+ guard_false(i2)
jump(i0)
"""
expected = """
[i0]
i1 = int_gt(i0, 0)
- guard_true(i1) []
+ guard_true(i1)
jump(i0)
"""
self.optimize_loop(ops, expected)
@@ -335,16 +335,16 @@
def test_remove_consecutive_guard_value_constfold(self):
ops = """
[i0]
- guard_value(i0, 0) []
+ guard_value(i0, 0)
i1 = int_add(i0, 1)
- guard_value(i1, 1) []
+ guard_value(i1, 1)
i2 = int_add(i1, 2)
escape(i2)
jump(i0)
"""
expected = """
[i0]
- guard_value(i0, 0) []
+ guard_value(i0, 0)
escape(3)
jump(0)
"""
@@ -353,7 +353,7 @@
def test_remove_guard_value_if_constant(self):
ops = """
[p1]
- guard_value(p1, ConstPtr(myptr)) []
+ guard_value(p1, ConstPtr(myptr))
jump(ConstPtr(myptr))
"""
expected = """
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit