From 424d45ae7a17cb085d41e5b3d85c699b7c9951ed Mon Sep 17 00:00:00 2001 From: simonpj Date: Thu, 11 Sep 2003 16:46:15 +0000 Subject: [PATCH] [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 --- ghc/compiler/coreSyn/CoreUtils.lhs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) 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} -- 1.7.10.4