diff options
author | Sebastian Graf <sebastian.graf@kit.edu> | 2019-01-28 16:49:04 +0100 |
---|---|---|
committer | Sebastian Graf <sebastian.graf@kit.edu> | 2020-02-12 11:00:58 +0100 |
commit | 059c3c9d7c84fc37c69e9f414ff736d47081e72c (patch) | |
tree | da3c17ac002b9c6d31542af78553769fd40d5d65 /testsuite | |
parent | f0c0ee7d9a942a19361e72553cd08f42cc12b04a (diff) | |
download | haskell-059c3c9d7c84fc37c69e9f414ff736d47081e72c.tar.gz |
Separate CPR analysis from the Demand analyserwip/sep-cpr
The reasons for that can be found in the wiki:
https://gitlab.haskell.org/ghc/ghc/wikis/nested-cpr/split-off-cpr
We now run CPR after demand analysis (except for after the final demand
analysis run just before code gen). CPR got its own dump flags
(`-ddump-cpr-anal`, `-ddump-cpr-signatures`), but not its own flag to
activate/deactivate. It will run with `-fstrictness`/`-fworker-wrapper`.
As explained on the wiki page, this step is necessary for a sane Nested
CPR analysis. And it has quite positive impact on compiler performance:
Metric Decrease:
T9233
T9675
T9961
T15263
Diffstat (limited to 'testsuite')
31 files changed, 294 insertions, 169 deletions
diff --git a/testsuite/tests/deSugar/should_compile/T2431.stderr b/testsuite/tests/deSugar/should_compile/T2431.stderr index 1846656635..e2c903238c 100644 --- a/testsuite/tests/deSugar/should_compile/T2431.stderr +++ b/testsuite/tests/deSugar/should_compile/T2431.stderr @@ -7,7 +7,7 @@ Result size of Tidy Core T2431.$WRefl [InlPrag=INLINE[0]] :: forall a. a :~: a [GblId[DataConWrapper], Caf=NoCafRefs, - Str=m, + Cpr=m1, Unf=Unf{Src=InlineStable, TopLvl=True, Value=True, ConLike=True, WorkFree=True, Expandable=True, Guidance=ALWAYS_IF(arity=0,unsat_ok=True,boring_ok=True) @@ -17,7 +17,7 @@ T2431.$WRefl -- RHS size: {terms: 4, types: 8, coercions: 0, joins: 0/0} absurd :: forall a. (Int :~: Bool) -> a -[GblId, Arity=1, Str=<L,U>b, Unf=OtherCon []] +[GblId, Arity=1, Str=<L,U>b, Cpr=b, Unf=OtherCon []] absurd = \ (@a) (x :: Int :~: Bool) -> case x of { } -- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0} diff --git a/testsuite/tests/numeric/should_compile/T14170.stdout b/testsuite/tests/numeric/should_compile/T14170.stdout index 1371831160..700e8d8848 100644 --- a/testsuite/tests/numeric/should_compile/T14170.stdout +++ b/testsuite/tests/numeric/should_compile/T14170.stdout @@ -13,7 +13,7 @@ NatVal.$trModule4 = "main"# -- RHS size: {terms: 2, types: 0, coercions: 0, joins: 0/0} NatVal.$trModule3 :: GHC.Types.TrName [GblId, - Str=m1, + Cpr=m1, Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True, WorkFree=True, Expandable=True, Guidance=IF_ARGS [] 10 20}] NatVal.$trModule3 = GHC.Types.TrNameS NatVal.$trModule4 @@ -28,7 +28,7 @@ NatVal.$trModule2 = "NatVal"# -- RHS size: {terms: 2, types: 0, coercions: 0, joins: 0/0} NatVal.$trModule1 :: GHC.Types.TrName [GblId, - Str=m1, + Cpr=m1, Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True, WorkFree=True, Expandable=True, Guidance=IF_ARGS [] 10 20}] NatVal.$trModule1 = GHC.Types.TrNameS NatVal.$trModule2 @@ -36,7 +36,7 @@ NatVal.$trModule1 = GHC.Types.TrNameS NatVal.$trModule2 -- RHS size: {terms: 3, types: 0, coercions: 0, joins: 0/0} NatVal.$trModule :: GHC.Types.Module [GblId, - Str=m, + Cpr=m1, Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True, WorkFree=True, Expandable=True, Guidance=IF_ARGS [] 10 30}] NatVal.$trModule diff --git a/testsuite/tests/numeric/should_compile/T14465.stdout b/testsuite/tests/numeric/should_compile/T14465.stdout index f31f5a34f2..7a5f49177b 100644 --- a/testsuite/tests/numeric/should_compile/T14465.stdout +++ b/testsuite/tests/numeric/should_compile/T14465.stdout @@ -20,7 +20,7 @@ M.$trModule4 = "main"# -- RHS size: {terms: 2, types: 0, coercions: 0, joins: 0/0} M.$trModule3 :: GHC.Types.TrName [GblId, - Str=m1, + Cpr=m1, Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True, WorkFree=True, Expandable=True, Guidance=IF_ARGS [] 10 20}] M.$trModule3 = GHC.Types.TrNameS M.$trModule4 @@ -35,7 +35,7 @@ M.$trModule2 = "M"# -- RHS size: {terms: 2, types: 0, coercions: 0, joins: 0/0} M.$trModule1 :: GHC.Types.TrName [GblId, - Str=m1, + Cpr=m1, Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True, WorkFree=True, Expandable=True, Guidance=IF_ARGS [] 10 20}] M.$trModule1 = GHC.Types.TrNameS M.$trModule2 @@ -43,7 +43,7 @@ M.$trModule1 = GHC.Types.TrNameS M.$trModule2 -- RHS size: {terms: 3, types: 0, coercions: 0, joins: 0/0} M.$trModule :: GHC.Types.Module [GblId, - Str=m, + Cpr=m1, Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True, WorkFree=True, Expandable=True, Guidance=IF_ARGS [] 10 30}] M.$trModule = GHC.Types.Module M.$trModule3 M.$trModule1 diff --git a/testsuite/tests/numeric/should_compile/T7116.stdout b/testsuite/tests/numeric/should_compile/T7116.stdout index 6cf1040327..e9adc6b988 100644 --- a/testsuite/tests/numeric/should_compile/T7116.stdout +++ b/testsuite/tests/numeric/should_compile/T7116.stdout @@ -13,7 +13,7 @@ T7116.$trModule4 = "main"# -- RHS size: {terms: 2, types: 0, coercions: 0, joins: 0/0} T7116.$trModule3 :: GHC.Types.TrName [GblId, - Str=m1, + Cpr=m1, Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True, WorkFree=True, Expandable=True, Guidance=IF_ARGS [] 10 20}] T7116.$trModule3 = GHC.Types.TrNameS T7116.$trModule4 @@ -28,7 +28,7 @@ T7116.$trModule2 = "T7116"# -- RHS size: {terms: 2, types: 0, coercions: 0, joins: 0/0} T7116.$trModule1 :: GHC.Types.TrName [GblId, - Str=m1, + Cpr=m1, Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True, WorkFree=True, Expandable=True, Guidance=IF_ARGS [] 10 20}] T7116.$trModule1 = GHC.Types.TrNameS T7116.$trModule2 @@ -36,7 +36,7 @@ T7116.$trModule1 = GHC.Types.TrNameS T7116.$trModule2 -- RHS size: {terms: 3, types: 0, coercions: 0, joins: 0/0} T7116.$trModule :: GHC.Types.Module [GblId, - Str=m, + Cpr=m1, Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True, WorkFree=True, Expandable=True, Guidance=IF_ARGS [] 10 30}] T7116.$trModule @@ -46,7 +46,8 @@ T7116.$trModule dr :: Double -> Double [GblId, Arity=1, - Str=<S,1*U(U)>m, + Str=<S,1*U(U)>, + Cpr=m1, Unf=Unf{Src=InlineStable, TopLvl=True, Value=True, ConLike=True, WorkFree=True, Expandable=True, Guidance=ALWAYS_IF(arity=1,unsat_ok=True,boring_ok=False) @@ -62,7 +63,8 @@ dr dl :: Double -> Double [GblId, Arity=1, - Str=<S,1*U(U)>m, + Str=<S,1*U(U)>, + Cpr=m1, Unf=Unf{Src=InlineStable, TopLvl=True, Value=True, ConLike=True, WorkFree=True, Expandable=True, Guidance=ALWAYS_IF(arity=1,unsat_ok=True,boring_ok=False) @@ -74,7 +76,8 @@ dl = dr fr :: Float -> Float [GblId, Arity=1, - Str=<S,1*U(U)>m, + Str=<S,1*U(U)>, + Cpr=m1, Unf=Unf{Src=InlineStable, TopLvl=True, Value=True, ConLike=True, WorkFree=True, Expandable=True, Guidance=ALWAYS_IF(arity=1,unsat_ok=True,boring_ok=False) @@ -92,7 +95,8 @@ fr fl :: Float -> Float [GblId, Arity=1, - Str=<S,1*U(U)>m, + Str=<S,1*U(U)>, + Cpr=m1, Unf=Unf{Src=InlineStable, TopLvl=True, Value=True, ConLike=True, WorkFree=True, Expandable=True, Guidance=ALWAYS_IF(arity=1,unsat_ok=True,boring_ok=False) diff --git a/testsuite/tests/simplCore/should_compile/T13143.stderr b/testsuite/tests/simplCore/should_compile/T13143.stderr index 59f38d27bc..60345a669d 100644 --- a/testsuite/tests/simplCore/should_compile/T13143.stderr +++ b/testsuite/tests/simplCore/should_compile/T13143.stderr @@ -7,7 +7,7 @@ Rec { -- RHS size: {terms: 4, types: 4, coercions: 0, joins: 0/0} T13143.$wf [InlPrag=NOINLINE, Occ=LoopBreaker] :: forall a. GHC.Prim.Void# -> a -[GblId, Arity=1, Str=<B,A>b, Unf=OtherCon []] +[GblId, Arity=1, Str=<B,A>b, Cpr=b, Unf=OtherCon []] T13143.$wf = \ (@a) _ [Occ=Dead] -> T13143.$wf @a GHC.Prim.void# end Rec } @@ -16,6 +16,7 @@ f [InlPrag=NOUSERINLINE[0]] :: forall a. Int -> a [GblId, Arity=1, Str=<B,A>b, + Cpr=b, Unf=Unf{Src=InlineStable, TopLvl=True, Value=True, ConLike=True, WorkFree=True, Expandable=True, Guidance=ALWAYS_IF(arity=1,unsat_ok=True,boring_ok=True) @@ -32,7 +33,7 @@ T13143.$trModule4 = "main"# -- RHS size: {terms: 2, types: 0, coercions: 0, joins: 0/0} T13143.$trModule3 :: GHC.Types.TrName [GblId, - Str=m1, + Cpr=m1, Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True, WorkFree=True, Expandable=True, Guidance=IF_ARGS [] 10 20}] T13143.$trModule3 = GHC.Types.TrNameS T13143.$trModule4 @@ -47,7 +48,7 @@ T13143.$trModule2 = "T13143"# -- RHS size: {terms: 2, types: 0, coercions: 0, joins: 0/0} T13143.$trModule1 :: GHC.Types.TrName [GblId, - Str=m1, + Cpr=m1, Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True, WorkFree=True, Expandable=True, Guidance=IF_ARGS [] 10 20}] T13143.$trModule1 = GHC.Types.TrNameS T13143.$trModule2 @@ -55,7 +56,7 @@ T13143.$trModule1 = GHC.Types.TrNameS T13143.$trModule2 -- RHS size: {terms: 3, types: 0, coercions: 0, joins: 0/0} T13143.$trModule :: GHC.Types.Module [GblId, - Str=m, + Cpr=m1, Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True, WorkFree=True, Expandable=True, Guidance=IF_ARGS [] 10 30}] T13143.$trModule @@ -63,7 +64,7 @@ T13143.$trModule -- RHS size: {terms: 2, types: 1, coercions: 0, joins: 0/0} lvl :: Int -[GblId, Str=b] +[GblId, Str=b, Cpr=b] lvl = T13143.$wf @Int GHC.Prim.void# Rec { @@ -91,7 +92,8 @@ end Rec } g [InlPrag=NOUSERINLINE[2]] :: Bool -> Bool -> Int -> Int [GblId, Arity=3, - Str=<S,1*U><S,1*U><S,1*U(U)>m, + Str=<S,1*U><S,1*U><S,1*U(U)>, + Cpr=m1, Unf=Unf{Src=InlineStable, TopLvl=True, Value=True, ConLike=True, WorkFree=True, Expandable=True, Guidance=ALWAYS_IF(arity=3,unsat_ok=True,boring_ok=False) diff --git a/testsuite/tests/simplCore/should_compile/T13543.stderr b/testsuite/tests/simplCore/should_compile/T13543.stderr index 219f4f4fa5..9981084325 100644 --- a/testsuite/tests/simplCore/should_compile/T13543.stderr +++ b/testsuite/tests/simplCore/should_compile/T13543.stderr @@ -1,14 +1,21 @@ ==================== Strictness signatures ==================== -Foo.$trModule: m -Foo.f: <S(S),1*U(1*U)><S,1*U(U)><S,1*U(U)>m -Foo.g: <S(SS),1*U(1*U(U),1*U(U))>m +Foo.$trModule: +Foo.f: <S(S),1*U(1*U)><S,1*U(U)><S,1*U(U)> +Foo.g: <S(SS),1*U(1*U(U),1*U(U))> + + + +==================== Cpr signatures ==================== +Foo.$trModule: m1 +Foo.f: m1 +Foo.g: m1 ==================== Strictness signatures ==================== -Foo.$trModule: m -Foo.f: <S(S),1*U(1*U)><S,1*U(U)><S,1*U(U)>m -Foo.g: <S(SS),1*U(1*U(U),1*U(U))>m +Foo.$trModule: +Foo.f: <S(S),1*U(1*U)><S,1*U(U)><S,1*U(U)> +Foo.g: <S(SS),1*U(1*U(U),1*U(U))> diff --git a/testsuite/tests/simplCore/should_compile/T3717.stderr b/testsuite/tests/simplCore/should_compile/T3717.stderr index ca2158787c..1473c0f4c5 100644 --- a/testsuite/tests/simplCore/should_compile/T3717.stderr +++ b/testsuite/tests/simplCore/should_compile/T3717.stderr @@ -13,7 +13,7 @@ T3717.$trModule4 = "main"# -- RHS size: {terms: 2, types: 0, coercions: 0, joins: 0/0} T3717.$trModule3 :: GHC.Types.TrName [GblId, - Str=m1, + Cpr=m1, Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True, WorkFree=True, Expandable=True, Guidance=IF_ARGS [] 10 20}] T3717.$trModule3 = GHC.Types.TrNameS T3717.$trModule4 @@ -28,7 +28,7 @@ T3717.$trModule2 = "T3717"# -- RHS size: {terms: 2, types: 0, coercions: 0, joins: 0/0} T3717.$trModule1 :: GHC.Types.TrName [GblId, - Str=m1, + Cpr=m1, Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True, WorkFree=True, Expandable=True, Guidance=IF_ARGS [] 10 20}] T3717.$trModule1 = GHC.Types.TrNameS T3717.$trModule2 @@ -36,7 +36,7 @@ T3717.$trModule1 = GHC.Types.TrNameS T3717.$trModule2 -- RHS size: {terms: 3, types: 0, coercions: 0, joins: 0/0} T3717.$trModule :: GHC.Types.Module [GblId, - Str=m, + Cpr=m1, Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True, WorkFree=True, Expandable=True, Guidance=IF_ARGS [] 10 30}] T3717.$trModule @@ -59,7 +59,8 @@ end Rec } foo [InlPrag=NOUSERINLINE[2]] :: Int -> Int [GblId, Arity=1, - Str=<S(S),1*U(1*U)>m, + Str=<S(S),1*U(1*U)>, + Cpr=m1, Unf=Unf{Src=InlineStable, TopLvl=True, Value=True, ConLike=True, WorkFree=True, Expandable=True, Guidance=ALWAYS_IF(arity=1,unsat_ok=True,boring_ok=False) diff --git a/testsuite/tests/simplCore/should_compile/T3772.stdout b/testsuite/tests/simplCore/should_compile/T3772.stdout index 7ccb3f4852..f4580428b2 100644 --- a/testsuite/tests/simplCore/should_compile/T3772.stdout +++ b/testsuite/tests/simplCore/should_compile/T3772.stdout @@ -13,7 +13,7 @@ T3772.$trModule4 = "main"# -- RHS size: {terms: 2, types: 0, coercions: 0, joins: 0/0} T3772.$trModule3 :: GHC.Types.TrName [GblId, - Str=m1, + Cpr=m1, Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True, WorkFree=True, Expandable=True, Guidance=IF_ARGS [] 10 20}] T3772.$trModule3 = GHC.Types.TrNameS T3772.$trModule4 @@ -28,7 +28,7 @@ T3772.$trModule2 = "T3772"# -- RHS size: {terms: 2, types: 0, coercions: 0, joins: 0/0} T3772.$trModule1 :: GHC.Types.TrName [GblId, - Str=m1, + Cpr=m1, Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True, WorkFree=True, Expandable=True, Guidance=IF_ARGS [] 10 20}] T3772.$trModule1 = GHC.Types.TrNameS T3772.$trModule2 @@ -36,7 +36,7 @@ T3772.$trModule1 = GHC.Types.TrNameS T3772.$trModule2 -- RHS size: {terms: 3, types: 0, coercions: 0, joins: 0/0} T3772.$trModule :: GHC.Types.Module [GblId, - Str=m, + Cpr=m1, Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True, WorkFree=True, Expandable=True, Guidance=IF_ARGS [] 10 30}] T3772.$trModule diff --git a/testsuite/tests/simplCore/should_compile/T4201.stdout b/testsuite/tests/simplCore/should_compile/T4201.stdout index 9eb50c4360..0ee2f5c7e9 100644 --- a/testsuite/tests/simplCore/should_compile/T4201.stdout +++ b/testsuite/tests/simplCore/should_compile/T4201.stdout @@ -1,3 +1,3 @@ - {- HasNoCafRefs, Arity: 1, Strictness: <S,1*H>, + {- HasNoCafRefs, Arity: 1, Strictness: <S,1*H>, CPR: m1, Unfolding: InlineRule (0, True, True) bof `cast` (Sym (N:Foo[0]) ->_R <T>_R) -} diff --git a/testsuite/tests/simplCore/should_compile/T4908.stderr b/testsuite/tests/simplCore/should_compile/T4908.stderr index 38777e526e..fc7ed19361 100644 --- a/testsuite/tests/simplCore/should_compile/T4908.stderr +++ b/testsuite/tests/simplCore/should_compile/T4908.stderr @@ -13,7 +13,7 @@ T4908.$trModule4 = "main"# -- RHS size: {terms: 2, types: 0, coercions: 0, joins: 0/0} T4908.$trModule3 :: TrName [GblId, - Str=m1, + Cpr=m1, Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True, WorkFree=True, Expandable=True, Guidance=IF_ARGS [] 10 20}] T4908.$trModule3 = GHC.Types.TrNameS T4908.$trModule4 @@ -28,7 +28,7 @@ T4908.$trModule2 = "T4908"# -- RHS size: {terms: 2, types: 0, coercions: 0, joins: 0/0} T4908.$trModule1 :: TrName [GblId, - Str=m1, + Cpr=m1, Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True, WorkFree=True, Expandable=True, Guidance=IF_ARGS [] 10 20}] T4908.$trModule1 = GHC.Types.TrNameS T4908.$trModule2 @@ -36,7 +36,7 @@ T4908.$trModule1 = GHC.Types.TrNameS T4908.$trModule2 -- RHS size: {terms: 3, types: 0, coercions: 0, joins: 0/0} T4908.$trModule :: Module [GblId, - Str=m, + Cpr=m1, Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True, WorkFree=True, Expandable=True, Guidance=IF_ARGS [] 10 30}] T4908.$trModule diff --git a/testsuite/tests/simplCore/should_compile/T4930.stderr b/testsuite/tests/simplCore/should_compile/T4930.stderr index 534a43561d..2ac55f468e 100644 --- a/testsuite/tests/simplCore/should_compile/T4930.stderr +++ b/testsuite/tests/simplCore/should_compile/T4930.stderr @@ -13,7 +13,7 @@ T4930.$trModule4 = "main"# -- RHS size: {terms: 2, types: 0, coercions: 0, joins: 0/0} T4930.$trModule3 :: GHC.Types.TrName [GblId, - Str=m1, + Cpr=m1, Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True, WorkFree=True, Expandable=True, Guidance=IF_ARGS [] 10 20}] T4930.$trModule3 = GHC.Types.TrNameS T4930.$trModule4 @@ -28,7 +28,7 @@ T4930.$trModule2 = "T4930"# -- RHS size: {terms: 2, types: 0, coercions: 0, joins: 0/0} T4930.$trModule1 :: GHC.Types.TrName [GblId, - Str=m1, + Cpr=m1, Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True, WorkFree=True, Expandable=True, Guidance=IF_ARGS [] 10 20}] T4930.$trModule1 = GHC.Types.TrNameS T4930.$trModule2 @@ -36,7 +36,7 @@ T4930.$trModule1 = GHC.Types.TrNameS T4930.$trModule2 -- RHS size: {terms: 3, types: 0, coercions: 0, joins: 0/0} T4930.$trModule :: GHC.Types.Module [GblId, - Str=m, + Cpr=m1, Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True, WorkFree=True, Expandable=True, Guidance=IF_ARGS [] 10 30}] T4930.$trModule @@ -59,7 +59,8 @@ end Rec } foo [InlPrag=NOUSERINLINE[2]] :: Int -> Int [GblId, Arity=1, - Str=<S,1*U(U)>m, + Str=<S,1*U(U)>, + Cpr=m1, Unf=Unf{Src=InlineStable, TopLvl=True, Value=True, ConLike=True, WorkFree=True, Expandable=True, Guidance=ALWAYS_IF(arity=1,unsat_ok=True,boring_ok=False) diff --git a/testsuite/tests/simplCore/should_compile/T7360.stderr b/testsuite/tests/simplCore/should_compile/T7360.stderr index 687377bef0..61892a5bbc 100644 --- a/testsuite/tests/simplCore/should_compile/T7360.stderr +++ b/testsuite/tests/simplCore/should_compile/T7360.stderr @@ -8,7 +8,8 @@ T7360.$WFoo3 [InlPrag=INLINE[0]] :: Int -> Foo [GblId[DataConWrapper], Arity=1, Caf=NoCafRefs, - Str=<S,U>m3, + Str=<S,U>, + Cpr=m3, Unf=Unf{Src=InlineStable, TopLvl=True, Value=True, ConLike=True, WorkFree=True, Expandable=True, Guidance=ALWAYS_IF(arity=1,unsat_ok=True,boring_ok=False) @@ -33,7 +34,7 @@ T7360.fun5 = fun1 T7360.Foo1 -- RHS size: {terms: 2, types: 0, coercions: 0, joins: 0/0} T7360.fun4 :: Int [GblId, - Str=m, + Cpr=m1, Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True, WorkFree=True, Expandable=True, Guidance=IF_ARGS [] 10 20}] T7360.fun4 = GHC.Types.I# 0# @@ -42,7 +43,8 @@ T7360.fun4 = GHC.Types.I# 0# fun2 :: forall a. [a] -> ((), Int) [GblId, Arity=1, - Str=<L,1*U>m, + Str=<L,1*U>, + Cpr=m1, Unf=Unf{Src=InlineStable, TopLvl=True, Value=True, ConLike=True, WorkFree=True, Expandable=True, Guidance=ALWAYS_IF(arity=1,unsat_ok=True,boring_ok=False) @@ -76,7 +78,7 @@ T7360.$trModule4 = "main"# -- RHS size: {terms: 2, types: 0, coercions: 0, joins: 0/0} T7360.$trModule3 :: GHC.Types.TrName [GblId, - Str=m1, + Cpr=m1, Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True, WorkFree=True, Expandable=True, Guidance=IF_ARGS [] 10 20}] T7360.$trModule3 = GHC.Types.TrNameS T7360.$trModule4 @@ -91,7 +93,7 @@ T7360.$trModule2 = "T7360"# -- RHS size: {terms: 2, types: 0, coercions: 0, joins: 0/0} T7360.$trModule1 :: GHC.Types.TrName [GblId, - Str=m1, + Cpr=m1, Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True, WorkFree=True, Expandable=True, Guidance=IF_ARGS [] 10 20}] T7360.$trModule1 = GHC.Types.TrNameS T7360.$trModule2 @@ -99,7 +101,7 @@ T7360.$trModule1 = GHC.Types.TrNameS T7360.$trModule2 -- RHS size: {terms: 3, types: 0, coercions: 0, joins: 0/0} T7360.$trModule :: GHC.Types.Module [GblId, - Str=m, + Cpr=m1, Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True, WorkFree=True, Expandable=True, Guidance=IF_ARGS [] 10 30}] T7360.$trModule @@ -107,7 +109,7 @@ T7360.$trModule -- RHS size: {terms: 3, types: 1, coercions: 0, joins: 0/0} $krep :: GHC.Types.KindRep -[GblId, Str=m1, Unf=OtherCon []] +[GblId, Cpr=m1, Unf=OtherCon []] $krep = GHC.Types.KindRepTyConApp GHC.Types.$tcInt (GHC.Types.[] @GHC.Types.KindRep) @@ -122,7 +124,7 @@ T7360.$tcFoo2 = "Foo"# -- RHS size: {terms: 2, types: 0, coercions: 0, joins: 0/0} T7360.$tcFoo1 :: GHC.Types.TrName [GblId, - Str=m1, + Cpr=m1, Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True, WorkFree=True, Expandable=True, Guidance=IF_ARGS [] 10 20}] T7360.$tcFoo1 = GHC.Types.TrNameS T7360.$tcFoo2 @@ -130,7 +132,7 @@ T7360.$tcFoo1 = GHC.Types.TrNameS T7360.$tcFoo2 -- RHS size: {terms: 7, types: 0, coercions: 0, joins: 0/0} T7360.$tcFoo :: GHC.Types.TyCon [GblId, - Str=m, + Cpr=m1, Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True, WorkFree=True, Expandable=True, Guidance=IF_ARGS [] 10 70}] T7360.$tcFoo @@ -144,7 +146,7 @@ T7360.$tcFoo -- RHS size: {terms: 3, types: 1, coercions: 0, joins: 0/0} T7360.$tc'Foo4 [InlPrag=NOUSERINLINE[~]] :: GHC.Types.KindRep -[GblId, Str=m1, Unf=OtherCon []] +[GblId, Cpr=m1, Unf=OtherCon []] T7360.$tc'Foo4 = GHC.Types.KindRepTyConApp T7360.$tcFoo (GHC.Types.[] @GHC.Types.KindRep) @@ -159,7 +161,7 @@ T7360.$tc'Foo6 = "'Foo1"# -- RHS size: {terms: 2, types: 0, coercions: 0, joins: 0/0} T7360.$tc'Foo5 :: GHC.Types.TrName [GblId, - Str=m1, + Cpr=m1, Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True, WorkFree=True, Expandable=True, Guidance=IF_ARGS [] 10 20}] T7360.$tc'Foo5 = GHC.Types.TrNameS T7360.$tc'Foo6 @@ -167,7 +169,7 @@ T7360.$tc'Foo5 = GHC.Types.TrNameS T7360.$tc'Foo6 -- RHS size: {terms: 7, types: 0, coercions: 0, joins: 0/0} T7360.$tc'Foo1 :: GHC.Types.TyCon [GblId, - Str=m, + Cpr=m1, Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True, WorkFree=True, Expandable=True, Guidance=IF_ARGS [] 10 70}] T7360.$tc'Foo1 @@ -189,7 +191,7 @@ T7360.$tc'Foo8 = "'Foo2"# -- RHS size: {terms: 2, types: 0, coercions: 0, joins: 0/0} T7360.$tc'Foo7 :: GHC.Types.TrName [GblId, - Str=m1, + Cpr=m1, Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True, WorkFree=True, Expandable=True, Guidance=IF_ARGS [] 10 20}] T7360.$tc'Foo7 = GHC.Types.TrNameS T7360.$tc'Foo8 @@ -197,7 +199,7 @@ T7360.$tc'Foo7 = GHC.Types.TrNameS T7360.$tc'Foo8 -- RHS size: {terms: 7, types: 0, coercions: 0, joins: 0/0} T7360.$tc'Foo2 :: GHC.Types.TyCon [GblId, - Str=m, + Cpr=m1, Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True, WorkFree=True, Expandable=True, Guidance=IF_ARGS [] 10 70}] T7360.$tc'Foo2 @@ -211,7 +213,7 @@ T7360.$tc'Foo2 -- RHS size: {terms: 3, types: 0, coercions: 0, joins: 0/0} T7360.$tc'Foo9 [InlPrag=NOUSERINLINE[~]] :: GHC.Types.KindRep -[GblId, Str=m4, Unf=OtherCon []] +[GblId, Cpr=m4, Unf=OtherCon []] T7360.$tc'Foo9 = GHC.Types.KindRepFun $krep T7360.$tc'Foo4 -- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0} @@ -224,7 +226,7 @@ T7360.$tc'Foo11 = "'Foo3"# -- RHS size: {terms: 2, types: 0, coercions: 0, joins: 0/0} T7360.$tc'Foo10 :: GHC.Types.TrName [GblId, - Str=m1, + Cpr=m1, Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True, WorkFree=True, Expandable=True, Guidance=IF_ARGS [] 10 20}] T7360.$tc'Foo10 = GHC.Types.TrNameS T7360.$tc'Foo11 @@ -232,7 +234,7 @@ T7360.$tc'Foo10 = GHC.Types.TrNameS T7360.$tc'Foo11 -- RHS size: {terms: 7, types: 0, coercions: 0, joins: 0/0} T7360.$tc'Foo3 :: GHC.Types.TyCon [GblId, - Str=m, + Cpr=m1, Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True, WorkFree=True, Expandable=True, Guidance=IF_ARGS [] 10 70}] T7360.$tc'Foo3 diff --git a/testsuite/tests/simplCore/should_compile/all.T b/testsuite/tests/simplCore/should_compile/all.T index 7146b76e6d..64a4e6df36 100644 --- a/testsuite/tests/simplCore/should_compile/all.T +++ b/testsuite/tests/simplCore/should_compile/all.T @@ -243,7 +243,7 @@ test('T13410', normal, compile, ['-O2']) test('T13468', normal, makefile_test, ['T13468']) -test('T13543', only_ways(['optasm']), compile, ['-ddump-str-signatures']) +test('T13543', only_ways(['optasm']), compile, ['-ddump-str-signatures -ddump-cpr-signatures']) test('T11272', normal, makefile_test, ['T11272']) diff --git a/testsuite/tests/simplCore/should_compile/noinline01.stderr b/testsuite/tests/simplCore/should_compile/noinline01.stderr index 2b15450864..3b5a9c2919 100644 --- a/testsuite/tests/simplCore/should_compile/noinline01.stderr +++ b/testsuite/tests/simplCore/should_compile/noinline01.stderr @@ -14,7 +14,7 @@ Noinline01.$trModule4 :: GHC.Prim.Addr# "main"#; Noinline01.$trModule3 :: GHC.Types.TrName -[GblId, Str=m1, Unf=OtherCon []] = +[GblId, Cpr=m1, Unf=OtherCon []] = CCS_DONT_CARE GHC.Types.TrNameS! [Noinline01.$trModule4]; Noinline01.$trModule2 :: GHC.Prim.Addr# @@ -22,11 +22,11 @@ Noinline01.$trModule2 :: GHC.Prim.Addr# "Noinline01"#; Noinline01.$trModule1 :: GHC.Types.TrName -[GblId, Str=m1, Unf=OtherCon []] = +[GblId, Cpr=m1, Unf=OtherCon []] = CCS_DONT_CARE GHC.Types.TrNameS! [Noinline01.$trModule2]; Noinline01.$trModule :: GHC.Types.Module -[GblId, Str=m, Unf=OtherCon []] = +[GblId, Cpr=m1, Unf=OtherCon []] = CCS_DONT_CARE GHC.Types.Module! [Noinline01.$trModule3 Noinline01.$trModule1]; diff --git a/testsuite/tests/simplCore/should_compile/par01.stderr b/testsuite/tests/simplCore/should_compile/par01.stderr index 98de76e1ca..1a8cdfd453 100644 --- a/testsuite/tests/simplCore/should_compile/par01.stderr +++ b/testsuite/tests/simplCore/should_compile/par01.stderr @@ -21,7 +21,7 @@ Par01.$trModule4 = "main"# -- RHS size: {terms: 2, types: 0, coercions: 0, joins: 0/0} Par01.$trModule3 :: GHC.Types.TrName -[GblId, Str=m1, Unf=OtherCon []] +[GblId, Cpr=m1, Unf=OtherCon []] Par01.$trModule3 = GHC.Types.TrNameS Par01.$trModule4 -- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0} @@ -31,12 +31,12 @@ Par01.$trModule2 = "Par01"# -- RHS size: {terms: 2, types: 0, coercions: 0, joins: 0/0} Par01.$trModule1 :: GHC.Types.TrName -[GblId, Str=m1, Unf=OtherCon []] +[GblId, Cpr=m1, Unf=OtherCon []] Par01.$trModule1 = GHC.Types.TrNameS Par01.$trModule2 -- RHS size: {terms: 3, types: 0, coercions: 0, joins: 0/0} Par01.$trModule :: GHC.Types.Module -[GblId, Str=m, Unf=OtherCon []] +[GblId, Cpr=m1, Unf=OtherCon []] Par01.$trModule = GHC.Types.Module Par01.$trModule3 Par01.$trModule1 diff --git a/testsuite/tests/simplCore/should_compile/spec-inline.stderr b/testsuite/tests/simplCore/should_compile/spec-inline.stderr index 7cfd4442b3..5fdb90039e 100644 --- a/testsuite/tests/simplCore/should_compile/spec-inline.stderr +++ b/testsuite/tests/simplCore/should_compile/spec-inline.stderr @@ -13,7 +13,7 @@ Roman.$trModule4 = "main"# -- RHS size: {terms: 2, types: 0, coercions: 0, joins: 0/0} Roman.$trModule3 :: GHC.Types.TrName [GblId, - Str=m1, + Cpr=m1, Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True, WorkFree=True, Expandable=True, Guidance=IF_ARGS [] 10 20}] Roman.$trModule3 = GHC.Types.TrNameS Roman.$trModule4 @@ -28,7 +28,7 @@ Roman.$trModule2 = "Roman"# -- RHS size: {terms: 2, types: 0, coercions: 0, joins: 0/0} Roman.$trModule1 :: GHC.Types.TrName [GblId, - Str=m1, + Cpr=m1, Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True, WorkFree=True, Expandable=True, Guidance=IF_ARGS [] 10 20}] Roman.$trModule1 = GHC.Types.TrNameS Roman.$trModule2 @@ -36,7 +36,7 @@ Roman.$trModule1 = GHC.Types.TrNameS Roman.$trModule2 -- RHS size: {terms: 3, types: 0, coercions: 0, joins: 0/0} Roman.$trModule :: GHC.Types.Module [GblId, - Str=m, + Cpr=m1, Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True, WorkFree=True, Expandable=True, Guidance=IF_ARGS [] 10 30}] Roman.$trModule @@ -49,7 +49,7 @@ lvl = "spec-inline.hs:(19,5)-(29,25)|function go"# -- RHS size: {terms: 2, types: 2, coercions: 0, joins: 0/0} Roman.foo3 :: Int -[GblId, Str=b] +[GblId, Str=b, Cpr=b] Roman.foo3 = Control.Exception.Base.patError @'GHC.Types.LiftedRep @Int lvl @@ -116,7 +116,8 @@ Roman.foo_go [InlPrag=NOUSERINLINE[2]] :: Maybe Int -> Maybe Int -> Int [GblId, Arity=2, - Str=<S,1*U><S,1*U>m, + Str=<S,1*U><S,1*U>, + Cpr=m1, Unf=Unf{Src=InlineStable, TopLvl=True, Value=True, ConLike=True, WorkFree=True, Expandable=True, Guidance=ALWAYS_IF(arity=2,unsat_ok=True,boring_ok=False) @@ -131,7 +132,7 @@ Roman.foo_go -- RHS size: {terms: 2, types: 0, coercions: 0, joins: 0/0} Roman.foo2 :: Int [GblId, - Str=m, + Cpr=m1, Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True, WorkFree=True, Expandable=True, Guidance=IF_ARGS [] 10 20}] Roman.foo2 = GHC.Types.I# 6# @@ -139,7 +140,7 @@ Roman.foo2 = GHC.Types.I# 6# -- RHS size: {terms: 2, types: 1, coercions: 0, joins: 0/0} Roman.foo1 :: Maybe Int [GblId, - Str=m2, + Cpr=m2, Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True, WorkFree=True, Expandable=True, Guidance=IF_ARGS [] 10 20}] Roman.foo1 = GHC.Maybe.Just @Int Roman.foo2 @@ -148,7 +149,8 @@ Roman.foo1 = GHC.Maybe.Just @Int Roman.foo2 foo :: Int -> Int [GblId, Arity=1, - Str=<S,1*U(U)>m, + Str=<S,1*U(U)>, + Cpr=m1, Unf=Unf{Src=InlineStable, TopLvl=True, Value=True, ConLike=True, WorkFree=True, Expandable=True, Guidance=ALWAYS_IF(arity=1,unsat_ok=True,boring_ok=False) diff --git a/testsuite/tests/stranal/should_compile/T10694.stderr b/testsuite/tests/stranal/should_compile/T10694.stderr index 90ab9475f2..5eb2c186ad 100644 --- a/testsuite/tests/stranal/should_compile/T10694.stderr +++ b/testsuite/tests/stranal/should_compile/T10694.stderr @@ -6,37 +6,38 @@ Result size of Tidy Core = {terms: 74, types: 65, coercions: 0, joins: 0/4} T10694.$wpm [InlPrag=NOINLINE] :: Int -> Int -> (# Int, Int #) [GblId, Arity=2, Str=<L,U(U)><L,U(U)>, Unf=OtherCon []] T10694.$wpm - = \ (w_s1v7 :: Int) (w1_s1v8 :: Int) -> + = \ (w_s1vj :: Int) (w1_s1vk :: Int) -> let { - l_s1u8 :: Int + l_s1uR :: Int [LclId] - l_s1u8 - = case w_s1v7 of { GHC.Types.I# x_a1ty -> case w1_s1v8 of { GHC.Types.I# y_a1tC -> GHC.Types.I# (GHC.Prim.+# x_a1ty y_a1tC) } } } in + l_s1uR + = case w_s1vj of { GHC.Types.I# x_aJ9 -> case w1_s1vk of { GHC.Types.I# y_aJc -> GHC.Types.I# (GHC.Prim.+# x_aJ9 y_aJc) } } } in let { - l1_s1u9 :: Int + l1_s1uS :: Int [LclId] - l1_s1u9 - = case w_s1v7 of { GHC.Types.I# x_a1tI -> case w1_s1v8 of { GHC.Types.I# y_a1tM -> GHC.Types.I# (GHC.Prim.-# x_a1tI y_a1tM) } } } in + l1_s1uS + = case w_s1vj of { GHC.Types.I# x_aJh -> case w1_s1vk of { GHC.Types.I# y_aJk -> GHC.Types.I# (GHC.Prim.-# x_aJh y_aJk) } } } in let { - l2_s1ua :: [Int] + l2_s1uT :: [Int] [LclId, Unf=OtherCon []] - l2_s1ua = GHC.Types.: @ Int l1_s1u9 (GHC.Types.[] @ Int) } in + l2_s1uT = GHC.Types.: @Int l1_s1uS (GHC.Types.[] @Int) } in let { - l3_s1tZ :: [Int] + l3_sJv :: [Int] [LclId, Unf=OtherCon []] - l3_s1tZ = GHC.Types.: @ Int l_s1u8 l2_s1ua } in - (# GHC.List.$w!! @ Int l3_s1tZ 0#, GHC.List.$w!! @ Int l3_s1tZ 1# #) + l3_sJv = GHC.Types.: @Int l_s1uR l2_s1uT } in + (# GHC.List.$w!! @Int l3_sJv 0#, GHC.List.$w!! @Int l3_sJv 1# #) -- RHS size: {terms: 10, types: 11, coercions: 0, joins: 0/0} pm [InlPrag=NOUSERINLINE[0]] :: Int -> Int -> (Int, Int) [GblId, Arity=2, - Str=<L,U(U)><L,U(U)>m, + Str=<L,U(U)><L,U(U)>, + Cpr=m1, Unf=Unf{Src=InlineStable, TopLvl=True, Value=True, ConLike=True, WorkFree=True, Expandable=True, Guidance=ALWAYS_IF(arity=2,unsat_ok=True,boring_ok=False) - Tmpl= \ (w_s1v7 [Occ=Once] :: Int) (w1_s1v8 [Occ=Once] :: Int) -> - case T10694.$wpm w_s1v7 w1_s1v8 of { (# ww1_s1vd [Occ=Once], ww2_s1ve [Occ=Once] #) -> (ww1_s1vd, ww2_s1ve) }}] -pm = \ (w_s1v7 :: Int) (w1_s1v8 :: Int) -> case T10694.$wpm w_s1v7 w1_s1v8 of { (# ww1_s1vd, ww2_s1ve #) -> (ww1_s1vd, ww2_s1ve) } + Tmpl= \ (w_s1vj [Occ=Once] :: Int) (w1_s1vk [Occ=Once] :: Int) -> + case T10694.$wpm w_s1vj w1_s1vk of { (# ww1_s1vp [Occ=Once], ww2_s1vq [Occ=Once] #) -> (ww1_s1vp, ww2_s1vq) }}] +pm = \ (w_s1vj :: Int) (w1_s1vk :: Int) -> case T10694.$wpm w_s1vj w1_s1vk of { (# ww1_s1vp, ww2_s1vq #) -> (ww1_s1vp, ww2_s1vq) } -- RHS size: {terms: 8, types: 9, coercions: 0, joins: 0/0} m :: Int -> Int -> Int @@ -45,45 +46,38 @@ m :: Int -> Int -> Int Str=<L,U(U)><L,U(U)>, Unf=Unf{Src=InlineStable, TopLvl=True, Value=True, ConLike=True, WorkFree=True, Expandable=True, Guidance=ALWAYS_IF(arity=2,unsat_ok=True,boring_ok=False) - Tmpl= \ (x_a12s [Occ=Once] :: Int) (y_a12t [Occ=Once] :: Int) -> - case pm x_a12s y_a12t of { (_ [Occ=Dead], mr_a12v [Occ=Once]) -> mr_a12v }}] -m = \ (x_a12s :: Int) (y_a12t :: Int) -> case T10694.$wpm x_a12s y_a12t of { (# ww1_s1vd, ww2_s1ve #) -> ww2_s1ve } + Tmpl= \ (x_awt [Occ=Once] :: Int) (y_awu [Occ=Once] :: Int) -> + case pm x_awt y_awu of { (_ [Occ=Dead], mr_aww [Occ=Once]) -> mr_aww }}] +m = \ (x_awt :: Int) (y_awu :: Int) -> case T10694.$wpm x_awt y_awu of { (# ww1_s1vp, ww2_s1vq #) -> ww2_s1vq } -- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0} T10694.$trModule4 :: GHC.Prim.Addr# -[GblId, - Caf=NoCafRefs, - Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True, WorkFree=True, Expandable=True, Guidance=IF_ARGS [] 20 0}] +[GblId, Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True, WorkFree=True, Expandable=True, Guidance=IF_ARGS [] 20 0}] T10694.$trModule4 = "main"# -- RHS size: {terms: 2, types: 0, coercions: 0, joins: 0/0} T10694.$trModule3 :: GHC.Types.TrName [GblId, - Caf=NoCafRefs, - Str=m1, + Cpr=m1, Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True, WorkFree=True, Expandable=True, Guidance=IF_ARGS [] 10 20}] T10694.$trModule3 = GHC.Types.TrNameS T10694.$trModule4 -- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0} T10694.$trModule2 :: GHC.Prim.Addr# -[GblId, - Caf=NoCafRefs, - Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True, WorkFree=True, Expandable=True, Guidance=IF_ARGS [] 30 0}] +[GblId, Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True, WorkFree=True, Expandable=True, Guidance=IF_ARGS [] 30 0}] T10694.$trModule2 = "T10694"# -- RHS size: {terms: 2, types: 0, coercions: 0, joins: 0/0} T10694.$trModule1 :: GHC.Types.TrName [GblId, - Caf=NoCafRefs, - Str=m1, + Cpr=m1, Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True, WorkFree=True, Expandable=True, Guidance=IF_ARGS [] 10 20}] T10694.$trModule1 = GHC.Types.TrNameS T10694.$trModule2 -- RHS size: {terms: 3, types: 0, coercions: 0, joins: 0/0} T10694.$trModule :: GHC.Types.Module [GblId, - Caf=NoCafRefs, - Str=m, + Cpr=m1, Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True, WorkFree=True, Expandable=True, Guidance=IF_ARGS [] 10 30}] T10694.$trModule = GHC.Types.Module T10694.$trModule3 T10694.$trModule1 diff --git a/testsuite/tests/stranal/should_compile/all.T b/testsuite/tests/stranal/should_compile/all.T index 970417e11c..c47a0cbd7b 100644 --- a/testsuite/tests/stranal/should_compile/all.T +++ b/testsuite/tests/stranal/should_compile/all.T @@ -33,7 +33,7 @@ test('T9208', when(compiler_debugged(), expect_broken(9208)), compile, ['']) # T9208 fails (and should do so) if you have assertion checking on in the compiler # Hence the above expect_broken. See comments in the ticket -test('T10694', [ grep_errmsg(r'Str=') ], compile, ['-dppr-cols=200 -ddump-simpl']) +test('T10694', [ grep_errmsg(r'(Str|Cpr)=') ], compile, ['-dppr-cols=200 -ddump-simpl']) test('T11770', [ check_errmsg('OneShot') ], compile, ['-ddump-simpl']) test('T13031', normal, makefile_test, []) diff --git a/testsuite/tests/stranal/sigs/BottomFromInnerLambda.stderr b/testsuite/tests/stranal/sigs/BottomFromInnerLambda.stderr index 90fc14a606..259b5965e6 100644 --- a/testsuite/tests/stranal/sigs/BottomFromInnerLambda.stderr +++ b/testsuite/tests/stranal/sigs/BottomFromInnerLambda.stderr @@ -1,14 +1,21 @@ ==================== Strictness signatures ==================== -BottomFromInnerLambda.$trModule: m -BottomFromInnerLambda.expensive: <S(S),1*U(U)>m +BottomFromInnerLambda.$trModule: +BottomFromInnerLambda.expensive: <S(S),1*U(U)> BottomFromInnerLambda.f: <S(S),1*U(U)> +==================== Cpr signatures ==================== +BottomFromInnerLambda.$trModule: m1 +BottomFromInnerLambda.expensive: m1 +BottomFromInnerLambda.f: + + + ==================== Strictness signatures ==================== -BottomFromInnerLambda.$trModule: m -BottomFromInnerLambda.expensive: <S(S),1*U(1*U)>m +BottomFromInnerLambda.$trModule: +BottomFromInnerLambda.expensive: <S(S),1*U(1*U)> BottomFromInnerLambda.f: <S(S),1*U(1*U)> diff --git a/testsuite/tests/stranal/sigs/CaseBinderCPR.stderr b/testsuite/tests/stranal/sigs/CaseBinderCPR.stderr index f708813a81..cf95b806ec 100644 --- a/testsuite/tests/stranal/sigs/CaseBinderCPR.stderr +++ b/testsuite/tests/stranal/sigs/CaseBinderCPR.stderr @@ -1,12 +1,18 @@ ==================== Strictness signatures ==================== -CaseBinderCPR.$trModule: m -CaseBinderCPR.f_list_cmp: <L,C(C1(U(U)))><S,1*U><S,1*U>m +CaseBinderCPR.$trModule: +CaseBinderCPR.f_list_cmp: <L,C(C1(U(U)))><S,1*U><S,1*U> + + + +==================== Cpr signatures ==================== +CaseBinderCPR.$trModule: m1 +CaseBinderCPR.f_list_cmp: m1 ==================== Strictness signatures ==================== -CaseBinderCPR.$trModule: m -CaseBinderCPR.f_list_cmp: <L,C(C1(U(1*U)))><S,1*U><S,1*U>m +CaseBinderCPR.$trModule: +CaseBinderCPR.f_list_cmp: <L,C(C1(U(1*U)))><S,1*U><S,1*U> diff --git a/testsuite/tests/stranal/sigs/DmdAnalGADTs.stderr b/testsuite/tests/stranal/sigs/DmdAnalGADTs.stderr index fb898f7e22..96b6bf669f 100644 --- a/testsuite/tests/stranal/sigs/DmdAnalGADTs.stderr +++ b/testsuite/tests/stranal/sigs/DmdAnalGADTs.stderr @@ -1,28 +1,42 @@ ==================== Strictness signatures ==================== -DmdAnalGADTs.$tc'A: m -DmdAnalGADTs.$tc'B: m -DmdAnalGADTs.$tcD: m -DmdAnalGADTs.$trModule: m +DmdAnalGADTs.$tc'A: +DmdAnalGADTs.$tc'B: +DmdAnalGADTs.$tcD: +DmdAnalGADTs.$trModule: DmdAnalGADTs.diverges: b DmdAnalGADTs.f: <S,1*U> -DmdAnalGADTs.f': <S,1*U>m +DmdAnalGADTs.f': <S,1*U> DmdAnalGADTs.g: <S,1*U> -DmdAnalGADTs.hasCPR: m -DmdAnalGADTs.hasStrSig: <S,1*U(U)>m +DmdAnalGADTs.hasCPR: +DmdAnalGADTs.hasStrSig: <S,1*U(U)> + + + +==================== Cpr signatures ==================== +DmdAnalGADTs.$tc'A: m1 +DmdAnalGADTs.$tc'B: m1 +DmdAnalGADTs.$tcD: m1 +DmdAnalGADTs.$trModule: m1 +DmdAnalGADTs.diverges: b +DmdAnalGADTs.f: +DmdAnalGADTs.f': m1 +DmdAnalGADTs.g: +DmdAnalGADTs.hasCPR: m1 +DmdAnalGADTs.hasStrSig: m1 ==================== Strictness signatures ==================== -DmdAnalGADTs.$tc'A: m -DmdAnalGADTs.$tc'B: m -DmdAnalGADTs.$tcD: m -DmdAnalGADTs.$trModule: m +DmdAnalGADTs.$tc'A: +DmdAnalGADTs.$tc'B: +DmdAnalGADTs.$tcD: +DmdAnalGADTs.$trModule: DmdAnalGADTs.diverges: b DmdAnalGADTs.f: <S,1*U> -DmdAnalGADTs.f': <S,1*U>m +DmdAnalGADTs.f': <S,1*U> DmdAnalGADTs.g: <S,1*U> -DmdAnalGADTs.hasCPR: m -DmdAnalGADTs.hasStrSig: <S,1*U(U)>m +DmdAnalGADTs.hasCPR: +DmdAnalGADTs.hasStrSig: <S,1*U(U)> diff --git a/testsuite/tests/stranal/sigs/HyperStrUse.stderr b/testsuite/tests/stranal/sigs/HyperStrUse.stderr index 84d81f3a8b..812115ec11 100644 --- a/testsuite/tests/stranal/sigs/HyperStrUse.stderr +++ b/testsuite/tests/stranal/sigs/HyperStrUse.stderr @@ -1,12 +1,18 @@ ==================== Strictness signatures ==================== -HyperStrUse.$trModule: m -HyperStrUse.f: <S(SL),1*U(1*U(U),A)><S,1*U>m +HyperStrUse.$trModule: +HyperStrUse.f: <S(SL),1*U(1*U(U),A)><S,1*U> + + + +==================== Cpr signatures ==================== +HyperStrUse.$trModule: m1 +HyperStrUse.f: m1 ==================== Strictness signatures ==================== -HyperStrUse.$trModule: m -HyperStrUse.f: <S(SL),1*U(1*U(U),A)><S,1*U>m +HyperStrUse.$trModule: +HyperStrUse.f: <S(SL),1*U(1*U(U),A)><S,1*U> diff --git a/testsuite/tests/stranal/sigs/NewtypeArity.stderr b/testsuite/tests/stranal/sigs/NewtypeArity.stderr index 08ce83f9bd..5519561d43 100644 --- a/testsuite/tests/stranal/sigs/NewtypeArity.stderr +++ b/testsuite/tests/stranal/sigs/NewtypeArity.stderr @@ -1,18 +1,27 @@ ==================== Strictness signatures ==================== -Test.$tc'MkT: m -Test.$tcT: m -Test.$trModule: m -Test.t: <S,1*U(U)><S,1*U(U)>m -Test.t2: <S,1*U(U)><S,1*U(U)>m +Test.$tc'MkT: +Test.$tcT: +Test.$trModule: +Test.t: <S,1*U(U)><S,1*U(U)> +Test.t2: <S,1*U(U)><S,1*U(U)> + + + +==================== Cpr signatures ==================== +Test.$tc'MkT: m1 +Test.$tcT: m1 +Test.$trModule: m1 +Test.t: m1 +Test.t2: m1 ==================== Strictness signatures ==================== -Test.$tc'MkT: m -Test.$tcT: m -Test.$trModule: m -Test.t: <S,1*U(U)><S,1*U(U)>m -Test.t2: <S,1*U(U)><S,1*U(U)>m +Test.$tc'MkT: +Test.$tcT: +Test.$trModule: +Test.t: <S,1*U(U)><S,1*U(U)> +Test.t2: <S,1*U(U)><S,1*U(U)> diff --git a/testsuite/tests/stranal/sigs/StrAnalExample.stderr b/testsuite/tests/stranal/sigs/StrAnalExample.stderr index 4cc6f01905..f18fb56998 100644 --- a/testsuite/tests/stranal/sigs/StrAnalExample.stderr +++ b/testsuite/tests/stranal/sigs/StrAnalExample.stderr @@ -1,12 +1,18 @@ ==================== Strictness signatures ==================== -StrAnalExample.$trModule: m +StrAnalExample.$trModule: StrAnalExample.foo: <S,1*U> +==================== Cpr signatures ==================== +StrAnalExample.$trModule: m1 +StrAnalExample.foo: + + + ==================== Strictness signatures ==================== -StrAnalExample.$trModule: m +StrAnalExample.$trModule: StrAnalExample.foo: <S,1*U> diff --git a/testsuite/tests/stranal/sigs/T12370.stderr b/testsuite/tests/stranal/sigs/T12370.stderr index d1acdf0b50..63fa76d79d 100644 --- a/testsuite/tests/stranal/sigs/T12370.stderr +++ b/testsuite/tests/stranal/sigs/T12370.stderr @@ -1,14 +1,21 @@ ==================== Strictness signatures ==================== -T12370.$trModule: m -T12370.bar: <S,1*U(U)><S,1*U(U)>m -T12370.foo: <S(SS),1*U(1*U(U),1*U(U))>m +T12370.$trModule: +T12370.bar: <S,1*U(U)><S,1*U(U)> +T12370.foo: <S(SS),1*U(1*U(U),1*U(U))> + + + +==================== Cpr signatures ==================== +T12370.$trModule: m1 +T12370.bar: m1 +T12370.foo: m1 ==================== Strictness signatures ==================== -T12370.$trModule: m -T12370.bar: <S,1*U(U)><S,1*U(U)>m -T12370.foo: <S(SS),1*U(1*U(U),1*U(U))>m +T12370.$trModule: +T12370.bar: <S,1*U(U)><S,1*U(U)> +T12370.foo: <S(SS),1*U(1*U(U),1*U(U))> diff --git a/testsuite/tests/stranal/sigs/T5075.hs b/testsuite/tests/stranal/sigs/T5075.hs new file mode 100644 index 0000000000..c35409aa67 --- /dev/null +++ b/testsuite/tests/stranal/sigs/T5075.hs @@ -0,0 +1,11 @@ +-- | This module currently asserts that we trim CPR for local bindings +-- returning a sum. We can hopefully give @loop@ a CPR signature some day, but +-- we first have to fix #5075/#16570. +module T5075 where + +-- Omission of the type signature is deliberate, otherwise we won't get a join +-- point (this is up to the desugarer, not sure why). +-- loop :: (Ord a, Num a) => a -> Either a b +loop x = case x < 10 of + True -> Left x + False -> loop (x*2) diff --git a/testsuite/tests/stranal/sigs/T5075.stderr b/testsuite/tests/stranal/sigs/T5075.stderr new file mode 100644 index 0000000000..582f62d705 --- /dev/null +++ b/testsuite/tests/stranal/sigs/T5075.stderr @@ -0,0 +1,18 @@ + +==================== Strictness signatures ==================== +T5075.$trModule: +T5075.loop: <S(LLC(C(S))LLLLL),U(A,A,C(C1(U)),A,A,A,A,A)><L,U(A,A,C(C1(U)),A,A,A,C(U))><L,U> + + + +==================== Cpr signatures ==================== +T5075.$trModule: m1 +T5075.loop: + + + +==================== Strictness signatures ==================== +T5075.$trModule: +T5075.loop: <S(LLC(C(S))LLLLL),1*U(A,A,C(C1(U)),A,A,A,A,A)><L,U(A,A,C(C1(U)),A,A,A,C(U))><L,U> + + diff --git a/testsuite/tests/stranal/sigs/T8569.stderr b/testsuite/tests/stranal/sigs/T8569.stderr index 10d962ec45..122f748775 100644 --- a/testsuite/tests/stranal/sigs/T8569.stderr +++ b/testsuite/tests/stranal/sigs/T8569.stderr @@ -1,18 +1,27 @@ ==================== Strictness signatures ==================== -T8569.$tc'Rdata: m -T8569.$tc'Rint: m -T8569.$tcRep: m -T8569.$trModule: m +T8569.$tc'Rdata: +T8569.$tc'Rint: +T8569.$tcRep: +T8569.$trModule: T8569.addUp: <S,1*U><L,U> +==================== Cpr signatures ==================== +T8569.$tc'Rdata: m1 +T8569.$tc'Rint: m1 +T8569.$tcRep: m1 +T8569.$trModule: m1 +T8569.addUp: + + + ==================== Strictness signatures ==================== -T8569.$tc'Rdata: m -T8569.$tc'Rint: m -T8569.$tcRep: m -T8569.$trModule: m +T8569.$tc'Rdata: +T8569.$tc'Rint: +T8569.$tcRep: +T8569.$trModule: T8569.addUp: <S,1*U><L,U> diff --git a/testsuite/tests/stranal/sigs/T8598.stderr b/testsuite/tests/stranal/sigs/T8598.stderr index 9bf10d94f4..d6793609d3 100644 --- a/testsuite/tests/stranal/sigs/T8598.stderr +++ b/testsuite/tests/stranal/sigs/T8598.stderr @@ -1,12 +1,18 @@ ==================== Strictness signatures ==================== -T8598.$trModule: m -T8598.fun: <S,1*U(U)>m +T8598.$trModule: +T8598.fun: <S,1*U(U)> + + + +==================== Cpr signatures ==================== +T8598.$trModule: m1 +T8598.fun: m1 ==================== Strictness signatures ==================== -T8598.$trModule: m -T8598.fun: <S,1*U(U)>m +T8598.$trModule: +T8598.fun: <S,1*U(U)> diff --git a/testsuite/tests/stranal/sigs/UnsatFun.stderr b/testsuite/tests/stranal/sigs/UnsatFun.stderr index 9fb8ab321f..1f5a58b422 100644 --- a/testsuite/tests/stranal/sigs/UnsatFun.stderr +++ b/testsuite/tests/stranal/sigs/UnsatFun.stderr @@ -1,24 +1,36 @@ ==================== Strictness signatures ==================== -UnsatFun.$trModule: m +UnsatFun.$trModule: UnsatFun.f: <B,1*U(U)><B,A>b UnsatFun.g: <B,1*U(U)>b UnsatFun.g': <L,1*U(U)> -UnsatFun.g3: <L,U(U)>m +UnsatFun.g3: <L,U(U)> UnsatFun.h: <C(S),1*C1(U(U))> UnsatFun.h2: <S,1*U><L,1*C1(U(U))> -UnsatFun.h3: <C(S),1*C1(U)>m +UnsatFun.h3: <C(S),1*C1(U)> + + + +==================== Cpr signatures ==================== +UnsatFun.$trModule: m1 +UnsatFun.f: b +UnsatFun.g: +UnsatFun.g': +UnsatFun.g3: m1 +UnsatFun.h: +UnsatFun.h2: +UnsatFun.h3: m1 ==================== Strictness signatures ==================== -UnsatFun.$trModule: m +UnsatFun.$trModule: UnsatFun.f: <B,1*U(U)><B,A>b UnsatFun.g: <B,1*U(U)>b UnsatFun.g': <L,1*U(U)> -UnsatFun.g3: <L,U(U)>m +UnsatFun.g3: <L,U(U)> UnsatFun.h: <C(S),1*C1(U(U))> UnsatFun.h2: <S,1*U><L,1*C1(U(U))> -UnsatFun.h3: <C(S),1*C1(U)>m +UnsatFun.h3: <C(S),1*C1(U)> diff --git a/testsuite/tests/stranal/sigs/all.T b/testsuite/tests/stranal/sigs/all.T index fca319f1a3..f7cbd3761d 100644 --- a/testsuite/tests/stranal/sigs/all.T +++ b/testsuite/tests/stranal/sigs/all.T @@ -1,7 +1,7 @@ # This directory contains tests where we annotate functions with expected # type signatures, and verify that these actually those found by the compiler -setTestOpts(extra_hc_opts('-ddump-str-signatures')) +setTestOpts(extra_hc_opts('-ddump-str-signatures -ddump-cpr-signatures')) # We are testing the result of an optimization, so no use # running them in various runtimes @@ -18,3 +18,4 @@ test('DmdAnalGADTs', normal, compile, ['']) test('T12370', normal, compile, ['']) test('CaseBinderCPR', normal, compile, ['']) test('NewtypeArity', normal, compile, ['']) +test('T5075', normal, compile, ['']) |