[commit: ghc] wip/nested-cpr: In deferType, return convRes = Converges NoCPR (5a5c8de)

git at git.haskell.org git at git.haskell.org
Sun Dec 15 16:23:42 UTC 2013


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

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

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

commit 5a5c8de79441857a4c169992bddec22476d54c3b
Author: Joachim Breitner <mail at joachim-breitner.de>
Date:   Wed Dec 4 16:55:18 2013 +0000

    In deferType, return convRes = Converges NoCPR
    
    because this is the right-identity to `bothDmdResult`, and this is the
    right thing to do in a lazy context.


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

5a5c8de79441857a4c169992bddec22476d54c3b
 compiler/basicTypes/Demand.lhs |    7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/compiler/basicTypes/Demand.lhs b/compiler/basicTypes/Demand.lhs
index fc6a81a..717f5ed 100644
--- a/compiler/basicTypes/Demand.lhs
+++ b/compiler/basicTypes/Demand.lhs
@@ -776,8 +776,9 @@ seqCPRResult RetProd      = ()
 
 -- [cprRes] lets us switch off CPR analysis
 -- by making sure that everything uses TopRes
-topRes, botRes :: DmdResult
+topRes, convRes, botRes :: DmdResult
 topRes = Dunno NoCPR
+convRes = Converges NoCPR
 botRes = Diverges
 
 cprSumRes :: ConTag -> DmdResult
@@ -1182,9 +1183,9 @@ postProcessUnsat (True,  One)  ty = deferType ty
 postProcessUnsat (False, One)  ty = ty
 
 deferType, reuseType, deferReuse :: DmdType -> DmdType
-deferType  (DmdType fv ds _)      = DmdType (deferEnv fv)      (map deferDmd ds)      topRes
+deferType  (DmdType fv ds _)      = DmdType (deferEnv fv)      (map deferDmd ds)      convRes
 reuseType  (DmdType fv ds res_ty) = DmdType (reuseEnv fv)      (map reuseDmd ds)      res_ty
-deferReuse (DmdType fv ds _)      = DmdType (deferReuseEnv fv) (map deferReuseDmd ds) topRes
+deferReuse (DmdType fv ds _)      = DmdType (deferReuseEnv fv) (map deferReuseDmd ds) convRes
 
 deferEnv, reuseEnv, deferReuseEnv :: DmdEnv -> DmdEnv
 deferEnv      fv = mapVarEnv deferDmd fv



More information about the ghc-commits mailing list