Commit 424d45ae authored by simonpj's avatar simonpj
Browse files

[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
parent e4ef00a8
......@@ -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}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment