[commit: ghc] wip/nested-cpr: Revert "deferType forgets CPR info" (42e19b5)
git at git.haskell.org
git at git.haskell.org
Thu Nov 28 18:49:44 UTC 2013
Repository : ssh://git@git.haskell.org/ghc
On branch : wip/nested-cpr
Link : http://ghc.haskell.org/trac/ghc/changeset/42e19b5839f8d8024829207a607015e0402a0d36/ghc
>---------------------------------------------------------------
commit 42e19b5839f8d8024829207a607015e0402a0d36
Author: Joachim Breitner <mail at joachim-breitner.de>
Date: Thu Nov 28 18:04:45 2013 +0000
Revert "deferType forgets CPR info"
This reverts commit b7eab1c313c463f0f0849b22d6de954cd6aa35f6.
>---------------------------------------------------------------
42e19b5839f8d8024829207a607015e0402a0d36
compiler/basicTypes/Demand.lhs | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/compiler/basicTypes/Demand.lhs b/compiler/basicTypes/Demand.lhs
index 561a43f..9cddcb5 100644
--- a/compiler/basicTypes/Demand.lhs
+++ b/compiler/basicTypes/Demand.lhs
@@ -1173,11 +1173,15 @@ deferAndUse False One ty = ty
deferType :: DmdType -> DmdType
-- Ie it might be used, or not
-deferType (DmdType fv _ _) = DmdType (deferEnv fv) [] topRes
+deferType (DmdType fv _ r) = DmdType (deferEnv fv) [] (deferResult r)
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