[commit: ghc] wip/nested-cpr: Literals are Converging (6cfa6ea)

git at git.haskell.org git at git.haskell.org
Tue Feb 4 18:26:50 UTC 2014


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

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

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

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

    Literals are Converging


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

6cfa6ea0b305aa003a54e33eaf4280a380749f9d
 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 +-
 testsuite/tests/stranal/sigs/DmdAnalGADTs.stderr            |    2 +-
 6 files changed, 9 insertions(+), 8 deletions(-)

diff --git a/compiler/basicTypes/Demand.lhs b/compiler/basicTypes/Demand.lhs
index b2e762b..ec2c989 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, removeDmdTyArgs,
         BothDmdArg, mkBothDmdArg, toBothDmdArg,
 
@@ -1086,9 +1086,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 358b081..e14f066 100644
--- a/compiler/stranal/DmdAnal.lhs
+++ b/compiler/stranal/DmdAnal.lhs
@@ -136,7 +136,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}]
diff --git a/testsuite/tests/stranal/sigs/DmdAnalGADTs.stderr b/testsuite/tests/stranal/sigs/DmdAnalGADTs.stderr
index 7fb1a55..7c17d78 100644
--- a/testsuite/tests/stranal/sigs/DmdAnalGADTs.stderr
+++ b/testsuite/tests/stranal/sigs/DmdAnalGADTs.stderr
@@ -4,7 +4,7 @@ DmdAnalGADTs.diverges: b
 DmdAnalGADTs.f: <S,1*U>
 DmdAnalGADTs.f': <S,1*U>m
 DmdAnalGADTs.g: <S,1*U>
-DmdAnalGADTs.hasCPR: m
+DmdAnalGADTs.hasCPR: tm
 DmdAnalGADTs.hasStrSig: <S,1*U(U)>m
 
 



More information about the ghc-commits mailing list