Commit 3642d212 authored by simonmar's avatar simonmar
Browse files

[project @ 2001-11-23 11:59:21 by simonmar]

Collect up _scc_ expressions on the right hand side of a closure
definition and attach them directly to the closure using PushCC-type
cost centres, so that the allocation of the closure gets attributed to
the right place.
parent 79abe0ac
...@@ -246,22 +246,17 @@ stgMassageForProfiling mod_name us stg_binds ...@@ -246,22 +246,17 @@ stgMassageForProfiling mod_name us stg_binds
returnMM (StgRhsCon cc con args) returnMM (StgRhsCon cc con args)
-} -}
{- do_rhs (StgRhsClosure _ bi fv u args expr)
do_rhs (StgRhsClosure _ bi fv u args (StgSCC ty cc expr)) = slurpSCCs currentCCS expr `thenMM` \ (expr', ccs) ->
| not (isSccCountCostCentre cc) do_expr expr' `thenMM` \ expr'' ->
= collectCC cc `thenMM_` returnMM (StgRhsClosure ccs bi fv u args expr'')
set_prevailing_cc cc (do_expr expr) `thenMM` \ expr' -> where
returnMM (StgRhsClosure cc bi fv u args expr') slurpSCCs ccs (StgSCC cc e)
-} = collectCC cc `thenMM_`
slurpSCCs ccs e `thenMM` \ (e', ccs') ->
do_rhs (StgRhsClosure cc bi fv u [] body) returnMM (e', pushCCOnCCS cc ccs')
= do_expr body `thenMM` \ body' -> slurpSCCs ccs e
returnMM (StgRhsClosure currentCCS bi fv u [] body') = returnMM (e, ccs)
do_rhs (StgRhsClosure cc bi fv u args body)
= set_lambda_cc (do_expr body) `thenMM` \ body' ->
get_prevailing_cc `thenMM` \ prev_ccs ->
returnMM (StgRhsClosure currentCCS bi fv u args body')
do_rhs (StgRhsCon cc con args) do_rhs (StgRhsCon cc con args)
= returnMM (StgRhsCon currentCCS con args) = returnMM (StgRhsCon currentCCS con args)
...@@ -337,7 +332,7 @@ type MassageM result ...@@ -337,7 +332,7 @@ type MassageM result
= Module -- module name = Module -- module name
-> CostCentreStack -- prevailing CostCentre -> CostCentreStack -- prevailing CostCentre
-- if none, subsumedCosts at top-level -- if none, subsumedCosts at top-level
-- useCurrentCostCentre at nested levels -- currentCostCentre at nested levels
-> UniqSupply -> UniqSupply
-> VarSet -- toplevel-ish Ids for boxing -> VarSet -- toplevel-ish Ids for boxing
-> CollectedCCs -> CollectedCCs
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment