[commit: ghc] wip/nested-cpr: deferType forgets CPR info (b7eab1c)

git at git.haskell.org git at git.haskell.org
Thu Nov 28 17:20:13 UTC 2013


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

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

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

commit b7eab1c313c463f0f0849b22d6de954cd6aa35f6
Author: Joachim Breitner <mail at joachim-breitner.de>
Date:   Thu Nov 28 17:16:58 2013 +0000

    deferType forgets CPR info
    
    If f is a function with some CPR info, e.g. <..>dm1(d), then using it
    unsaturated should rease the CPR, after all "a -> Int" is not a type
    where we can do CPRish transformations.


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

b7eab1c313c463f0f0849b22d6de954cd6aa35f6
 compiler/basicTypes/Demand.lhs |    6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/compiler/basicTypes/Demand.lhs b/compiler/basicTypes/Demand.lhs
index fd851f1..2dbb045 100644
--- a/compiler/basicTypes/Demand.lhs
+++ b/compiler/basicTypes/Demand.lhs
@@ -1151,15 +1151,11 @@ deferAndUse False One  ty = ty
 
 deferType :: DmdType -> DmdType
 -- Ie it might be used, or not 
-deferType (DmdType fv _ r) = DmdType (deferEnv fv) [] (deferResult r)
+deferType (DmdType fv _ _) = DmdType (deferEnv fv) [] topRes
 
 deferEnv :: DmdEnv -> DmdEnv
 deferEnv fv = mapVarEnv deferDmd fv
 
-deferResult :: DmdResult -> DmdResult
-deferResult Diverges = topRes  -- Kill outer divergence
-deferResult r        = r       -- Preserve CPR info
-
 useType :: DmdType -> DmdType
 -- useType ty1 == ty1 `bothType` ty1
 -- NB that bothType is assymetrical, so no-op on argument demands



More information about the ghc-commits mailing list