[commit: ghc] master: Collect CCs in CorePrep, including CCs in unfoldings (5957405)

git at git.haskell.org git at git.haskell.org
Tue Feb 13 07:03:19 UTC 2018


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

On branch  : master
Link       : http://ghc.haskell.org/trac/ghc/changeset/5957405808fe89e9b108dc0bc3cf4b56aec37775/ghc

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

commit 5957405808fe89e9b108dc0bc3cf4b56aec37775
Author: Ömer Sinan Ağacan <omeragacan at gmail.com>
Date:   Tue Feb 13 09:03:57 2018 +0300

    Collect CCs in CorePrep, including CCs in unfoldings
    
    This patch includes two changes:
    
    1. Move cost centre collection from `SCCfinal` to `CorePrep`, to be able
       to collect cost centres in unfoldings. `CorePrep` drops unfoldings, so
       that's the latest stage in the compilation pipeline for this.
    
       After this change `SCCfinal` no longer collects all cost centres, but
       it still generates & collects CAF cost centres + updates cost centre
       stacks of `StgRhsClosure` and `StgRhsCon`s.
    
       This fixes #5889.
    
    2. Initialize cost centre stack fields of `StgRhs` in `coreToStg`. With
       this we no longer need to update cost centre stack fields in
       `SCCfinal`, so that module is removed.
    
       Cost centre initialization explained in Note [Cost-centre
       initialization plan].
    
       Because with -fcaf-all we need to attach a new cost-centre to each
       CAF, `coreTopBindToStg` now returns `CollectedCCs`.
    
    Test Plan: validate
    
    Reviewers: simonpj, bgamari, simonmar
    
    Reviewed By: simonpj, bgamari
    
    Subscribers: rwbarton, thomie, carter
    
    GHC Trac Issues: #5889
    
    Differential Revision: https://phabricator.haskell.org/D4325


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

5957405808fe89e9b108dc0bc3cf4b56aec37775
 compiler/coreSyn/CorePrep.hs                       |  58 ++++-
 compiler/deSugar/Coverage.hs                       |   9 +-
 compiler/ghc.cabal.in                              |   1 -
 compiler/main/HscMain.hs                           |  20 +-
 compiler/profiling/CostCentre.hs                   |  23 +-
 compiler/profiling/SCCfinal.hs                     | 284 ---------------------
 compiler/simplStg/SimplStg.hs                      |  47 +---
 compiler/stgSyn/CoreToStg.hs                       | 227 +++++++++++-----
 testsuite/tests/profiling/should_compile/all.T     |   2 +-
 .../simplCore/should_compile/noinline01.stderr     |  16 +-
 10 files changed, 258 insertions(+), 429 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 5957405808fe89e9b108dc0bc3cf4b56aec37775


More information about the ghc-commits mailing list