cvs commit: fptools/ghc/compiler/basicTypes BasicTypes.lhs fptools/ghc/compiler/coreSyn CoreSyn.lhs fptools/ghc/compiler/main CmdLineOpts.lhs DriverState.hs fptools/ghc/compiler/simplCore FloatIn.lhs FloatOut.lhs OccurAnal.lhs SetLevels.lhs SimplMonad.lhs ...

Simon Peyton Jones simonpj@glass.cse.ogi.edu
Fri, 14 Dec 2001 09:24:06 -0800


simonpj     2001/12/14 09:24:05 PST

  Modified files:
    ghc/compiler/basicTypes BasicTypes.lhs 
    ghc/compiler/coreSyn CoreSyn.lhs 
    ghc/compiler/main    CmdLineOpts.lhs DriverState.hs 
    ghc/compiler/simplCore FloatIn.lhs FloatOut.lhs OccurAnal.lhs 
                           SetLevels.lhs SimplMonad.lhs 
                           SimplUtils.lhs Simplify.lhs 
    ghc/compiler/stranal DmdAnal.lhs 
  Log:
  	-------------------------
  	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.
  
  Revision  Changes    Path
  1.28      +5 -1      fptools/ghc/compiler/basicTypes/BasicTypes.lhs
  1.46      +9 -1      fptools/ghc/compiler/coreSyn/CoreSyn.lhs
  1.154     +7 -2      fptools/ghc/compiler/main/CmdLineOpts.lhs
  1.64      +4 -12     fptools/ghc/compiler/main/DriverState.hs
  1.32      +20 -15    fptools/ghc/compiler/simplCore/FloatIn.lhs
  1.27      +128 -107  fptools/ghc/compiler/simplCore/FloatOut.lhs
  1.64      +4 -5      fptools/ghc/compiler/simplCore/OccurAnal.lhs
  1.54      +16 -10    fptools/ghc/compiler/simplCore/SetLevels.lhs
  1.48      +20 -14    fptools/ghc/compiler/simplCore/SimplMonad.lhs
  1.80      +55 -6     fptools/ghc/compiler/simplCore/SimplUtils.lhs
  1.131     +17 -10    fptools/ghc/compiler/simplCore/Simplify.lhs
  1.35      +1 -1      fptools/ghc/compiler/stranal/DmdAnal.lhs