[pypy-dev] Interpreter level array implementation
Hakan Ardo
hakan at debian.org
Sun Jul 4 10:50:25 CEST 2010
On Sat, Jul 3, 2010 at 8:20 AM, Maciej Fijalkowski <fijall at gmail.com> wrote:
>>> Yes. We don't do loop invariant optimizations for some reasons, the
>>> best of it being the fact that to loop you can always add a bridge
>>> which will invalidate this invariant.
>>
>> Are you telling me that you probably never will include that kind of
>> optimization because of the limitations it imposes on other parts of
>> the jit or just that it would be a lot of work to get it in place?
>
> It requires thinking. It's harder to do because we don't know
> statically upfront how many paths we'll compile to assembler, but I
> can think about ways to mitigate that.
Could it be treated similar to how you handle:
s=0
i=0
while i<100000:
s+=i
i+=1
if i>50000:
i=float(i)
which nicely generates two separate traces I believe...
--
Håkan Ardö
More information about the Pypy-dev
mailing list