Commit ab74d75d authored by Joachim Breitner's avatar Joachim Breitner

Replace worthSplittingThunkDmd by worthSplittingArgDmd

these functions were almost equal, and neither validate nor nofib show
any difference replacing one by the other. So lets simplify this.
(This also prepares for a refactoring that will get rid of
worthSplittingArgDmd completely.)
parent b41821b4
......@@ -869,20 +869,6 @@ worthSplittingArgDmd dmd
go (JD {strd=Str HeadStr, absd=Use _ UHead}) = True
go _ = False
worthSplittingThunkDmd :: Demand -- Demand on the thunk
-> Bool
worthSplittingThunkDmd dmd
= go dmd
where
-- Split if the thing is unpacked
go (JD {strd=Str (SProd {}), absd=Use _ a}) = some_comp_used a
go (JD {strd=Str HeadStr, absd=Use _ UProd {}}) = True
go _ = False
some_comp_used Used = True
some_comp_used (UProd _ ) = True
some_comp_used _ = False
\end{code}
Note [Worthy functions for Worker-Wrapper split]
......
......@@ -261,7 +261,7 @@ tryWW dflags is_rec fn_id rhs
= checkSize dflags new_fn_id rhs $
splitFun dflags new_fn_id fn_info wrap_dmds res_info rhs
| is_thunk && (worthSplittingThunkDmd fn_dmd || returnsCPR res_info)
| is_thunk && (worthSplittingArgDmd fn_dmd || returnsCPR res_info)
-- See Note [Thunk splitting]
= ASSERT2( isNonRec is_rec, ppr new_fn_id ) -- The thunk must be non-recursive
checkSize dflags new_fn_id rhs $
......
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