[project @ 2000-12-07 09:28:42 by simonpj]
authorsimonpj <unknown>
Thu, 7 Dec 2000 09:28:43 +0000 (09:28 +0000)
committersimonpj <unknown>
Thu, 7 Dec 2000 09:28:43 +0000 (09:28 +0000)
commit0b62f53e6da34769aa1bf8409d9987a5311bb516
tree13ce6767e6ab78ab3b96ae36073bf8c3a9fdae52
parent966ad019456f8a5f3aac409f75997a1c694a3a7b
[project @ 2000-12-07 09:28:42 by simonpj]
Do a better job of eta expansion.

This showed up in one of Manuel's programs, where he got code like:

    $wsimpleGen
     ww
     (\ i :: Int ->
  case i of wild1 { I# i# ->
  case w of wild2 { I# e# ->
  __coerce (ST RealWorld ())
  (\ s# :: (State# RealWorld) ->
       case writeIntArray# @ RealWorld mba# i# e# s#
       of s2#1 { __DEFAULT ->
       (# s2#1, () #)
       })
  }
  })
     s2#

The argument wasn't eta expanded, so it got right through to
the code generator as two separte lambdas.

Needless to say, I fiddled around with things in a vain attempt
to tidy them up.  Yell if anything seems to go wrong, or perfomance
drops on any programs.
ghc/compiler/basicTypes/UniqSupply.lhs
ghc/compiler/coreSyn/CoreSat.lhs
ghc/compiler/coreSyn/CoreUtils.lhs
ghc/compiler/simplCore/SimplMonad.lhs
ghc/compiler/simplCore/SimplUtils.lhs
ghc/compiler/simplCore/Simplify.lhs
ghc/compiler/specialise/Specialise.lhs