Loop unrolling + fusion ?

Max Bolingbroke batterseapower at hotmail.com
Mon Mar 9 20:46:17 EDT 2009


2009/3/9 Claus Reinke <claus.reinke at talk21.com>:
 But if you annotate all your unrolled and peeled new definitions as
> NOINLINE, do you still get the optimizations you want? There are probably a
> few GHC optimizations that can "look through" non-recursive
> lets, but RULES are not among those.

The benefit that comes immediately to mind is extra freedom for the
code generator. If we have several copies of the body of e.g. a loop
it may be able to schedule instructions much better. This is why GCC
unrolls loops, of course. Of course, Core may not be the best place to
do this sort of unrolling as Roman pointed out earlier in the thread.
But yeah, beyond this I don't /think/ that non-inlined duplications
would help GHC at all (it might be a different story if we did partial
inlining).

All the best,
Max


More information about the Glasgow-haskell-users mailing list