X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=ghc%2Fcompiler%2FcoreSyn%2FCoreUtils.lhs;h=7e5fbb4866cb072505dc4fd66bb628c05d7c0dbc;hb=e66106a53dab255670ad1229b280cf36d16bc44c;hp=5c26e0da780bba25a19ae73eb0c67395d0df04f6;hpb=31d1bcbed45e4b6ff9543193ab7813e05b29e9b4;p=ghc-hetmet.git diff --git a/ghc/compiler/coreSyn/CoreUtils.lhs b/ghc/compiler/coreSyn/CoreUtils.lhs index 5c26e0d..7e5fbb4 100644 --- a/ghc/compiler/coreSyn/CoreUtils.lhs +++ b/ghc/compiler/coreSyn/CoreUtils.lhs @@ -214,7 +214,12 @@ mkCoerce2 to_ty from_ty expr mkSCC :: CostCentre -> Expr b -> Expr b -- Note: Nested SCC's *are* preserved for the benefit of -- cost centre stack profiling + -- Note2: We throw away an SCC on a single variable. If the + -- variable is a value, then there is no work to do in + -- evaluating it, and if it is a thunk, then it will be + -- attributed to its own CCS anyhow. mkSCC cc (Lit lit) = Lit lit +mkSCC cc (Var v) = Var v mkSCC cc (Lam x e) = Lam x (mkSCC cc e) -- Move _scc_ inside lambda mkSCC cc (Note (SCC cc') e) = Note (SCC cc) (Note (SCC cc') e) mkSCC cc (Note n e) = Note n (mkSCC cc e) -- Move _scc_ inside notes