[commit: ghc] wip/nested-cpr: Literals are Converging (1f7b570)

git at git.haskell.org git at git.haskell.org
Wed Jan 15 18:06:47 UTC 2014


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

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

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

commit 1f7b570f49eeac126fefd2cf6434fdf6a61b3903
Author: Joachim Breitner <mail at joachim-breitner.de>
Date:   Fri Jan 10 13:39:22 2014 +0000

    Literals are Converging


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

1f7b570f49eeac126fefd2cf6434fdf6a61b3903
 compiler/basicTypes/Demand.lhs |    5 +++--
 compiler/stranal/DmdAnal.lhs   |    2 +-
 2 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/compiler/basicTypes/Demand.lhs b/compiler/basicTypes/Demand.lhs
index f839b52..8da0841 100644
--- a/compiler/basicTypes/Demand.lhs
+++ b/compiler/basicTypes/Demand.lhs
@@ -19,7 +19,7 @@ module Demand (
         peelUseCall, cleanUseDmd_maybe, strictenDmd, bothCleanDmd,
 
         DmdType(..), dmdTypeDepth, lubDmdType, lubDmdTypes, bothDmdType,
-        nopDmdType, botDmdType, mkDmdType,
+        nopDmdType, litDmdType, botDmdType, mkDmdType,
         addDemand,
         BothDmdArg, mkBothDmdArg, toBothDmdArg,
 
@@ -1107,9 +1107,10 @@ emptyDmdEnv = emptyVarEnv
 -- (lazy, absent, no CPR information, no termination information).
 -- Note that it is ''not'' the top of the lattice (which would be "may use everything"),
 -- so it is (no longer) called topDmd
-nopDmdType, botDmdType :: DmdType
+nopDmdType, litDmdType, botDmdType :: DmdType
 nopDmdType = DmdType emptyDmdEnv [] topRes
 botDmdType = DmdType emptyDmdEnv [] botRes
+litDmdType = DmdType emptyDmdEnv [] convRes
 
 cprProdDmdType :: Arity -> DmdType
 cprProdDmdType _arity
diff --git a/compiler/stranal/DmdAnal.lhs b/compiler/stranal/DmdAnal.lhs
index 7bfc7b2..12215d1 100644
--- a/compiler/stranal/DmdAnal.lhs
+++ b/compiler/stranal/DmdAnal.lhs
@@ -135,7 +135,7 @@ dmdAnal :: AnalEnv
 -- The CleanDemand is always strict and not absent
 --    See Note [Ensure demand is strict]
 
-dmdAnal _ _ (Lit lit)     = (nopDmdType, Lit lit)
+dmdAnal _ _ (Lit lit)     = (litDmdType, Lit lit)
 dmdAnal _ _ (Type ty)     = (nopDmdType, Type ty)	-- Doesn't happen, in fact
 dmdAnal _ _ (Coercion co) = (nopDmdType, Coercion co)
 



More information about the ghc-commits mailing list