On Tue, Aug 31, 2010 at 09:25, Hakan Ardo <hakan@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@gmail.com> wrote:
On Sun, Aug 29, 2010 at 2:03 PM, Carl Friedrich Bolz <cfbolz@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@codespeak.net http://codespeak.net/mailman/listinfo/pypy-dev
-- Paolo Giarrusso - Ph.D. Student http://www.informatik.uni-marburg.de/~pgiarrusso/