[commit: ghc] master: Code-size optimisation for top-level indirections (#7308) (7da1376)

Simon Marlow <[email protected]>
Newsgroups gmane.comp.lang.haskell.cvs.ghc
Message-ID <[email protected]>
Repository : ssh://darcs.haskell.org//srv/darcs/ghc

On branch  : master

http://hackage.haskell.org/trac/ghc/changeset/7da13762664c1bec8e2a1ee5c7106cca3b32a98f

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

commit 7da13762664c1bec8e2a1ee5c7106cca3b32a98f
Author: Simon Marlow <[email protected]>
Date:   Tue Oct 9 08:49:25 2012 +0100

    Code-size optimisation for top-level indirections (#7308)
    
    Top-level indirections are often generated when there is a cast, e.g.
    
    foo :: T
    foo = bar `cast` (some coercion)
    
    For these we were generating a full-blown CAF, which is a fair chunk
    of code.
    
    This patch makes these indirections generate a single IND_STATIC
    closure (4 words) instead.  This is exactly what the CAF would
    evaluate to eventually anyway, we're just shortcutting the whole
    process.

 compiler/cmm/CmmInfo.hs           |    3 +-
 compiler/cmm/SMRep.lhs            |   11 +++++++++-
 compiler/codeGen/StgCmm.hs        |   13 ++++++-----
 compiler/codeGen/StgCmmBind.hs    |   40 ++++++++++++++++++++++++++++--------
 compiler/codeGen/StgCmmClosure.hs |    8 +++++++
 compiler/codeGen/StgCmmHeap.hs    |    6 +---
 6 files changed, 60 insertions(+), 21 deletions(-)


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

    git show 7da13762664c1bec8e2a1ee5c7106cca3b32a98f
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.