[commit: ghc] wip/nested-cpr: Remove dmdTransformDataConSig (7e92656)

git at git.haskell.org git at git.haskell.org
Tue Feb 4 18:27:30 UTC 2014


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

On branch  : wip/nested-cpr
Link       : http://ghc.haskell.org/trac/ghc/changeset/7e92656934f5e2f5bd55bcc6fb41960305fdf766/ghc

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

commit 7e92656934f5e2f5bd55bcc6fb41960305fdf766
Author: Joachim Breitner <mail at joachim-breitner.de>
Date:   Fri Jan 17 10:46:45 2014 +0000

    Remove dmdTransformDataConSig
    
    it does nothing that dmdAnalVarApp would not have done before


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

7e92656934f5e2f5bd55bcc6fb41960305fdf766
 compiler/basicTypes/Demand.lhs |   26 +-------------------------
 compiler/stranal/DmdAnal.lhs   |    4 ----
 2 files changed, 1 insertion(+), 29 deletions(-)

diff --git a/compiler/basicTypes/Demand.lhs b/compiler/basicTypes/Demand.lhs
index 2363d04..579813c 100644
--- a/compiler/basicTypes/Demand.lhs
+++ b/compiler/basicTypes/Demand.lhs
@@ -45,7 +45,7 @@ module Demand (
         postProcessUnsat, postProcessDmdTypeM,
 
         splitProdDmd, splitProdDmd_maybe, peelCallDmd, mkCallDmd, mkCallDmdN,
-        dmdTransformSig, dmdTransformDataConSig, dmdTransformDictSelSig,
+        dmdTransformSig, dmdTransformDictSelSig,
         argOneShots, argsOneShots,
 
         isSingleUsed, reuseEnv, zapDemand, zapStrictSig,
@@ -1588,30 +1588,6 @@ dmdTransformSig (StrictSig dmd_ty@(DmdType _ arg_ds _)) cd
   = postProcessUnsat (peelManyCalls (length arg_ds) cd) dmd_ty
     -- see Note [Demands from unsaturated function calls]
 
-dmdTransformDataConSig :: Arity -> StrictSig -> CleanDemand -> DmdType
--- Same as dmdTransformSig but for a data constructor (worker), 
--- which has a special kind of demand transformer.
--- If the constructor is saturated, we feed the demand on 
--- the result into the constructor arguments.
-dmdTransformDataConSig arity (StrictSig (DmdType _ _ con_res)) 
-                             (CD { sd = str, ud = abs })
-  | Just str_dmds <- go_str arity str
-  , Just abs_dmds <- go_abs arity abs
-  = DmdType emptyDmdEnv (mkJointDmds str_dmds abs_dmds) con_res
-                -- Must remember whether it's a product, hence con_res, not TopRes
-
-  | otherwise   -- Not saturated
-  = nopDmdType
-  where
-    go_str 0 dmd        = Just (splitStrProdDmd arity dmd)
-    go_str n (SCall s') = go_str (n-1) s'
-    go_str n HyperStr   = go_str (n-1) HyperStr
-    go_str _ _          = Nothing
-
-    go_abs 0 dmd            = Just (splitUseProdDmd arity dmd)
-    go_abs n (UCall One u') = go_abs (n-1) u'
-    go_abs _ _              = Nothing
-
 dmdTransformDictSelSig :: StrictSig -> CleanDemand -> DmdType
 -- Like dmdTransformDataConSig, we have a special demand transformer
 -- for dictionary selectors.  If the selector is saturated (ie has one
diff --git a/compiler/stranal/DmdAnal.lhs b/compiler/stranal/DmdAnal.lhs
index c4b9f02..fa4ad8b 100644
--- a/compiler/stranal/DmdAnal.lhs
+++ b/compiler/stranal/DmdAnal.lhs
@@ -511,10 +511,6 @@ dmdTransform :: AnalEnv		-- The strictness environment
 	-- this function plus demand on its free variables
 
 dmdTransform env var dmd
-  | isDataConWorkId var		                 -- Data constructor
-  = dmdTransformDataConSig 
-       (idArity var) (idStrictness var) dmd
-
   | gopt Opt_DmdTxDictSel (ae_dflags env),
     Just _ <- isClassOpId_maybe var -- Dictionary component selector
   = dmdTransformDictSelSig (idStrictness var) dmd



More information about the ghc-commits mailing list