[commit: ghc] better-ho-cardinality: Improve the handling of used-once stuff (20cc594)

git at git.haskell.org git at git.haskell.org
Mon Dec 2 17:35:46 UTC 2013


Repository : ssh://git@git.haskell.org/ghc

On branch  : better-ho-cardinality
Link       : http://ghc.haskell.org/trac/ghc/changeset/20cc59419b5fae60eea9c81f56020ef15256dc84/ghc

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

commit 20cc59419b5fae60eea9c81f56020ef15256dc84
Author: Simon Peyton Jones <simonpj at microsoft.com>
Date:   Fri Nov 22 17:13:05 2013 +0000

    Improve the handling of used-once stuff
    
    Joachim and I are committing this onto a branch so that we can share it,
    but we expect to do a bit more work before merging it onto head.
    
    Nofib staus:
      - Most programs, no change
      - A few improve
      - A couple get worse (cacheprof, tak, rfib)
    Investigating the "get worse" set is what's holding up putting this
    on head.
    
    The major issue is this.  Consider
    
        map (f g) ys
    
    where f's demand signature looks like
    
       f :: <L,C1(C1(U))> -> <L,U> -> .
    
    So 'f' is not saturated.  What demand do we place on g?
    Answer
            C(C1(U))
    That is, the inner C1 should stay, even though f is not saturated.
    
    I found that this made a significant difference in the demand signatures
    inferred in GHC.IO, which uses lots of higher-order exception handlers.
    
    I also had to add used-once demand signatures for some of the
    'catch' primops, so that we know their handlers are only called once.


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

20cc59419b5fae60eea9c81f56020ef15256dc84
 compiler/basicTypes/BasicTypes.lhs |   55 ++++++++
 compiler/basicTypes/Demand.lhs     |  251 ++++++++++++++++++------------------
 compiler/basicTypes/Id.lhs         |   64 ++++++---
 compiler/basicTypes/IdInfo.lhs     |   70 +++-------
 compiler/basicTypes/MkId.lhs       |    3 +-
 compiler/coreSyn/CoreArity.lhs     |   45 +++----
 compiler/coreSyn/CoreUtils.lhs     |    7 +
 compiler/coreSyn/PprCore.lhs       |   33 +++--
 compiler/prelude/PrelRules.lhs     |   80 ++++++++++--
 compiler/prelude/primops.txt.pp    |   10 +-
 compiler/simplCore/OccurAnal.lhs   |   63 +++++----
 compiler/simplCore/SetLevels.lhs   |    4 +-
 compiler/simplCore/SimplUtils.lhs  |   19 ++-
 compiler/specialise/SpecConstr.lhs |    2 +-
 compiler/stranal/DmdAnal.lhs       |   31 +++--
 compiler/stranal/WorkWrap.lhs      |   37 ++++--
 compiler/stranal/WwLib.lhs         |   64 ++++-----
 17 files changed, 492 insertions(+), 346 deletions(-)

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

    git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc 20cc59419b5fae60eea9c81f56020ef15256dc84


More information about the ghc-commits mailing list