diff options
author | Ömer Sinan Ağacan <omeragacan@gmail.com> | 2018-02-13 09:03:57 +0300 |
---|---|---|
committer | Ömer Sinan Ağacan <omeragacan@gmail.com> | 2018-02-13 09:05:18 +0300 |
commit | 5957405808fe89e9b108dc0bc3cf4b56aec37775 (patch) | |
tree | 1b3bea7c22e715fcaf8faf10cae67a23a37e6d94 /testsuite | |
parent | c9a88db3ac4f1c3e97e3492ebe076f2df6463540 (diff) | |
download | haskell-5957405808fe89e9b108dc0bc3cf4b56aec37775.tar.gz |
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
Diffstat (limited to 'testsuite')
-rw-r--r-- | testsuite/tests/profiling/should_compile/all.T | 2 | ||||
-rw-r--r-- | testsuite/tests/simplCore/should_compile/noinline01.stderr | 16 |
2 files changed, 9 insertions, 9 deletions
diff --git a/testsuite/tests/profiling/should_compile/all.T b/testsuite/tests/profiling/should_compile/all.T index 068b43b77e..155206ab7b 100644 --- a/testsuite/tests/profiling/should_compile/all.T +++ b/testsuite/tests/profiling/should_compile/all.T @@ -4,4 +4,4 @@ test('prof001', [only_ways(['normal']), req_profiling], compile_and_run, ['-prof test('prof002', [only_ways(['normal']), req_profiling], compile_and_run, ['-prof -fprof-cafs']) test('T2410', [only_ways(['normal']), req_profiling], compile, ['-O2 -prof -fprof-cafs']) -test('T5889', [expect_broken(5889), only_ways(['normal']), req_profiling, extra_files(['T5889/A.hs', 'T5889/B.hs'])], multimod_compile, ['A B', '-O -prof -fno-prof-count-entries -v0']) +test('T5889', [only_ways(['normal']), req_profiling, extra_files(['T5889/A.hs', 'T5889/B.hs'])], multimod_compile, ['A B', '-O -prof -fno-prof-count-entries -v0']) diff --git a/testsuite/tests/simplCore/should_compile/noinline01.stderr b/testsuite/tests/simplCore/should_compile/noinline01.stderr index 53db7dac3f..ce01fcc863 100644 --- a/testsuite/tests/simplCore/should_compile/noinline01.stderr +++ b/testsuite/tests/simplCore/should_compile/noinline01.stderr @@ -15,7 +15,7 @@ Noinline01.$trModule4 :: GHC.Prim.Addr# Noinline01.$trModule3 :: GHC.Types.TrName [GblId, Caf=NoCafRefs, Str=m1, Unf=OtherCon []] = - NO_CCS GHC.Types.TrNameS! [Noinline01.$trModule4]; + CCS_DONT_CARE GHC.Types.TrNameS! [Noinline01.$trModule4]; Noinline01.$trModule2 :: GHC.Prim.Addr# [GblId, Caf=NoCafRefs, Unf=OtherCon []] = @@ -23,12 +23,12 @@ Noinline01.$trModule2 :: GHC.Prim.Addr# Noinline01.$trModule1 :: GHC.Types.TrName [GblId, Caf=NoCafRefs, Str=m1, Unf=OtherCon []] = - NO_CCS GHC.Types.TrNameS! [Noinline01.$trModule2]; + CCS_DONT_CARE GHC.Types.TrNameS! [Noinline01.$trModule2]; Noinline01.$trModule :: GHC.Types.Module [GblId, Caf=NoCafRefs, Str=m, Unf=OtherCon []] = - NO_CCS GHC.Types.Module! [Noinline01.$trModule3 - Noinline01.$trModule1]; + CCS_DONT_CARE GHC.Types.Module! [Noinline01.$trModule3 + Noinline01.$trModule1]; @@ -48,7 +48,7 @@ Noinline01.$trModule4 :: GHC.Prim.Addr# Noinline01.$trModule3 :: GHC.Types.TrName [GblId, Caf=NoCafRefs, Str=m1, Unf=OtherCon []] = - NO_CCS GHC.Types.TrNameS! [Noinline01.$trModule4]; + CCS_DONT_CARE GHC.Types.TrNameS! [Noinline01.$trModule4]; Noinline01.$trModule2 :: GHC.Prim.Addr# [GblId, Caf=NoCafRefs, Unf=OtherCon []] = @@ -56,11 +56,11 @@ Noinline01.$trModule2 :: GHC.Prim.Addr# Noinline01.$trModule1 :: GHC.Types.TrName [GblId, Caf=NoCafRefs, Str=m1, Unf=OtherCon []] = - NO_CCS GHC.Types.TrNameS! [Noinline01.$trModule2]; + CCS_DONT_CARE GHC.Types.TrNameS! [Noinline01.$trModule2]; Noinline01.$trModule :: GHC.Types.Module [GblId, Caf=NoCafRefs, Str=m, Unf=OtherCon []] = - NO_CCS GHC.Types.Module! [Noinline01.$trModule3 - Noinline01.$trModule1]; + CCS_DONT_CARE GHC.Types.Module! [Noinline01.$trModule3 + Noinline01.$trModule1]; |