summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsimonpj <unknown>2003-09-11 16:46:15 +0000
committersimonpj <unknown>2003-09-11 16:46:15 +0000
commit424d45ae7a17cb085d41e5b3d85c699b7c9951ed (patch)
treecd0103b53bf9b6d4b5df7009b10e8fe82f126c16
parente4ef00a89d5df7540c0920ff3f49a713eca59847 (diff)
downloadhaskell-424d45ae7a17cb085d41e5b3d85c699b7c9951ed.tar.gz
[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
-rw-r--r--ghc/compiler/coreSyn/CoreUtils.lhs8
1 files changed, 7 insertions, 1 deletions
diff --git a/ghc/compiler/coreSyn/CoreUtils.lhs b/ghc/compiler/coreSyn/CoreUtils.lhs
index 5c26e0da78..882d469ef3 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}