X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=ghc%2Fcompiler%2Fprofiling%2FSCCfinal.lhs;h=52d9f8d7c9a9505cfb3958e58ca9377eaeb09c88;hb=7caedc52dde9fb7f773fb3a1d5fc0f7b2d8de848;hp=dbf31b0db563f8e97d0bac8b6ddf4ebff3a2afc3;hpb=79952b699c31f885d0bdf76e451cf1471a4892da;p=ghc-hetmet.git diff --git a/ghc/compiler/profiling/SCCfinal.lhs b/ghc/compiler/profiling/SCCfinal.lhs index dbf31b0..52d9f8d 100644 --- a/ghc/compiler/profiling/SCCfinal.lhs +++ b/ghc/compiler/profiling/SCCfinal.lhs @@ -23,26 +23,22 @@ This is now a sort-of-normal STG-to-STG pass (WDP 94/06), run by stg2stg. * "Distributes" given cost-centres to all as-yet-unmarked RHSs. \begin{code} -#include "HsVersions.h" - module SCCfinal ( stgMassageForProfiling ) where -IMP_Ubiq(){-uitous-} +#include "HsVersions.h" import StgSyn -import CmdLineOpts ( opt_AutoSccsOnIndividualCafs, - opt_CompilingGhcInternals - ) +import CmdLineOpts ( opt_AutoSccsOnIndividualCafs ) import CostCentre -- lots of things -import Id ( idType, mkSysLocal, emptyIdSet, SYN_IE(Id) ) -import Maybes ( maybeToBool ) +import MkId ( mkSysLocal ) +import Id ( idType, emptyIdSet, Id ) import SrcLoc ( noSrcLoc ) -import Type ( splitSigmaTy, getFunTy_maybe ) +import Type ( splitSigmaTy, splitFunTy_maybe ) import UniqSupply ( getUnique, splitUniqSupply, UniqSupply ) import Unique ( Unique ) -import Util ( removeDups, assertPanic ) -import Outputable -- ToDo: rm +import Util ( removeDups, assertPanic, trace ) +import Outputable infixr 9 `thenMM`, `thenMM_` \end{code} @@ -64,7 +60,7 @@ stgMassageForProfiling mod_name grp_name us stg_binds = initMM mod_name us (mapMM do_top_binding stg_binds) fixed_ccs - = if do_auto_sccs_on_cafs || doing_prelude + = if do_auto_sccs_on_cafs then [] -- don't need "all CAFs" CC (for Prelude, we use PreludeCC) else [all_cafs_cc] @@ -74,11 +70,8 @@ stgMassageForProfiling mod_name grp_name us stg_binds ((fixed_ccs ++ local_ccs_no_dups, extern_ccs_no_dups), stg_binds2) where do_auto_sccs_on_cafs = opt_AutoSccsOnIndividualCafs -- only use! - doing_prelude = opt_CompilingGhcInternals - all_cafs_cc = if doing_prelude - then preludeCafsCostCentre - else mkAllCafsCC mod_name grp_name + all_cafs_cc = mkAllCafsCC mod_name grp_name ---------- do_top_binding :: StgBinding -> MassageM StgBinding @@ -131,7 +124,7 @@ stgMassageForProfiling mod_name grp_name us stg_binds do_top_rhs binder (StgRhsClosure cc bi fv u [] body) -- Top level CAF with cost centre attached -- Should this be a CAF cc ??? Does this ever occur ??? - = trace ("SCCfinal: CAF with cc: " ++ showCostCentre PprDebug False cc) $ + = trace ("SCCfinal: CAF with cc: " ++ showCostCentre False cc) $ collectCC cc `thenMM_` set_prevailing_cc cc (do_expr body) `thenMM` \ body' -> returnMM (StgRhsClosure cc bi fv u [] body')