[commit: ghc] master: Introduce CPR for sum types (Trac #5075) (d3b8991)

Simon Peyton Jones simonpj at microsoft.com
Wed Jan 30 15:34:27 CET 2013


Repository : ssh://darcs.haskell.org//srv/darcs/ghc

On branch  : master

http://hackage.haskell.org/trac/ghc/changeset/d3b8991be3875302ca6d1a4ef6e72891e9567dd5

>---------------------------------------------------------------

commit d3b8991be3875302ca6d1a4ef6e72891e9567dd5
Author: Simon Peyton Jones <simonpj at microsoft.com>
Date:   Thu Jan 24 14:50:50 2013 +0000

    Introduce CPR for sum types (Trac #5075)
    
    The main payload of this patch is to extend CPR so that it
    detects when a function always returns a result constructed
    with the *same* constructor, even if the constructor comes from
    a sum type.  This doesn't matter very often, but it does improve
    some things (results below).
    
    Binary sizes increase a little bit, I think because there are more
    wrappers.  This with -split-objs.  Without split-ojbs binary sizes
    increased by 6% even for HelloWorld.hs.  It's hard to see exactly why,
    but I think it was because System.Posix.Types.o got included in the
    linked binary, whereas it didn't before.
    
            Program           Size    Allocs   Runtime   Elapsed  TotalMem
              fluid          +1.8%     -0.3%      0.01      0.01     +0.0%
                tak          +2.2%     -0.2%      0.02      0.02     +0.0%
               ansi          +1.7%     -0.3%      0.00      0.00     +0.0%
          cacheprof          +1.6%     -0.3%     +0.6%     +0.5%     +1.4%
            parstof          +1.4%     -4.4%      0.00      0.00     +0.0%
            reptile          +2.0%     +0.3%      0.02      0.02     +0.0%
    ----------------------------------------------------------------------
                Min          +1.1%     -4.4%     -4.7%     -4.7%    -15.0%
                Max          +2.3%     +0.3%     +8.3%     +9.4%    +50.0%
     Geometric Mean          +1.9%     -0.1%     +0.6%     +0.7%     +0.3%
    
    Other things in this commit
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~
    * Got rid of the Lattice class in Demand
    
    * Refactored the way that products and newtypes are
      decomposed (no change in functionality)

 compiler/basicTypes/BasicTypes.lhs  |   17 ++
 compiler/basicTypes/DataCon.lhs     |   60 -----
 compiler/basicTypes/Demand.lhs      |  427 ++++++++++++++++++-----------------
 compiler/basicTypes/MkId.lhs        |   11 +-
 compiler/cmm/CLabel.hs              |    1 -
 compiler/coreSyn/CoreLint.lhs       |   12 +-
 compiler/coreSyn/CoreSyn.lhs        |    7 +-
 compiler/deSugar/DsCCall.lhs        |   45 ++++-
 compiler/deSugar/DsForeign.lhs      |    2 +-
 compiler/prelude/PrelRules.lhs      |    2 +-
 compiler/simplCore/Simplify.lhs     |    5 +-
 compiler/specialise/SpecConstr.lhs  |    2 +-
 compiler/stranal/DmdAnal.lhs        |   47 +++-
 compiler/stranal/WwLib.lhs          |  208 ++++++++----------
 compiler/types/Coercion.lhs         |   62 ++++--
 compiler/types/FamInstEnv.lhs       |   26 +--
 compiler/types/TyCon.lhs            |   25 ++-
 compiler/types/Type.lhs             |   26 +--
 compiler/vectorise/Vectorise/Exp.hs |   10 +-
 19 files changed, 512 insertions(+), 483 deletions(-)


Diff suppressed because of size. To see it, use:

    git show d3b8991be3875302ca6d1a4ef6e72891e9567dd5



More information about the ghc-commits mailing list