summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoachim Breitner <mail@joachim-breitner.de>2014-01-16 13:59:31 +0000
committerJoachim Breitner <mail@joachim-breitner.de>2014-01-16 16:49:19 +0000
commitab74d75d029cdbbb9215b48f1611259fe4d7dd19 (patch)
tree490b4e7a3dcea594da34fcba7fb86e0993c99374
parentb41821b43925db46c968f1244712c78877204a9b (diff)
downloadhaskell-ab74d75d029cdbbb9215b48f1611259fe4d7dd19.tar.gz
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.)
-rw-r--r--compiler/basicTypes/Demand.lhs14
-rw-r--r--compiler/stranal/WorkWrap.lhs2
2 files changed, 1 insertions, 15 deletions
diff --git a/compiler/basicTypes/Demand.lhs b/compiler/basicTypes/Demand.lhs
index b857ef590a..3ebd72405e 100644
--- a/compiler/basicTypes/Demand.lhs
+++ b/compiler/basicTypes/Demand.lhs
@@ -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]
diff --git a/compiler/stranal/WorkWrap.lhs b/compiler/stranal/WorkWrap.lhs
index 3c7820cca3..5c24069deb 100644
--- a/compiler/stranal/WorkWrap.lhs
+++ b/compiler/stranal/WorkWrap.lhs
@@ -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 $