[pypy-dev] [pypy-svn] pypy default: port test_intbound_addsub_ge to test_pypy_c_new
Hakan Ardo
hakan at debian.org
Thu Apr 14 16:01:09 CEST 2011
On Thu, Apr 14, 2011 at 3:01 PM, Antonio Cuni <anto.cuni at gmail.com> wrote:
>
> Of course the ovf check needs to be there because we don't specialize the loop
> on the value of n. Although it might be cool to be able to do promotion at
> applevel, for those who really want :-)
Well, you can actually (sort of):
def main(n):
i, a = 0, 0
exec """def promote(n):
assert n==%d""" % n
while i < n:
promote(n)
a += i+5
i += 1
return a
With this I get two extra operations in the loop:
i11 = ptr_eq(ConstPtr(ptr10), p7)
guard_false(i11, descr=<Guard4>) [p1, p0, p2, p3, p4, i5, i6]
but p7 is loop-invariant so they should be easy to get rid of. I don't
know why they are not already...
--
Håkan Ardö
More information about the Pypy-dev
mailing list