patch applied (ghc): Improve eta reduction, to reduce Simplifier iterations

Simon Peyton Jones simonpj at microsoft.com
Mon Dec 3 10:07:58 EST 2007


Mon Dec  3 07:00:39 PST 2007  simonpj at microsoft.com
  * Improve eta reduction, to reduce Simplifier iterations
  
  I finally got around to investigating why the Simplifier was sometimes
  iterating so often.  There's a nice example in Text.ParserCombinators.ReadPrec,
  which produced:
  
  NOTE: Simplifier still going after 3 iterations; bailing out.  Size = 339
  NOTE: Simplifier still going after 3 iterations; bailing out.  Size = 339
  NOTE: Simplifier still going after 3 iterations; bailing out.  Size = 339
  
  No progress is being made.  It turned out that an interaction between
  eta-expansion, casts, and eta reduction was responsible. The change is
  small and simple, in SimplUtils.mkLam: do not require the body to be
  a Lam when floating the cast outwards.  
  
  I also discovered a missing side condition in the same equation, so fixing
  that is good too.  Now there is no loop when compiling ReadPrec.
  
  Should do a full nofib run though.
  

    M ./compiler/simplCore/SimplUtils.lhs -8 +26



More information about the Cvs-ghc mailing list