Commit 94df1013 authored by simonpj's avatar simonpj
Browse files

[project @ 2005-01-31 13:21:01 by simonpj]

Name evaldUnfolding = OtherCon [], and use it
parent 4078a5cf
...@@ -214,6 +214,8 @@ mkDataConIds wrap_name wkr_name data_con ...@@ -214,6 +214,8 @@ mkDataConIds wrap_name wkr_name data_con
wkr_info = noCafIdInfo wkr_info = noCafIdInfo
`setArityInfo` wkr_arity `setArityInfo` wkr_arity
`setAllStrictnessInfo` Just wkr_sig `setAllStrictnessInfo` Just wkr_sig
`setUnfoldingInfo` evaldUnfolding -- Record that it's evaluated,
-- even if arity = 0
wkr_sig = mkStrictSig (mkTopDmdType (replicate wkr_arity topDmd) cpr_info) wkr_sig = mkStrictSig (mkTopDmdType (replicate wkr_arity topDmd) cpr_info)
-- Notice that we do *not* say the worker is strict -- Notice that we do *not* say the worker is strict
...@@ -891,8 +893,8 @@ This comes up in strictness analysis ...@@ -891,8 +893,8 @@ This comes up in strictness analysis
\begin{code} \begin{code}
realWorldPrimId -- :: State# RealWorld realWorldPrimId -- :: State# RealWorld
= pcMiscPrelId realWorldName realWorldStatePrimTy = pcMiscPrelId realWorldName realWorldStatePrimTy
(noCafIdInfo `setUnfoldingInfo` mkOtherCon []) (noCafIdInfo `setUnfoldingInfo` evaldUnfolding)
-- The mkOtherCon makes it look that realWorld# is evaluated -- The evaldUnfolding makes it look that realWorld# is evaluated
-- which in turn makes Simplify.interestingArg return True, -- which in turn makes Simplify.interestingArg return True,
-- which in turn makes INLINE things applied to realWorld# likely -- which in turn makes INLINE things applied to realWorld# likely
-- to be inlined -- to be inlined
......
...@@ -26,7 +26,7 @@ module CoreSyn ( ...@@ -26,7 +26,7 @@ module CoreSyn (
-- Unfoldings -- Unfoldings
Unfolding(..), UnfoldingGuidance(..), -- Both abstract everywhere but in CoreUnfold.lhs Unfolding(..), UnfoldingGuidance(..), -- Both abstract everywhere but in CoreUnfold.lhs
noUnfolding, mkOtherCon, noUnfolding, evaldUnfolding, mkOtherCon,
unfoldingTemplate, maybeUnfoldingTemplate, otherCons, unfoldingTemplate, maybeUnfoldingTemplate, otherCons,
isValueUnfolding, isEvaldUnfolding, isCheapUnfolding, isCompulsoryUnfolding, isValueUnfolding, isEvaldUnfolding, isCheapUnfolding, isCompulsoryUnfolding,
hasUnfolding, hasSomeUnfolding, neverUnfold, hasUnfolding, hasSomeUnfolding, neverUnfold,
...@@ -268,8 +268,10 @@ data UnfoldingGuidance ...@@ -268,8 +268,10 @@ data UnfoldingGuidance
-- a context (case (thing args) of ...), -- a context (case (thing args) of ...),
-- (where there are the right number of arguments.) -- (where there are the right number of arguments.)
noUnfolding = NoUnfolding noUnfolding = NoUnfolding
mkOtherCon = OtherCon evaldUnfolding = OtherCon []
mkOtherCon = OtherCon
seqUnfolding :: Unfolding -> () seqUnfolding :: Unfolding -> ()
seqUnfolding (CoreUnfolding e top b1 b2 g) seqUnfolding (CoreUnfolding e top b1 b2 g)
......
...@@ -17,7 +17,7 @@ module CoreUnfold ( ...@@ -17,7 +17,7 @@ module CoreUnfold (
Unfolding, UnfoldingGuidance, -- Abstract types Unfolding, UnfoldingGuidance, -- Abstract types
noUnfolding, mkTopUnfolding, mkUnfolding, mkCompulsoryUnfolding, seqUnfolding, noUnfolding, mkTopUnfolding, mkUnfolding, mkCompulsoryUnfolding, seqUnfolding,
mkOtherCon, otherCons, evaldUnfolding, mkOtherCon, otherCons,
unfoldingTemplate, maybeUnfoldingTemplate, unfoldingTemplate, maybeUnfoldingTemplate,
isEvaldUnfolding, isValueUnfolding, isCheapUnfolding, isCompulsoryUnfolding, isEvaldUnfolding, isValueUnfolding, isCheapUnfolding, isCompulsoryUnfolding,
hasUnfolding, hasSomeUnfolding, neverUnfold, hasUnfolding, hasSomeUnfolding, neverUnfold,
......
...@@ -358,7 +358,7 @@ mkWWstr_one arg ...@@ -358,7 +358,7 @@ mkWWstr_one arg
-- of dropping seqs in the worker -- of dropping seqs in the worker
Eval (Poly Abs) Eval (Poly Abs)
-> let -> let
arg_w_unf = arg `setIdUnfolding` mkOtherCon [] arg_w_unf = arg `setIdUnfolding` evaldUnfolding
-- Tell the worker arg that it's sure to be evaluated -- Tell the worker arg that it's sure to be evaluated
-- so that internal seqs can be dropped -- so that internal seqs can be dropped
in in
......
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