[project @ 2001-12-14 17:24:03 by simonpj]
authorsimonpj <unknown>
Fri, 14 Dec 2001 17:24:05 +0000 (17:24 +0000)
committersimonpj <unknown>
Fri, 14 Dec 2001 17:24:05 +0000 (17:24 +0000)
commit5f087cf4add4e140e7df05d896ee6b271133f822
treee19ae53c153d5e0893ba1d2782de052d4e00526a
parent5a387d82672b4648c38793a57a69cfda07f1baff
[project @ 2001-12-14 17:24:03 by simonpj]
-------------------------
Performance tuning things
-------------------------

I did some nofib tests, and fixed a number of performance problems.

1.  Things were getting floated to top level, and that prevented
some useful fusion happening.
y = build g
x = foldr k z y

Fixed by arranging that we only get really keen on floating to top
level in the second run of the let-float-out pass.

2.  Some fettling up on the let-floater itself.  It had some parameters
that weren't even being used!  And it was stupidly floating things out
of a one-shot lambda, and the float-in pass didn't float them back in.
I think I fixed both of these problems.

3.  The eta-reducer was not eta-reducing (/\a -> g a) to g.  In general
it has to be a bit careful because "seq" means that (\x -> g x) is
not in general the same as g ---- but it *is* the same for a type lambda.

This turned out to be important in rule matching, where the foldr/build
rule was not firing because the LHS of the rule looked like
foldr k z (/\ a -> g a) = ...
which never matched!  Result, no fusion to speak of!

4.  The simplifier was a bit too gung ho about inlining used-once
things bound to constructor args.  The comment is with Simplify.simplNonRecX.
12 files changed:
ghc/compiler/basicTypes/BasicTypes.lhs
ghc/compiler/coreSyn/CoreSyn.lhs
ghc/compiler/main/CmdLineOpts.lhs
ghc/compiler/main/DriverState.hs
ghc/compiler/simplCore/FloatIn.lhs
ghc/compiler/simplCore/FloatOut.lhs
ghc/compiler/simplCore/OccurAnal.lhs
ghc/compiler/simplCore/SetLevels.lhs
ghc/compiler/simplCore/SimplMonad.lhs
ghc/compiler/simplCore/SimplUtils.lhs
ghc/compiler/simplCore/Simplify.lhs
ghc/compiler/stranal/DmdAnal.lhs