summaryrefslogtreecommitdiff
path: root/compiler/profiling
diff options
context:
space:
mode:
authorÖmer Sinan Ağacan <omeragacan@gmail.com>2016-02-08 16:18:23 -0500
committerÖmer Sinan Ağacan <omeragacan@gmail.com>2016-02-08 16:19:28 -0500
commit023fc92f6f98a8bd003ce20083d3682aec865cb5 (patch)
treeb08895d5e7575cfc29fa0a13e37df4445b93f6bc /compiler/profiling
parent489a9a3beeeae3d150761ef863b4757eba0b02d9 (diff)
downloadhaskell-023fc92f6f98a8bd003ce20083d3682aec865cb5.tar.gz
Remove unused LiveVars and SRT fields of StgCase
We also need to update `stgBindHasCafRefs` assertion with this change, as we no longer have the pre-computed SRT, LiveVars etc. We rename it to `topStgBindHasCafRefs` and implement it like this: A non-updatable top-level binding may refer to a CAF by referring to a top-level definition with CAFs. A top-level definition may have CAFs if it's updatable. At this point (because this is done after TidyPgm) top-level Ids (whether imported or defined in this module) are GlobalIds, so the top-levelness test is easy. (see also comments in the code) Reviewers: bgamari, simonpj, austin Reviewed By: simonpj Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D1889 GHC Trac Issues: #11550
Diffstat (limited to 'compiler/profiling')
-rw-r--r--compiler/profiling/SCCfinal.hs24
1 files changed, 12 insertions, 12 deletions
diff --git a/compiler/profiling/SCCfinal.hs b/compiler/profiling/SCCfinal.hs
index 6cab87c9cd..6bd00b0f61 100644
--- a/compiler/profiling/SCCfinal.hs
+++ b/compiler/profiling/SCCfinal.hs
@@ -90,7 +90,7 @@ stgMassageForProfiling dflags mod_name _us stg_binds
----------
do_top_rhs :: Id -> StgRhs -> MassageM StgRhs
- do_top_rhs _ (StgRhsClosure _ _ _ _ _ []
+ do_top_rhs _ (StgRhsClosure _ _ _ _ []
(StgTick (ProfNote _cc False{-not tick-} _push)
(StgConApp con args)))
| not (isDllConApp dflags mod_name con args)
@@ -100,7 +100,7 @@ stgMassageForProfiling dflags mod_name _us stg_binds
-- isDllConApp checks for LitLit args too
= return (StgRhsCon dontCareCCS con args)
- do_top_rhs binder (StgRhsClosure _ bi fv u srt [] body)
+ do_top_rhs binder (StgRhsClosure _ bi fv u [] body)
= do
-- Top level CAF without a cost centre attached
-- Attach CAF cc (collect if individual CAF ccs)
@@ -119,11 +119,11 @@ stgMassageForProfiling dflags mod_name _us stg_binds
else
return all_cafs_ccs
body' <- do_expr body
- return (StgRhsClosure caf_ccs bi fv u srt [] body')
+ return (StgRhsClosure caf_ccs bi fv u [] body')
- do_top_rhs _ (StgRhsClosure _no_ccs bi fv u srt args body)
+ do_top_rhs _ (StgRhsClosure _no_ccs bi fv u args body)
= do body' <- do_expr body
- return (StgRhsClosure dontCareCCS bi fv u srt args body')
+ return (StgRhsClosure dontCareCCS bi fv u args body')
do_top_rhs _ (StgRhsCon _ con args)
-- Top-level (static) data is not counted in heap
@@ -155,10 +155,10 @@ stgMassageForProfiling dflags mod_name _us stg_binds
expr' <- do_expr expr
return (StgTick ti expr')
- do_expr (StgCase expr fv1 fv2 bndr srt alt_type alts) = do
+ do_expr (StgCase expr bndr alt_type alts) = do
expr' <- do_expr expr
alts' <- mapM do_alt alts
- return (StgCase expr' fv1 fv2 bndr srt alt_type alts')
+ return (StgCase expr' bndr alt_type alts')
where
do_alt (id, bs, use_mask, e) = do
e' <- do_expr e
@@ -168,9 +168,9 @@ stgMassageForProfiling dflags mod_name _us stg_binds
(b,e) <- do_let b e
return (StgLet b e)
- do_expr (StgLetNoEscape lvs1 lvs2 b e) = do
+ do_expr (StgLetNoEscape b e) = do
(b,e) <- do_let b e
- return (StgLetNoEscape lvs1 lvs2 b e)
+ return (StgLetNoEscape b e)
do_expr other = pprPanic "SCCfinal.do_expr" (ppr other)
@@ -200,15 +200,15 @@ stgMassageForProfiling dflags mod_name _us stg_binds
-- allocation of the constructor to the wrong place (XXX)
-- We should really attach (PushCC cc CurrentCCS) to the rhs,
-- but need to reinstate PushCC for that.
- do_rhs (StgRhsClosure _closure_cc _bi _fv _u _srt []
+ do_rhs (StgRhsClosure _closure_cc _bi _fv _u []
(StgTick (ProfNote cc False{-not tick-} _push)
(StgConApp con args)))
= do collectCC cc
return (StgRhsCon currentCCS con args)
- do_rhs (StgRhsClosure _ bi fv u srt args expr) = do
+ do_rhs (StgRhsClosure _ bi fv u args expr) = do
expr' <- do_expr expr
- return (StgRhsClosure currentCCS bi fv u srt args expr')
+ return (StgRhsClosure currentCCS bi fv u args expr')
do_rhs (StgRhsCon _ con args)
= return (StgRhsCon currentCCS con args)