[commit: ghc] wip/better-ho-cardinality: Improve the handling of used-once stuff (79a1ef7)

git at git.haskell.org git at git.haskell.org
Wed Dec 11 18:34:29 UTC 2013


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

On branch  : wip/better-ho-cardinality
Link       : http://ghc.haskell.org/trac/ghc/changeset/79a1ef786623de3eb9b5791ce9d1e18cfd433103/ghc

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

commit 79a1ef786623de3eb9b5791ce9d1e18cfd433103
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.


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

79a1ef786623de3eb9b5791ce9d1e18cfd433103
 compiler/basicTypes/BasicTypes.lhs |   55 ++++++++++++++++++++++++++++
 compiler/basicTypes/Demand.lhs     |   21 +++++------
 compiler/basicTypes/Id.lhs         |   64 ++++++++++++++++++++++++---------
 compiler/basicTypes/IdInfo.lhs     |   70 +++++++++---------------------------
 compiler/basicTypes/MkId.lhs       |    3 +-
 compiler/coreSyn/CoreArity.lhs     |   45 ++++++++++-------------
 compiler/coreSyn/PprCore.lhs       |   33 ++++++++++-------
 compiler/simplCore/OccurAnal.lhs   |   63 ++++++++++++++++----------------
 compiler/simplCore/SetLevels.lhs   |    4 ++-
 compiler/specialise/SpecConstr.lhs |    2 +-
 compiler/stranal/WorkWrap.lhs      |    9 ++---
 compiler/stranal/WwLib.lhs         |   64 +++++++++++++++++----------------
 12 files changed, 241 insertions(+), 192 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 79a1ef786623de3eb9b5791ce9d1e18cfd433103


More information about the ghc-commits mailing list