Skip to content

Instantly share code, notes, and snippets.

@zain
Created October 15, 2013 21:22
Show Gist options
  • Select an option

  • Save zain/6998875 to your computer and use it in GitHub Desktop.

Select an option

Save zain/6998875 to your computer and use it in GitHub Desktop.
# i added this test
def test_int_add_ovf_commutative(self):
ops = """
[i0, i1]
i2 = int_add_ovf(i0, i1)
i3 = int_add_ovf(i1, i0)
jump(i2, i3)
"""
expected = """
[i0, i1]
i2 = int_add_ovf(i0, i1)
jump(i2, i2)
"""
self.optimize_loop(ops, expected)
# it fails because ops are actually:
(Pdb) print '\n'.join([str(o) for o in loop.operations])
label(i0, i1, descr=<rpython.jit.metainterp.history.TargetToken object at 0x000000010633c528>)
i3 = int_add_ovf(i1, i0)
jump(i2, i3, descr=<rpython.jit.metainterp.history.TargetToken object at 0x000000010633c528>)
@zain
Copy link
Author

zain commented Oct 15, 2013

(Pdb) print '\n'.join([str(o) for o in loop.operations])
label(i0, i1, descr=<rpython.jit.metainterp.history.TargetToken object at 0x000000010633c528>)
i3 = int_add_ovf(i1, i0)
jump(i2, i3, descr=<rpython.jit.metainterp.history.TargetToken object at 0x000000010633c528>)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment