From: Ian Lynagh Date: Thu, 16 Aug 2007 01:22:24 +0000 (+0000) Subject: Replace _scc_'s in the GHC source with SCC pragmas X-Git-Url: http://git.megacz.com/?p=ghc-hetmet.git;a=commitdiff_plain;h=9ec880fcb29ff038bcc72d78bbe2fd6933566047 Replace _scc_'s in the GHC source with SCC pragmas --- diff --git a/compiler/iface/MkIface.lhs b/compiler/iface/MkIface.lhs index 99854d4..7d1622c 100644 --- a/compiler/iface/MkIface.lhs +++ b/compiler/iface/MkIface.lhs @@ -314,7 +314,7 @@ mkIface hsc_env maybe_old_iface -- Add version information ; ext_ver_fn = mkParentVerFun hsc_env eps ; (new_iface, no_change_at_all, pp_diffs, pp_orphs) - = _scc_ "versioninfo" + = {-# SCC "versioninfo" #-} addVersionInfo ext_ver_fn maybe_old_iface intermediate_iface decls } diff --git a/compiler/simplCore/OccurAnal.lhs b/compiler/simplCore/OccurAnal.lhs index 5ed57fb..4492bd7 100644 --- a/compiler/simplCore/OccurAnal.lhs +++ b/compiler/simplCore/OccurAnal.lhs @@ -135,7 +135,7 @@ It isn't easy to do a perfect job in one blow. Consider \begin{code} occAnalBind env (Rec pairs) body_usage - = foldr (_scc_ "occAnalBind.dofinal" do_final_bind) (body_usage, []) sccs + = foldr ({-# SCC "occAnalBind.dofinal" #-} do_final_bind) (body_usage, []) sccs where analysed_pairs :: [Details] analysed_pairs = [ (bndr, rhs_usage, rhs') @@ -144,12 +144,12 @@ occAnalBind env (Rec pairs) body_usage ] sccs :: [SCC (Node Details)] - sccs = _scc_ "occAnalBind.scc" stronglyConnCompR edges + sccs = {-# SCC "occAnalBind.scc" #-} stronglyConnCompR edges ---- stuff for dependency analysis of binds ------------------------------- edges :: [Node Details] - edges = _scc_ "occAnalBind.assoc" + edges = {-# SCC "occAnalBind.assoc" #-} [ (details, idUnique id, edges_from id rhs_usage) | details@(id, rhs_usage, rhs) <- analysed_pairs ] @@ -164,7 +164,7 @@ occAnalBind env (Rec pairs) body_usage -- which has n**2 cost, and this meant that edges_from alone -- consumed 10% of total runtime! edges_from :: Id -> UsageDetails -> [Unique] - edges_from bndr rhs_usage = _scc_ "occAnalBind.edges_from" + edges_from bndr rhs_usage = {-# SCC "occAnalBind.edges_from" #-} keysUFM (addRuleUsage rhs_usage bndr) ---- Stuff to "re-constitute" bindings from dependency-analysis info ------ diff --git a/compiler/simplCore/SimplCore.lhs b/compiler/simplCore/SimplCore.lhs index 8c98492..2770784 100644 --- a/compiler/simplCore/SimplCore.lhs +++ b/compiler/simplCore/SimplCore.lhs @@ -137,23 +137,23 @@ doCorePasses hsc_env rb us stats guts (to_do : to_dos) doCorePass :: CoreToDo -> HscEnv -> UniqSupply -> RuleBase -> ModGuts -> IO (SimplCount, ModGuts) -doCorePass (CoreDoSimplify mode sws) = _scc_ "Simplify" simplifyPgm mode sws -doCorePass CoreCSE = _scc_ "CommonSubExpr" trBinds cseProgram -doCorePass CoreLiberateCase = _scc_ "LiberateCase" liberateCase -doCorePass CoreDoFloatInwards = _scc_ "FloatInwards" trBinds floatInwards -doCorePass (CoreDoFloatOutwards f) = _scc_ "FloatOutwards" trBindsU (floatOutwards f) -doCorePass CoreDoStaticArgs = _scc_ "StaticArgs" trBinds doStaticArgs -doCorePass CoreDoStrictness = _scc_ "Stranal" trBinds dmdAnalPgm -doCorePass CoreDoWorkerWrapper = _scc_ "WorkWrap" trBindsU wwTopBinds -doCorePass CoreDoSpecialising = _scc_ "Specialise" trBindsU specProgram -doCorePass CoreDoSpecConstr = _scc_ "SpecConstr" trBindsU specConstrProgram +doCorePass (CoreDoSimplify mode sws) = {-# SCC "Simplify" #-} simplifyPgm mode sws +doCorePass CoreCSE = {-# SCC "CommonSubExpr" #-} trBinds cseProgram +doCorePass CoreLiberateCase = {-# SCC "LiberateCase" #-} liberateCase +doCorePass CoreDoFloatInwards = {-# SCC "FloatInwards" #-} trBinds floatInwards +doCorePass (CoreDoFloatOutwards f) = {-# SCC "FloatOutwards" #-} trBindsU (floatOutwards f) +doCorePass CoreDoStaticArgs = {-# SCC "StaticArgs" #-} trBinds doStaticArgs +doCorePass CoreDoStrictness = {-# SCC "Stranal" #-} trBinds dmdAnalPgm +doCorePass CoreDoWorkerWrapper = {-# SCC "WorkWrap" #-} trBindsU wwTopBinds +doCorePass CoreDoSpecialising = {-# SCC "Specialise" #-} trBindsU specProgram +doCorePass CoreDoSpecConstr = {-# SCC "SpecConstr" #-} trBindsU specConstrProgram doCorePass CoreDoGlomBinds = trBinds glomBinds -doCorePass CoreDoVectorisation = _scc_ "Vectorise" vectorise +doCorePass CoreDoVectorisation = {-# SCC "Vectorise" #-} vectorise doCorePass CoreDoPrintCore = observe printCore doCorePass (CoreDoRuleCheck phase pat) = observe (ruleCheck phase pat) doCorePass CoreDoNothing = observe (\ _ _ -> return ()) #ifdef OLD_STRICTNESS -doCorePass CoreDoOldStrictness = _scc_ "OldStrictness" trBinds doOldStrictness +doCorePass CoreDoOldStrictness = {-# SCC "OldStrictness" #-} trBinds doOldStrictness #else doCorePass CoreDoOldStrictness = panic "CoreDoOldStrictness" #endif @@ -436,7 +436,7 @@ simplifyPgm mode switches hsc_env us imp_rule_base guts | let sz = coreBindsSize binds in sz == sz = do { -- Occurrence analysis - let { tagged_binds = _scc_ "OccAnal" occurAnalysePgm binds } ; + let { tagged_binds = {-# SCC "OccAnal" #-} occurAnalysePgm binds } ; dumpIfSet_dyn dflags Opt_D_dump_occur_anal "Occurrence analysis" (pprCoreBindings tagged_binds); @@ -448,7 +448,7 @@ simplifyPgm mode switches hsc_env us imp_rule_base guts eps <- hscEPS hsc_env ; let { rule_base' = unionRuleBase imp_rule_base (eps_rule_base eps) ; simpl_env = mkSimplEnv mode sw_chkr - ; simpl_binds = _scc_ "SimplTopBinds" + ; simpl_binds = {-# SCC "SimplTopBinds" #-} simplTopBinds simpl_env tagged_binds ; fam_envs = (eps_fam_inst_env eps, mg_fam_inst_env guts) } ; @@ -485,7 +485,7 @@ simplifyPgm mode switches hsc_env us imp_rule_base guts -- -- ToDo: alas, this means that indirection-shorting does not happen at all -- if the simplifier does nothing (not common, I know, but unsavoury) - let { binds'' = _scc_ "ZapInd" shortOutIndirections binds' } ; + let { binds'' = {-# SCC "ZapInd" #-} shortOutIndirections binds' } ; -- Dump the result of this iteration dumpIfSet_dyn dflags Opt_D_dump_simpl_iterations herald diff --git a/compiler/utils/Digraph.lhs b/compiler/utils/Digraph.lhs index 958769c..cde008a 100644 --- a/compiler/utils/Digraph.lhs +++ b/compiler/utils/Digraph.lhs @@ -104,8 +104,8 @@ stronglyConnCompR [] = [] -- added to avoid creating empty array in graphFromEd stronglyConnCompR edges = map decode forest where - (graph, vertex_fn) = _scc_ "graphFromEdges" graphFromEdges edges - forest = _scc_ "Digraph.scc" scc graph + (graph, vertex_fn) = {-# SCC "graphFromEdges" #-} graphFromEdges edges + forest = {-# SCC "Digraph.scc" #-} scc graph decode (Node v []) | mentions_itself v = CyclicSCC [vertex_fn v] | otherwise = AcyclicSCC (vertex_fn v) decode other = CyclicSCC (dec other [])