[pypy-dev] jit-bounds branch (was: Loop invaraints)
hakan at debian.org
Tue Sep 7 10:51:00 CEST 2010
there is now a package-version of optimizeopt in the jit-bounds
branch. In optimizeopt/__init__.py a chain of optimizers is created:
optimizations = [OptIntBounds(),
The opperations are passed from one optimizer to the next, which means
we keep the single loop over the iterations. Each optimazation is
located in it's own file, and it should be straight forward to add
more optimization and even make them optional using runtime arguments
if that is of interest.
I believe this branch is ready to be merged now.
On Thu, Sep 2, 2010 at 10:22 AM, Paolo Giarrusso <p.giarrusso at gmail.com> wrote:
> On Tue, Aug 31, 2010 at 09:25, Hakan Ardo <hakan at debian.org> wrote:
> > Ok, so we split it up into a set of Optimization classes in separate
> > files. Each containing a subset of the optimize_... methods. Then we
> > have the propagate_forward method iterate over the instructions
> > passing them to one Optimization after the other? That way we keep the
> > single iteration over the instructions. Would it be preferable to
> > separate them even more and have each Optimization contain it's own
> > loop over the instructions?
> But won't this affect performance? Which is very important in a JIT compiler.
> When compiling traces bigger than a cacheline, it might even affect
> locality, i.e. be an important performance problem.
> Unless your RPython compiler can join the loops. If they are just
> loops, it could. If they are tree visits, it likely can't; it's done
> by the Haskell compiler (google Haskell, stream fusion, shortcut
> deforestation, I guess), but the techniques are unlikely to generalize
> to languages with side effects; it's also done/doable in some
> Domain-Specific Languages for tree visitors.
> > On Sun, Aug 29, 2010 at 10:05 PM, Maciej Fijalkowski <fijall at gmail.com> wrote:
> >> On Sun, Aug 29, 2010 at 2:03 PM, Carl Friedrich Bolz <cfbolz at gmx.de> wrote:
> >>> On 08/29/2010 01:49 PM, Hakan Ardo wrote:
> >>>>> P.S.: A bit unrelated, but a comment on the jit-bounds branch: I think
> >>>>> it would be good if the bounds-related optimizations could move out of
> >>>>> optimizeopt.py to their own file, because otherwise optimizeopt.py is
> >>>>> getting really unwieldy. Does that make sense?
> >>>> Well, class IntBound and the propagate_bounds_ methods could probably
> >>>> be moved elsewhere, but a lot of the work is done in optimize_...
> >>>> methods, which I'm not so sure it would make sens to split up.
> >>> I guess then the things that can be sanely moved should move. The file
> >>> is nearly 2000 lines, which is way too big. I guess also the heap
> >>> optimizations could go to their own file.
> >>> Carl Friedrich
> >> How about a couple of files (preferably small) each containing a
> >> contained optimization if possible? (maybe a package?)
> > --
> > Håkan Ardö
> > _______________________________________________
> > pypy-dev at codespeak.net
> > http://codespeak.net/mailman/listinfo/pypy-dev
> Paolo Giarrusso - Ph.D. Student
More information about the Pypy-dev