Tue Jan 13 08:49:53 PST 2009  [email protected]
  * Rewrite CorePrep and improve eta expansion
  Ignore-this: 910d1d613592c116714c324618b1e45c
  
  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%
  
  
  

    A ./compiler/coreSyn/CoreArity.lhs
    M ./compiler/coreSyn/CorePrep.lhs -510 +528
    M ./compiler/coreSyn/CoreSubst.lhs -1 +1
    M ./compiler/coreSyn/CoreTidy.lhs -1 +1
    M ./compiler/coreSyn/CoreUtils.lhs -408
    M ./compiler/ghc.cabal.in +1
    M ./compiler/main/TidyPgm.lhs -1 +2
    M ./compiler/simplCore/OccurAnal.lhs +71
    M ./compiler/simplCore/SimplUtils.lhs -9 +19
    M ./compiler/simplCore/Simplify.lhs -57 +5
    M ./compiler/stgSyn/CoreToStg.lhs -1 +2
    M ./compiler/stranal/DmdAnal.lhs -1 +2
    M ./compiler/stranal/WorkWrap.lhs -1 +2

View patch online:
http://darcs.haskell.org/ghc/_darcs/patches/20090113164953-1287e-bc7c88773f95d7bee5fc8578b52e264447815c71.gz

_______________________________________________
Cvs-ghc mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/cvs-ghc

Reply via email to