From 3630b9baa3887a5bf5cb3ba12e48301fe6cce173 Mon Sep 17 00:00:00 2001 From: Sebastian Graf Date: Mon, 22 Feb 2021 18:37:41 +0100 Subject: DmdAnal: Better syntax for demand signatures (#19016) The update of the Outputable instance resulted in a slew of documentation changes within Notes that used the old syntax. The most important doc changes are to `Note [Demand notation]` and the user's guide. Fixes #19016. --- .../tests/arityanal/should_compile/Arity01.stderr | 16 ++++----- .../tests/arityanal/should_compile/Arity02.stderr | 12 +++---- .../tests/arityanal/should_compile/Arity03.stderr | 6 ++-- .../tests/arityanal/should_compile/Arity04.stderr | 6 ++-- .../tests/arityanal/should_compile/Arity05.stderr | 16 ++++----- .../tests/arityanal/should_compile/Arity09.stderr | 8 ++--- .../tests/arityanal/should_compile/Arity11.stderr | 38 +++++++++++----------- .../tests/arityanal/should_compile/Arity14.stderr | 20 ++++++------ .../tests/arityanal/should_compile/Arity16.stderr | 12 +++---- .../tests/arityanal/should_compile/T18793.stderr | 10 +++--- 10 files changed, 72 insertions(+), 72 deletions(-) (limited to 'testsuite/tests/arityanal/should_compile') diff --git a/testsuite/tests/arityanal/should_compile/Arity01.stderr b/testsuite/tests/arityanal/should_compile/Arity01.stderr index bdee9d75db..5d88afdce2 100644 --- a/testsuite/tests/arityanal/should_compile/Arity01.stderr +++ b/testsuite/tests/arityanal/should_compile/Arity01.stderr @@ -1,6 +1,6 @@ ==================== Tidy Core ==================== -Result size of Tidy Core = {terms: 61, types: 45, coercions: 0, joins: 0/0} +Result size of Tidy Core = {terms: 61, types: 41, coercions: 0, joins: 0/0} -- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0} F1.f2 :: Integer @@ -10,12 +10,12 @@ F1.f2 = 1 Rec { -- RHS size: {terms: 18, types: 4, coercions: 0, joins: 0/0} F1.f1_h1 [Occ=LoopBreaker] :: Integer -> Integer -> Integer -> Integer -[GblId, Arity=3, Str=, Unf=OtherCon []] +[GblId, Arity=3, Str=, Unf=OtherCon []] F1.f1_h1 = \ (n :: Integer) (x :: Integer) (eta :: Integer) -> - case GHC.Num.Integer.integerCompare x n of { + case GHC.Num.Integer.integerLt# x n of { __DEFAULT -> eta; - LT -> F1.f1_h1 n (GHC.Num.Integer.integerAdd x F1.f2) (GHC.Num.Integer.integerAdd x eta) + 1# -> F1.f1_h1 n (GHC.Num.Integer.integerAdd x F1.f2) (GHC.Num.Integer.integerAdd x eta) } end Rec } @@ -33,7 +33,7 @@ f1 = F1.f1_h1 F1.f3 F1.f2 F1.f3 g :: Integer -> Integer -> Integer -> Integer -> Integer -> Integer [GblId, Arity=5, - Str=, + Str=<1L>, Unf=Unf{Src=InlineStable, TopLvl=True, Value=True, ConLike=True, WorkFree=True, Expandable=True, Guidance=ALWAYS_IF(arity=5,unsat_ok=True,boring_ok=False) Tmpl= \ (x1 [Occ=Once1] :: Integer) (x2 [Occ=Once1] :: Integer) (x3 [Occ=Once1] :: Integer) (x4 [Occ=Once1] :: Integer) (x5 [Occ=Once1] :: Integer) -> GHC.Num.Integer.integerAdd (GHC.Num.Integer.integerAdd (GHC.Num.Integer.integerAdd (GHC.Num.Integer.integerAdd x1 x2) x3) x4) x5}] g = \ (x1 :: Integer) (x2 :: Integer) (x3 :: Integer) (x4 :: Integer) (x5 :: Integer) -> GHC.Num.Integer.integerAdd (GHC.Num.Integer.integerAdd (GHC.Num.Integer.integerAdd (GHC.Num.Integer.integerAdd x1 x2) x3) x4) x5 @@ -43,11 +43,11 @@ F1.s1 :: Integer [GblId, Unf=Unf{Src=, TopLvl=True, Value=True, ConLike=True, WorkFree=True, Expandable=True, Guidance=IF_ARGS [] 100 0}] F1.s1 = 3 --- RHS size: {terms: 8, types: 9, coercions: 0, joins: 0/0} +-- RHS size: {terms: 8, types: 7, coercions: 0, joins: 0/0} s :: forall {t1} {t2}. Num t1 => (t1 -> t2) -> t2 [GblId, Arity=2, - Str=<1P(A,A,A,A,A,A,1C1(U))>, + Str=<1C1(L)>, 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= \ (@t) (@t1) ($dNum [Occ=Once1] :: Num t) (f [Occ=Once1!] :: t -> t1) -> f (fromInteger @t $dNum F1.s1)}] s = \ (@t) (@t1) ($dNum :: Num t) (f :: t -> t1) -> f (fromInteger @t $dNum F1.s1) @@ -61,7 +61,7 @@ F1.h1 = 24 h :: Integer -> Integer [GblId, Arity=1, - Str=, + Str=, 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) Tmpl= \ (x5 [Occ=Once1] :: Integer) -> GHC.Num.Integer.integerAdd F1.h1 x5}] h = \ (x5 :: Integer) -> GHC.Num.Integer.integerAdd F1.h1 x5 diff --git a/testsuite/tests/arityanal/should_compile/Arity02.stderr b/testsuite/tests/arityanal/should_compile/Arity02.stderr index 47754d5944..a9fd55094e 100644 --- a/testsuite/tests/arityanal/should_compile/Arity02.stderr +++ b/testsuite/tests/arityanal/should_compile/Arity02.stderr @@ -1,17 +1,17 @@ ==================== Tidy Core ==================== -Result size of Tidy Core = {terms: 35, types: 27, coercions: 0, joins: 0/0} +Result size of Tidy Core = {terms: 35, types: 23, coercions: 0, joins: 0/0} -- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0} F2.f1 :: Integer [GblId, Unf=Unf{Src=, TopLvl=True, Value=True, ConLike=True, WorkFree=True, Expandable=True, Guidance=IF_ARGS [] 100 0}] F2.f1 = 0 --- RHS size: {terms: 7, types: 8, coercions: 0, joins: 0/0} +-- RHS size: {terms: 7, types: 6, coercions: 0, joins: 0/0} f2f :: forall {t1} {t2}. (t1 -> Integer -> t2) -> t1 -> t2 [GblId, Arity=2, - Str=, + Str=<1C1(C1(L))>, Unf=Unf{Src=InlineStable, TopLvl=True, Value=True, ConLike=True, WorkFree=True, Expandable=True, Guidance=ALWAYS_IF(arity=2,unsat_ok=True,boring_ok=True) Tmpl= \ (@t) (@t1) (h [Occ=Once1!] :: t -> Integer -> t1) (x [Occ=Once1] :: t) -> h x F2.f1}] f2f = \ (@t) (@t1) (h :: t -> Integer -> t1) (x :: t) -> h x F2.f1 @@ -24,12 +24,12 @@ lvl = 1 Rec { -- RHS size: {terms: 16, types: 3, coercions: 0, joins: 0/0} F2.f2_g [Occ=LoopBreaker] :: Integer -> Integer -> Integer -[GblId, Arity=2, Str=, Unf=OtherCon []] +[GblId, Arity=2, Str=, Unf=OtherCon []] F2.f2_g = \ (x :: Integer) (y :: Integer) -> - case GHC.Num.Integer.integerCompare x F2.f1 of { + case GHC.Num.Integer.integerGt# x F2.f1 of { __DEFAULT -> y; - GT -> F2.f2_g (GHC.Num.Integer.integerSub x lvl) (GHC.Num.Integer.integerAdd x y) + 1# -> F2.f2_g (GHC.Num.Integer.integerSub x lvl) (GHC.Num.Integer.integerAdd x y) } end Rec } diff --git a/testsuite/tests/arityanal/should_compile/Arity03.stderr b/testsuite/tests/arityanal/should_compile/Arity03.stderr index fde8e3fa44..e5e3e754dd 100644 --- a/testsuite/tests/arityanal/should_compile/Arity03.stderr +++ b/testsuite/tests/arityanal/should_compile/Arity03.stderr @@ -5,7 +5,7 @@ Result size of Tidy Core = {terms: 29, types: 13, coercions: 0, joins: 0/0} Rec { -- RHS size: {terms: 15, types: 3, coercions: 0, joins: 0/0} F3.$wfac [InlPrag=[2], Occ=LoopBreaker] :: GHC.Prim.Int# -> GHC.Prim.Int# -[GblId, Arity=1, Str=, Unf=OtherCon []] +[GblId, Arity=1, Str=<1L>, Unf=OtherCon []] F3.$wfac = \ (ww :: GHC.Prim.Int#) -> case ww of wild { @@ -18,7 +18,7 @@ end Rec } fac [InlPrag=[2]] :: Int -> Int [GblId, Arity=1, - Str=, + Str=<1P(1L)>, 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) Tmpl= \ (w [Occ=Once1!] :: Int) -> case w of { GHC.Types.I# ww1 [Occ=Once1] -> case F3.$wfac ww1 of ww2 [Occ=Once1] { __DEFAULT -> GHC.Types.I# ww2 } }}] @@ -28,7 +28,7 @@ fac = \ (w :: Int) -> case w of { GHC.Types.I# ww1 -> case F3.$wfac ww1 of ww2 { f3 :: Int -> Int [GblId, Arity=1, - Str=, + Str=<1P(1L)>, 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=True) Tmpl= fac}] diff --git a/testsuite/tests/arityanal/should_compile/Arity04.stderr b/testsuite/tests/arityanal/should_compile/Arity04.stderr index dd67adb572..d2f6457a03 100644 --- a/testsuite/tests/arityanal/should_compile/Arity04.stderr +++ b/testsuite/tests/arityanal/should_compile/Arity04.stderr @@ -6,7 +6,7 @@ Result size of Tidy Core = {terms: 39, types: 24, coercions: 0, joins: 0/0} f4g :: Int -> Int [GblId, Arity=1, - Str=, + Str=<1P(L)>, 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) Tmpl= \ (y [Occ=Once1!] :: Int) -> case y of { GHC.Types.I# x [Occ=Once1] -> GHC.Types.I# (GHC.Prim.+# x 1#) }}] @@ -20,7 +20,7 @@ lvl = GHC.Types.I# 0# Rec { -- RHS size: {terms: 13, types: 4, coercions: 0, joins: 0/0} F4.$wf4h [InlPrag=[2], Occ=LoopBreaker] :: (Int -> Int) -> GHC.Prim.Int# -> Int -[GblId, Arity=2, Str=, Unf=OtherCon []] +[GblId, Arity=2, Str=<1C1(L)><1L>, Unf=OtherCon []] F4.$wf4h = \ (w :: Int -> Int) (ww :: GHC.Prim.Int#) -> case ww of wild { @@ -33,7 +33,7 @@ end Rec } f4h [InlPrag=[2]] :: (Int -> Int) -> Int -> Int [GblId, Arity=2, - Str=, + Str=<1C1(L)><1P(1L)>, 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 [Occ=Once1] :: Int -> Int) (w1 [Occ=Once1!] :: Int) -> case w1 of { GHC.Types.I# ww1 [Occ=Once1] -> F4.$wf4h w ww1 }}] f4h = \ (w :: Int -> Int) (w1 :: Int) -> case w1 of { GHC.Types.I# ww1 -> F4.$wf4h w ww1 } diff --git a/testsuite/tests/arityanal/should_compile/Arity05.stderr b/testsuite/tests/arityanal/should_compile/Arity05.stderr index 4a4ac74a9f..cac001de31 100644 --- a/testsuite/tests/arityanal/should_compile/Arity05.stderr +++ b/testsuite/tests/arityanal/should_compile/Arity05.stderr @@ -1,31 +1,31 @@ ==================== Tidy Core ==================== -Result size of Tidy Core = {terms: 54, types: 99, coercions: 0, joins: 0/0} +Result size of Tidy Core = {terms: 54, types: 87, coercions: 0, joins: 0/0} -- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0} F5.f5g1 :: Integer [GblId, Unf=Unf{Src=, TopLvl=True, Value=True, ConLike=True, WorkFree=True, Expandable=True, Guidance=IF_ARGS [] 100 0}] F5.f5g1 = 1 --- RHS size: {terms: 12, types: 11, coercions: 0, joins: 0/0} +-- RHS size: {terms: 12, types: 9, coercions: 0, joins: 0/0} f5g :: forall {a} {t}. Num a => (t -> a) -> t -> a [GblId, Arity=3, - Str=<1C1(U)>, + Str=, 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) Tmpl= \ (@a) (@t) ($dNum :: Num a) (h [Occ=Once1!] :: t -> a) (z [Occ=Once1] :: t) -> + @a $dNum (h z) (fromInteger @a $dNum F5.f5g1)}] f5g = \ (@a) (@t) ($dNum :: Num a) (h :: t -> a) (z :: t) -> + @a $dNum (h z) (fromInteger @a $dNum F5.f5g1) --- RHS size: {terms: 15, types: 14, coercions: 0, joins: 0/0} +-- RHS size: {terms: 15, types: 12, coercions: 0, joins: 0/0} F5.$wf5h [InlPrag=[2]] :: forall {a} {t}. (a -> a -> a) -> (Integer -> a) -> (t -> a) -> t -> (t -> a) -> a -[GblId, Arity=5, Str=<1C1(U)><1C1(U)><1C1(U)>, Unf=Unf{Src=, TopLvl=True, Value=True, ConLike=True, WorkFree=True, Expandable=True, Guidance=IF_ARGS [60 60 60 0 60] 120 0}] +[GblId, Arity=5, Str=, Unf=Unf{Src=, TopLvl=True, Value=True, ConLike=True, WorkFree=True, Expandable=True, Guidance=IF_ARGS [60 60 60 0 60] 120 0}] F5.$wf5h = \ (@a) (@t) (ww :: a -> a -> a) (ww1 :: Integer -> a) (w :: t -> a) (w1 :: t) (w2 :: t -> a) -> ww (w w1) (ww (w2 w1) (ww1 F5.f5g1)) --- RHS size: {terms: 15, types: 32, coercions: 0, joins: 0/0} +-- RHS size: {terms: 15, types: 30, coercions: 0, joins: 0/0} f5h [InlPrag=[2]] :: forall {a} {t}. Num a => (t -> a) -> t -> (t -> a) -> a [GblId, Arity=4, - Str=<1C1(U)><1C1(U)>, + Str=<1P(SCS(C1(L)),A,A,A,A,A,MCM(L))>, Unf=Unf{Src=InlineStable, TopLvl=True, Value=True, ConLike=True, WorkFree=True, Expandable=True, Guidance=ALWAYS_IF(arity=4,unsat_ok=True,boring_ok=False) Tmpl= \ (@a) (@t) (w [Occ=Once1!] :: Num a) (w1 [Occ=Once1] :: t -> a) (w2 [Occ=Once1] :: t) (w3 [Occ=Once1] :: t -> a) -> case w of { GHC.Num.C:Num ww1 [Occ=Once1] _ [Occ=Dead] _ [Occ=Dead] _ [Occ=Dead] _ [Occ=Dead] _ [Occ=Dead] ww7 [Occ=Once1] -> F5.$wf5h @a @t ww1 ww7 w1 w2 w3 }}] f5h = \ (@a) (@t) (w :: Num a) (w1 :: t -> a) (w2 :: t) (w3 :: t -> a) -> case w of { GHC.Num.C:Num ww1 ww2 ww3 ww4 ww5 ww6 ww7 -> F5.$wf5h @a @t ww1 ww7 w1 w2 w3 } @@ -34,7 +34,7 @@ f5h = \ (@a) (@t) (w :: Num a) (w1 :: t -> a) (w2 :: t) (w3 :: t -> a) -> case w f5y :: Integer -> Integer [GblId, Arity=1, - Str=, + Str=<1L>, 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) Tmpl= \ (y [Occ=Once1] :: Integer) -> GHC.Num.Integer.integerAdd y F5.f5g1}] f5y = \ (y :: Integer) -> GHC.Num.Integer.integerAdd y F5.f5g1 diff --git a/testsuite/tests/arityanal/should_compile/Arity09.stderr b/testsuite/tests/arityanal/should_compile/Arity09.stderr index 8075f7b17e..7d24fdeb86 100644 --- a/testsuite/tests/arityanal/should_compile/Arity09.stderr +++ b/testsuite/tests/arityanal/should_compile/Arity09.stderr @@ -20,12 +20,12 @@ F9.f1 = 10 Rec { -- RHS size: {terms: 15, types: 2, coercions: 0, joins: 0/0} F9.f91_f [Occ=LoopBreaker] :: Integer -> Integer -[GblId, Arity=1, Str=, Unf=OtherCon []] +[GblId, Arity=1, Str=, Unf=OtherCon []] F9.f91_f = \ (n :: Integer) -> - case GHC.Num.Integer.integerCompare n lvl of { - __DEFAULT -> F9.f91_f (F9.f91_f (GHC.Num.Integer.integerAdd n lvl1)); - GT -> GHC.Num.Integer.integerSub n F9.f1 + case GHC.Num.Integer.integerLe# n lvl of { + __DEFAULT -> GHC.Num.Integer.integerSub n F9.f1; + 1# -> F9.f91_f (F9.f91_f (GHC.Num.Integer.integerAdd n lvl1)) } end Rec } diff --git a/testsuite/tests/arityanal/should_compile/Arity11.stderr b/testsuite/tests/arityanal/should_compile/Arity11.stderr index 154baf01fb..92c7649dd2 100644 --- a/testsuite/tests/arityanal/should_compile/Arity11.stderr +++ b/testsuite/tests/arityanal/should_compile/Arity11.stderr @@ -1,6 +1,6 @@ ==================== Tidy Core ==================== -Result size of Tidy Core = {terms: 129, types: 104, coercions: 0, joins: 0/5} +Result size of Tidy Core = {terms: 129, types: 94, coercions: 0, joins: 0/5} -- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0} F11.fib1 :: Integer @@ -20,7 +20,7 @@ F11.fib2 = 2 Rec { -- RHS size: {terms: 24, types: 3, coercions: 0, joins: 0/0} F11.f11_fib [Occ=LoopBreaker] :: Integer -> Integer -[GblId, Arity=1, Str=, Unf=OtherCon []] +[GblId, Arity=1, Str=, Unf=OtherCon []] F11.f11_fib = \ (ds :: Integer) -> case GHC.Num.Integer.integerEq# ds F11.fib1 of { @@ -33,11 +33,11 @@ F11.f11_fib } end Rec } --- RHS size: {terms: 52, types: 28, coercions: 0, joins: 0/5} -F11.$wfib [InlPrag=[2]] :: forall {a} {p}. (a -> a -> Bool) -> (Num a, Num p) => a -> p -[GblId, Arity=4, Str=, Unf=Unf{Src=, TopLvl=True, Value=True, ConLike=True, WorkFree=True, Expandable=True, Guidance=IF_ARGS [60 150 60 0] 460 0}] +-- RHS size: {terms: 52, types: 26, coercions: 0, joins: 0/5} +F11.$wfib [InlPrag=[2]] :: forall {a1} {a2}. (a1 -> a1 -> Bool) -> (Num a1, Num a2) => a1 -> a2 +[GblId, Arity=4, Str=, Unf=Unf{Src=, TopLvl=True, Value=True, ConLike=True, WorkFree=True, Expandable=True, Guidance=IF_ARGS [60 150 60 0] 460 0}] F11.$wfib - = \ (@a) (@p) (ww :: a -> a -> Bool) (w :: Num a) (w1 :: Num p) (w2 :: a) -> + = \ (@a) (@a1) (ww :: a -> a -> Bool) (w :: Num a) (w1 :: Num a1) (w2 :: a) -> let { lvl :: a [LclId] @@ -47,36 +47,36 @@ F11.$wfib [LclId] lvl1 = fromInteger @a w F11.fib2 } in let { - lvl2 :: p + lvl2 :: a1 [LclId] - lvl2 = fromInteger @p w1 F11.fib3 } in + lvl2 = fromInteger @a1 w1 F11.fib3 } in let { lvl3 :: a [LclId] lvl3 = fromInteger @a w F11.fib1 } in letrec { - fib4 [Occ=LoopBreaker] :: a -> p - [LclId, Arity=1, Str=, Unf=OtherCon []] + fib4 [Occ=LoopBreaker, Dmd=SCS(L)] :: a -> a1 + [LclId, Arity=1, Str=, Unf=OtherCon []] fib4 = \ (ds :: a) -> case ww ds lvl3 of { False -> case ww ds lvl of { - False -> + @p w1 (fib4 (- @a w ds lvl)) (fib4 (- @a w ds lvl1)); + False -> + @a1 w1 (fib4 (- @a w ds lvl)) (fib4 (- @a w ds lvl1)); True -> lvl2 }; True -> lvl2 }; } in fib4 w2 --- RHS size: {terms: 14, types: 21, coercions: 0, joins: 0/0} -fib [InlPrag=[2]] :: forall {a} {p}. (Eq a, Num a, Num p) => a -> p +-- RHS size: {terms: 14, types: 19, coercions: 0, joins: 0/0} +fib [InlPrag=[2]] :: forall {a1} {a2}. (Eq a1, Num a1, Num a2) => a1 -> a2 [GblId, Arity=4, - Str=, + Str=<1P(SCS(C1(L)),A)>, Unf=Unf{Src=InlineStable, TopLvl=True, Value=True, ConLike=True, WorkFree=True, Expandable=True, Guidance=ALWAYS_IF(arity=4,unsat_ok=True,boring_ok=False) - Tmpl= \ (@a) (@p) (w [Occ=Once1!] :: Eq a) (w1 [Occ=Once1] :: Num a) (w2 [Occ=Once1] :: Num p) (w3 [Occ=Once1] :: a) -> case w of { GHC.Classes.C:Eq ww1 [Occ=Once1] _ [Occ=Dead] -> F11.$wfib @a @p ww1 w1 w2 w3 }}] -fib = \ (@a) (@p) (w :: Eq a) (w1 :: Num a) (w2 :: Num p) (w3 :: a) -> case w of { GHC.Classes.C:Eq ww1 ww2 -> F11.$wfib @a @p ww1 w1 w2 w3 } + Tmpl= \ (@a) (@a1) (w [Occ=Once1!] :: Eq a) (w1 [Occ=Once1] :: Num a) (w2 [Occ=Once1] :: Num a1) (w3 [Occ=Once1] :: a) -> case w of { GHC.Classes.C:Eq ww1 [Occ=Once1] _ [Occ=Dead] -> F11.$wfib @a @a1 ww1 w1 w2 w3 }}] +fib = \ (@a) (@a1) (w :: Eq a) (w1 :: Num a) (w2 :: Num a1) (w3 :: a) -> case w of { GHC.Classes.C:Eq ww1 ww2 -> F11.$wfib @a @a1 ww1 w1 w2 w3 } -- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0} F11.f3 :: Integer @@ -92,16 +92,16 @@ F11.f11_x = F11.f11_fib F11.f3 F11.f11f1 :: Integer -> Integer [GblId, Arity=1, - Str=, + Str=, 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) Tmpl= \ (y [Occ=Once1] :: Integer) -> GHC.Num.Integer.integerAdd F11.f11_x y}] F11.f11f1 = \ (y :: Integer) -> GHC.Num.Integer.integerAdd F11.f11_x y --- RHS size: {terms: 3, types: 3, coercions: 0, joins: 0/0} +-- RHS size: {terms: 3, types: 2, coercions: 0, joins: 0/0} f11f :: forall {p}. p -> Integer -> Integer [GblId, Arity=2, - Str=, + Str=, 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) Tmpl= \ (@p) _ [Occ=Dead] (eta [Occ=Once1] :: Integer) -> F11.f11f1 eta}] f11f = \ (@p) _ [Occ=Dead] -> F11.f11f1 diff --git a/testsuite/tests/arityanal/should_compile/Arity14.stderr b/testsuite/tests/arityanal/should_compile/Arity14.stderr index 1a5fdc38c3..d2a9716d04 100644 --- a/testsuite/tests/arityanal/should_compile/Arity14.stderr +++ b/testsuite/tests/arityanal/should_compile/Arity14.stderr @@ -1,12 +1,12 @@ ==================== Tidy Core ==================== -Result size of Tidy Core = {terms: 56, types: 87, coercions: 0, joins: 0/3} +Result size of Tidy Core = {terms: 56, types: 81, coercions: 0, joins: 0/3} --- RHS size: {terms: 3, types: 3, coercions: 0, joins: 0/0} +-- RHS size: {terms: 3, types: 2, coercions: 0, joins: 0/0} F14.f1 :: forall {t}. t -> t [GblId, Arity=1, - Str=, + Str=<1L>, 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) Tmpl= \ (@t) (y [Occ=Once1] :: t) -> y}] F14.f1 = \ (@t) (y :: t) -> y @@ -16,9 +16,9 @@ F14.f2 :: Integer [GblId, Unf=Unf{Src=, TopLvl=True, Value=True, ConLike=True, WorkFree=True, Expandable=True, Guidance=IF_ARGS [] 100 0}] F14.f2 = 1 --- RHS size: {terms: 35, types: 24, coercions: 0, joins: 0/3} +-- RHS size: {terms: 35, types: 23, coercions: 0, joins: 0/3} F14.$wf14 [InlPrag=[2]] :: forall {t}. (t -> t -> Bool) -> Num t => t -> t -> t -> t -[GblId, Arity=4, Str=, Unf=Unf{Src=, TopLvl=True, Value=True, ConLike=True, WorkFree=True, Expandable=True, Guidance=IF_ARGS [60 90 0 0] 300 0}] +[GblId, Arity=4, Str=, Unf=Unf{Src=, TopLvl=True, Value=True, ConLike=True, WorkFree=True, Expandable=True, Guidance=IF_ARGS [60 90 0 0] 300 0}] F14.$wf14 = \ (@t) (ww :: t -> t -> Bool) (w :: Num t) (w1 :: t) (w2 :: t) -> let { @@ -26,26 +26,26 @@ F14.$wf14 [LclId] lvl = fromInteger @t w F14.f2 } in letrec { - f3 [Occ=LoopBreaker] :: t -> t -> t -> t - [LclId, Arity=2, Str=, Unf=OtherCon []] + f3 [Occ=LoopBreaker, Dmd=SCS(C1(L))] :: t -> t -> t -> t + [LclId, Arity=2, Str=, Unf=OtherCon []] f3 = \ (n :: t) (x :: t) -> case ww x n of { False -> F14.f1 @t; True -> let { - v [Dmd=UCU(U)] :: t -> t + v :: t -> t [LclId] v = f3 n (+ @t w x lvl) } in \ (y :: t) -> v (+ @t w x y) }; } in f3 w1 w2 --- RHS size: {terms: 13, types: 34, coercions: 0, joins: 0/0} +-- RHS size: {terms: 13, types: 33, coercions: 0, joins: 0/0} f14 [InlPrag=[2]] :: forall {t}. (Ord t, Num t) => t -> t -> t -> t [GblId, Arity=4, - Str=, + Str=<1P(A,A,SCS(C1(L)),A,A,A,A,A)>, Unf=Unf{Src=InlineStable, TopLvl=True, Value=True, ConLike=True, WorkFree=True, Expandable=True, Guidance=ALWAYS_IF(arity=4,unsat_ok=True,boring_ok=False) Tmpl= \ (@t) (w [Occ=Once1!] :: Ord t) (w1 [Occ=Once1] :: Num t) (w2 [Occ=Once1] :: t) (w3 [Occ=Once1] :: t) -> case w of { GHC.Classes.C:Ord _ [Occ=Dead] _ [Occ=Dead] ww3 [Occ=Once1] _ [Occ=Dead] _ [Occ=Dead] _ [Occ=Dead] _ [Occ=Dead] _ [Occ=Dead] -> F14.$wf14 @t ww3 w1 w2 w3 }}] f14 = \ (@t) (w :: Ord t) (w1 :: Num t) (w2 :: t) (w3 :: t) -> case w of { GHC.Classes.C:Ord ww1 ww2 ww3 ww4 ww5 ww6 ww7 ww8 -> F14.$wf14 @t ww3 w1 w2 w3 } diff --git a/testsuite/tests/arityanal/should_compile/Arity16.stderr b/testsuite/tests/arityanal/should_compile/Arity16.stderr index 5d3c83f9df..8f750b6d04 100644 --- a/testsuite/tests/arityanal/should_compile/Arity16.stderr +++ b/testsuite/tests/arityanal/should_compile/Arity16.stderr @@ -1,11 +1,11 @@ ==================== Tidy Core ==================== -Result size of Tidy Core = {terms: 52, types: 87, coercions: 0, joins: 0/0} +Result size of Tidy Core = {terms: 52, types: 75, coercions: 0, joins: 0/0} Rec { --- RHS size: {terms: 15, types: 17, coercions: 0, joins: 0/0} +-- RHS size: {terms: 15, types: 15, coercions: 0, joins: 0/0} map2 [Occ=LoopBreaker] :: forall {t} {a}. (t -> a) -> [t] -> [a] -[GblId, Arity=2, Str=, Unf=OtherCon []] +[GblId, Arity=2, Str=<1L>, Unf=OtherCon []] map2 = \ (@t) (@a) (f :: t -> a) (ds :: [t]) -> case ds of { @@ -19,15 +19,15 @@ lvl :: GHC.Prim.Addr# [GblId, Unf=OtherCon []] lvl = "Arity16.hs:(6,1)-(7,47)|function zipWith2"# --- RHS size: {terms: 3, types: 5, coercions: 0, joins: 0/0} +-- RHS size: {terms: 3, types: 4, coercions: 0, joins: 0/0} lvl1 :: forall {a}. [a] [GblId, Str=b, Cpr=b] lvl1 = \ (@a) -> Control.Exception.Base.patError @'GHC.Types.LiftedRep @[a] lvl Rec { --- RHS size: {terms: 29, types: 35, coercions: 0, joins: 0/0} +-- RHS size: {terms: 29, types: 32, coercions: 0, joins: 0/0} zipWith2 [Occ=LoopBreaker] :: forall {t1} {t2} {a}. (t1 -> t2 -> a) -> [t1] -> [t2] -> [a] -[GblId, Arity=3, Str=, Unf=OtherCon []] +[GblId, Arity=3, Str=<1L><1L>, Unf=OtherCon []] zipWith2 = \ (@t) (@t1) (@a) (f :: t -> t1 -> a) (ds :: [t]) (ds1 :: [t1]) -> case ds of { diff --git a/testsuite/tests/arityanal/should_compile/T18793.stderr b/testsuite/tests/arityanal/should_compile/T18793.stderr index c0843f2edc..d1a6b102a9 100644 --- a/testsuite/tests/arityanal/should_compile/T18793.stderr +++ b/testsuite/tests/arityanal/should_compile/T18793.stderr @@ -4,14 +4,14 @@ Result size of Tidy Core = {terms: 81, types: 74, coercions: 0, joins: 0/0} -- RHS size: {terms: 20, types: 13, coercions: 0, joins: 0/0} T18793.$wstuff [InlPrag=NOINLINE] :: Int -> (# Int, [Int] #) -[GblId, Arity=1, Str=, Unf=OtherCon []] +[GblId, Arity=1, Str=, Unf=OtherCon []] T18793.$wstuff = \ (w :: Int) -> (# w, GHC.Types.: @Int (case w of { GHC.Types.I# x -> GHC.Types.I# (GHC.Prim.+# x 1#) }) (GHC.Types.: @Int (case w of { GHC.Types.I# x -> GHC.Types.I# (GHC.Prim.+# x 2#) }) (GHC.Types.[] @Int)) #) -- RHS size: {terms: 8, types: 11, coercions: 0, joins: 0/0} stuff [InlPrag=[final]] :: Int -> [Int] [GblId, Arity=1, - Str=, + Str=, Cpr=m2, 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) Tmpl= \ (w [Occ=Once1] :: Int) -> case T18793.$wstuff w of { (# ww1 [Occ=Once1], ww2 [Occ=Once1] #) -> GHC.Types.: @Int ww1 ww2 }}] @@ -20,7 +20,7 @@ stuff = \ (w :: Int) -> case T18793.$wstuff w of { (# ww1, ww2 #) -> GHC.Types.: Rec { -- RHS size: {terms: 23, types: 11, coercions: 0, joins: 0/0} T18793.$wgo1 [InlPrag=[2], Occ=LoopBreaker] :: [Int] -> GHC.Prim.Int# -> GHC.Prim.Int# -[GblId, Arity=2, Str=, Unf=OtherCon []] +[GblId, Arity=2, Str=<1L>, Unf=OtherCon []] T18793.$wgo1 = \ (w :: [Int]) (ww :: GHC.Prim.Int#) -> case w of { @@ -39,7 +39,7 @@ end Rec } T18793.f_go1 [InlPrag=[2]] :: [Int] -> Int -> Int [GblId, Arity=2, - Str=, + Str=<1L><1P(L)>, 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 [Occ=Once1] :: [Int]) (w1 [Occ=Once1!] :: Int) -> case w1 of { GHC.Types.I# ww1 [Occ=Once1] -> case T18793.$wgo1 w ww1 of ww2 [Occ=Once1] { __DEFAULT -> GHC.Types.I# ww2 } }}] @@ -59,7 +59,7 @@ T18793.f1 = case T18793.$wstuff T18793.f2 of { (# ww1, ww2 #) -> GHC.Types.: @In f :: Int -> Int [GblId, Arity=1, - Str=, + Str=<1P(L)>, 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=False) Tmpl= \ (eta [Occ=Once1] :: Int) -> T18793.f_go1 T18793.f1 eta}] -- cgit v1.2.1