From: simonpj Date: Thu, 11 Sep 2003 16:46:15 +0000 (+0000) Subject: [project @ 2003-09-11 16:46:15 by simonpj] X-Git-Tag: Approx_11550_changesets_converted~462 X-Git-Url: http://git.megacz.com/?a=commitdiff_plain;h=424d45ae7a17cb085d41e5b3d85c699b7c9951ed;p=ghc-hetmet.git [project @ 2003-09-11 16:46:15 by simonpj] Make sure that exprIsTrivial responds "False" to (scc "foo" x) We do not treat (_scc_ "foo" x) as trivial, because a) it really generates code, (and a heap object when it's a function arg) to capture the cost centre b) see the note [SCC-and-exprIsTrivial] in Simplify.simplLazyBind --- diff --git a/ghc/compiler/coreSyn/CoreUtils.lhs b/ghc/compiler/coreSyn/CoreUtils.lhs index 5c26e0d..882d469 100644 --- a/ghc/compiler/coreSyn/CoreUtils.lhs +++ b/ghc/compiler/coreSyn/CoreUtils.lhs @@ -325,12 +325,18 @@ completely un-applied primops and foreign-call Ids are sufficiently rare that I plan to allow them to be duplicated and put up with saturating them. +SCC notes. We do not treat (_scc_ "foo" x) as trivial, because + a) it really generates code, (and a heap object when it's + a function arg) to capture the cost centre + b) see the note [SCC-and-exprIsTrivial] in Simplify.simplLazyBind + \begin{code} exprIsTrivial (Var v) = True -- See notes above exprIsTrivial (Type _) = True exprIsTrivial (Lit lit) = litIsTrivial lit exprIsTrivial (App e arg) = not (isRuntimeArg arg) && exprIsTrivial e -exprIsTrivial (Note _ e) = exprIsTrivial e +exprIsTrivial (Note (SCC _) e) = False -- See notes above +exprIsTrivial (Note _ e) = exprIsTrivial e exprIsTrivial (Lam b body) = not (isRuntimeVar b) && exprIsTrivial body exprIsTrivial other = False \end{code}