module CoreUnfold (
Unfolding, UnfoldingGuidance, -- types
- noUnfolding, mkUnfolding,
+ noUnfolding, mkUnfolding, seqUnfolding,
mkOtherCon, otherCons,
unfoldingTemplate, maybeUnfoldingTemplate,
isEvaldUnfolding, isCheapUnfolding,
certainlySmallEnoughToInline,
okToUnfoldInHiFile,
- calcUnfoldingGuidance,
+ calcUnfoldingGuidance,
callSiteInline, blackListed
) where
Bool -- exprIsValue template (cached); it is ok to discard a `seq` on
-- this variable
UnfoldingGuidance -- Tells about the *size* of the template.
+
+seqUnfolding :: Unfolding -> ()
+seqUnfolding (CoreUnfolding e b1 b2 g)
+ = seqExpr e `seq` b1 `seq` b2 `seq` seqGuidance g
+seqUnfolding other = ()
\end{code}
\begin{code}
Int -- Scrutinee discount: the discount to substract if the thing is in
-- a context (case (thing args) of ...),
-- (where there are the right number of arguments.)
+
+seqGuidance (UnfoldIfGoodArgs n ns a b) = n `seq` sum ns `seq` a `seq` b `seq` ()
+seqGuidance other = ()
\end{code}
\begin{code}