[commit: ghc] master: Replace worthSplittingThunkDmd by worthSplittingArgDmd (ab74d75)

git at git.haskell.org git at git.haskell.org
Thu Jan 16 16:48:28 UTC 2014


Repository : ssh://git@git.haskell.org/ghc

On branch  : master
Link       : http://ghc.haskell.org/trac/ghc/changeset/ab74d75d029cdbbb9215b48f1611259fe4d7dd19/ghc

>---------------------------------------------------------------

commit ab74d75d029cdbbb9215b48f1611259fe4d7dd19
Author: Joachim Breitner <mail at joachim-breitner.de>
Date:   Thu Jan 16 13:59:31 2014 +0000

    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.)


>---------------------------------------------------------------

ab74d75d029cdbbb9215b48f1611259fe4d7dd19
 compiler/basicTypes/Demand.lhs |   14 --------------
 compiler/stranal/WorkWrap.lhs  |    2 +-
 2 files changed, 1 insertion(+), 15 deletions(-)

diff --git a/compiler/basicTypes/Demand.lhs b/compiler/basicTypes/Demand.lhs
index b857ef5..3ebd724 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 3c7820c..5c24069 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 $



More information about the ghc-commits mailing list