diff options
author | simonpj@microsoft.com <unknown> | 2009-01-13 16:49:53 +0000 |
---|---|---|
committer | simonpj@microsoft.com <unknown> | 2009-01-13 16:49:53 +0000 |
commit | 62eeda5aed31173b234b2965ccf4bd6979ffd9a4 (patch) | |
tree | eebec9862e2c7d4918300286a5a75a79a55edc4e /compiler/ghc.cabal.in | |
parent | a17d329568660592dad5c7668fb09f31ab77cd69 (diff) | |
download | haskell-62eeda5aed31173b234b2965ccf4bd6979ffd9a4.tar.gz |
Rewrite CorePrep and improve eta expansion
This patch does two main things
a) Rewrite most of CorePrep to be much easier to understand (I hope!).
The invariants established by CorePrep are now written out, and
the code is more perspicuous. It is surpringly hard to get right,
and the old code had become quite incomprehensible.
b) Rewrite the eta-expander so that it does a bit of simplifying
on-the-fly, and thereby guarantees to maintain the CorePrep
invariants. This make it much easier to use from CorePrep, and
is a generally good thing anyway.
A couple of pieces of re-structuring:
* I moved the eta-expander and arity analysis stuff into a new
module coreSyn/CoreArity.
Max will find that the type CoreArity.EtaInfo looks strangely
familiar.
* I moved a bunch of comments from Simplify to OccurAnal; that's
why it looks as though there's a lot of lines changed in those
modules.
On the way I fixed various things
- Function arguments are eta expanded
f (map g) ===> let s = \x. map g x in f s
- Trac #2368
The result is a modest performance gain, I think mainly due
to the first of these changes:
--------------------------------------------------------------------------------
Program Size Allocs Runtime Elapsed
--------------------------------------------------------------------------------
Min -1.0% -17.4% -19.1% -46.4%
Max +0.3% +0.5% +5.4% +53.8%
Geometric Mean -0.1% -0.3% -7.0% -10.2%
Diffstat (limited to 'compiler/ghc.cabal.in')
-rw-r--r-- | compiler/ghc.cabal.in | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/compiler/ghc.cabal.in b/compiler/ghc.cabal.in index 22181fd2ea..80132a64e2 100644 --- a/compiler/ghc.cabal.in +++ b/compiler/ghc.cabal.in @@ -241,6 +241,7 @@ Library ClosureInfo CodeGen SMRep + CoreArity CoreFVs CoreLint CorePrep |