
18 May
2010
18 May
'10
4:43 p.m.
A colleague of mine pointed out that ghc wasn't performing as he expected when optimising some code. I wonder if anyone could offer any insight as to why its not noting this common subexpression:
GHC performs almost no common subexpression elimination, the reasons being that it can introduce space leaks and undesired extra laziness.
Is there any way to encourage it to do so, for example compilation flags? Or is it generally best to hand apply these kind of optimisations. regards, Richard