[commit: ghc] wip/nested-cpr: Remove dmdTransformDataConSig (35001b7)

git at git.haskell.org git at git.haskell.org
Fri Jan 17 23:50:34 UTC 2014


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

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

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

commit 35001b7b2f3c9412cdec751d6db4a9b665540351
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


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

35001b7b2f3c9412cdec751d6db4a9b665540351
 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 0a864ed..763e466 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,
@@ -1538,30 +1538,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 a1e5eba..f0017bb 100644
--- a/compiler/stranal/DmdAnal.lhs
+++ b/compiler/stranal/DmdAnal.lhs
@@ -510,10 +510,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