Loop optimisation with identical counters

Roman Leshchinskiy rl at cse.unsw.edu.au
Fri Nov 5 22:42:23 EDT 2010


On 06/11/2010, at 02:27, Sebastian Fischer wrote:

> Interesting. This approach requires `f` to be inlined into its call site in order to eliminate the redundant argument. This is different from the proposal to provide a specialized version of `f` (where the arguments are combined) which could be reused at different call sites.

Which proposal do you mean? I'm not sure something like that is feasible without knowing the call sites. You have to know which arguments to combine.

> How many call sites with identical arguments are there in the generated code that triggered this discussion and in the stream fusion code that would benefit from this optimization?

In stream fusion code, there is normally exactly one call site. I suspect that the Christian's example has also been derived from stream fusion code.

Roman




More information about the Glasgow-haskell-users mailing list