[commit: ghc] wip/nested-cpr: Literals are Converging (80eca46)

git at git.haskell.org git at git.haskell.org
Fri Jan 17 23:49:52 UTC 2014


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

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

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

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

    Literals are Converging


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

80eca46835f54bae8fb32721a56ef4ba3c461534
 compiler/basicTypes/Demand.lhs                              |    5 +++--
 compiler/stranal/DmdAnal.lhs                                |    2 +-
 testsuite/tests/simplCore/should_compile/T4918.stdout       |    4 ++--
 testsuite/tests/simplCore/should_compile/T7360.stderr       |    2 +-
 testsuite/tests/simplCore/should_compile/spec-inline.stderr |    2 +-
 5 files changed, 8 insertions(+), 7 deletions(-)

diff --git a/compiler/basicTypes/Demand.lhs b/compiler/basicTypes/Demand.lhs
index 3eb3a90..7c38b48 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,
 
@@ -1062,9 +1062,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)
 
diff --git a/testsuite/tests/simplCore/should_compile/T4918.stdout b/testsuite/tests/simplCore/should_compile/T4918.stdout
index c79b116..dbbc675 100644
--- a/testsuite/tests/simplCore/should_compile/T4918.stdout
+++ b/testsuite/tests/simplCore/should_compile/T4918.stdout
@@ -1,2 +1,2 @@
-    {- HasNoCafRefs, Strictness: m, Unfolding: (GHC.Types.C# 'p') -}
-    {- HasNoCafRefs, Strictness: m, Unfolding: (GHC.Types.C# 'q') -}
+    {- HasNoCafRefs, Strictness: tm, Unfolding: (GHC.Types.C# 'p') -}
+    {- HasNoCafRefs, Strictness: tm, Unfolding: (GHC.Types.C# 'q') -}
diff --git a/testsuite/tests/simplCore/should_compile/T7360.stderr b/testsuite/tests/simplCore/should_compile/T7360.stderr
index f6ce7ed..5a04c74 100644
--- a/testsuite/tests/simplCore/should_compile/T7360.stderr
+++ b/testsuite/tests/simplCore/should_compile/T7360.stderr
@@ -37,7 +37,7 @@ T7360.fun4 = T7360.fun1 T7360.Foo1
 T7360.fun3 :: GHC.Types.Int
 [GblId,
  Caf=NoCafRefs,
- Str=DmdType m,
+ Str=DmdType tm,
  Unf=Unf{Src=<vanilla>, TopLvl=True, Arity=0, Value=True,
          ConLike=True, WorkFree=True, Expandable=True,
          Guidance=IF_ARGS [] 10 20}]
diff --git a/testsuite/tests/simplCore/should_compile/spec-inline.stderr b/testsuite/tests/simplCore/should_compile/spec-inline.stderr
index 055b643..0a53e18 100644
--- a/testsuite/tests/simplCore/should_compile/spec-inline.stderr
+++ b/testsuite/tests/simplCore/should_compile/spec-inline.stderr
@@ -113,7 +113,7 @@ Roman.foo_go =
 Roman.foo2 :: GHC.Types.Int
 [GblId,
  Caf=NoCafRefs,
- Str=DmdType m,
+ Str=DmdType tm,
  Unf=Unf{Src=<vanilla>, TopLvl=True, Arity=0, Value=True,
          ConLike=True, WorkFree=True, Expandable=True,
          Guidance=IF_ARGS [] 10 20}]



More information about the ghc-commits mailing list