[pypy-svn] r66994 - in pypy/branch/pyjitpl5/pypy/jit/backend/x86: . test
fijal at codespeak.net
fijal at codespeak.net
Wed Aug 19 18:34:52 CEST 2009
Author: fijal
Date: Wed Aug 19 18:34:52 2009
New Revision: 66994
Modified:
pypy/branch/pyjitpl5/pypy/jit/backend/x86/regalloc.py
pypy/branch/pyjitpl5/pypy/jit/backend/x86/test/test_regalloc.py
Log:
(pedronis, fijal) A test and a fix
Modified: pypy/branch/pyjitpl5/pypy/jit/backend/x86/regalloc.py
==============================================================================
--- pypy/branch/pyjitpl5/pypy/jit/backend/x86/regalloc.py (original)
+++ pypy/branch/pyjitpl5/pypy/jit/backend/x86/regalloc.py Wed Aug 19 18:34:52 2009
@@ -184,8 +184,9 @@
if (operations[i + 1].opnum != rop.GUARD_TRUE and
operations[i + 1].opnum != rop.GUARD_FALSE):
return False
- if (operations[i + 1].args[0] is not op.result or
- self.longevity[op.result][1] > i + 1 or
+ if operations[i + 1].args[0] is not op.result:
+ return False
+ if (self.longevity[op.result][1] > i + 1 or
op.result in operations[i + 1].inputargs):
print "boolean flag not optimized away"
assert False
Modified: pypy/branch/pyjitpl5/pypy/jit/backend/x86/test/test_regalloc.py
==============================================================================
--- pypy/branch/pyjitpl5/pypy/jit/backend/x86/test/test_regalloc.py (original)
+++ pypy/branch/pyjitpl5/pypy/jit/backend/x86/test/test_regalloc.py Wed Aug 19 18:34:52 2009
@@ -294,3 +294,16 @@
jump(i0, i18, i15, i16, i2, i1, i4)
'''
self.interpret(ops, [0, 1, 2, 3])
+
+class TestRegallocCompOps(BaseTestRegalloc):
+
+ def test_cmp_op_0(self):
+ ops = '''
+ [i0, i3]
+ i2 = int_lt(i0, 100)
+ guard_true(i3)
+ fail(1, i2)
+ fail(0, i2)
+ '''
+ self.interpret(ops, [0, 1])
+ assert self.getint(0) == 0
More information about the Pypy-commit
mailing list