Improve the simple optimiser
Improve the simple optimiser

The previous version of the simple optimiser would leave
beta-redexes, which was bad for join points.  E.g.

  join j x = ....   -- a join point
  in (\x. j x) y

This would be ok if we beta-reduced the (\x) but not if
we don't.

This patch improves the simple optimiser, to follow the plan
described in "Secrets of the GHC inliner", and implemented in
the Mighty Simplifier.  It turns out not to be too hard to
use the same plan here, and we get slightly better code as
a result.

shlevy/ghc,shlevy/ghc,sdiehl/ghc,ezyang/ghc,ezyang/ghc,ezyang/ghc,sdiehl/ghc,sdiehl/ghc,sdiehl/ghc,shlevy/ghc,ezyang/ghc,sdiehl/ghc,ezyang/ghc,shlevy/ghc,shlevy/ghc,shlevy/ghc,sdiehl/ghc,ezyang/ghc,shlevy/ghc,ezyang/ghc,sdiehl/ghc