On Tue, May 18, 2010 at 9:30 AM, Richard Warburton <richard.warburton@gmail.com> wrote:
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.