summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Peyton Jones <simonpj@microsoft.com>2021-05-20 23:34:26 +0100
committerMarge Bot <ben+marge-bot@smart-cactus.org>2021-06-05 19:23:46 -0400
commitea9a4ef69a382cf3cee28b78eca390a6a06c6965 (patch)
tree1251922accb19715a884b8530bedcbcad78ad9d9
parentcced9454c9dbe7148534bf68608bed6857482092 (diff)
downloadhaskell-ea9a4ef69a382cf3cee28b78eca390a6a06c6965.tar.gz
Avoid useless w/w split, take 2
This commit: commit c6faa42bfb954445c09c5680afd4fb875ef03758 Author: Simon Peyton Jones <simonpj@microsoft.com> Date: Mon Mar 9 10:20:42 2020 +0000 Avoid useless w/w split This patch is just a tidy-up for the post-strictness-analysis worker wrapper split. Consider f x = x Strictnesss analysis does not lead to a w/w split, so the obvious thing is to leave it 100% alone. But actually, because the RHS is small, we ended up adding a StableUnfolding for it. There is some reason to do this if we choose /not/ do to w/w on the grounds that the function is small. See Note [Don't w/w inline small non-loop-breaker things] But there is no reason if we would not have done w/w anyway. This patch just moves the conditional to later. Easy. turns out to have a bug in it. Instead of /moving/ the conditional, I /duplicated/ it. Then in a subsequent unrelated tidy-up (087ac4eb) I removed the second (redundant) test! This patch does what I originally intended. There is also a small refactoring in GHC.Core.Unfold, to make the code clearer, but with no change in behaviour. It does, however, have a generally good effect on compile times, because we aren't dealing with so many silly stable unfoldings. Here are the non-zero changes: Metrics: compile_time/bytes allocated ------------------------------------- Baseline Test Metric value New value Change --------------------------------------------------------------------------- ManyAlternatives(normal) ghc/alloc 791969344.0 792665048.0 +0.1% ManyConstructors(normal) ghc/alloc 4351126824.0 4358303528.0 +0.2% PmSeriesG(normal) ghc/alloc 50362552.0 50482208.0 +0.2% PmSeriesS(normal) ghc/alloc 63733024.0 63619912.0 -0.2% T10421(normal) ghc/alloc 121224624.0 119695448.0 -1.3% GOOD T10421a(normal) ghc/alloc 85256392.0 83714224.0 -1.8% T10547(normal) ghc/alloc 29253072.0 29258256.0 +0.0% T10858(normal) ghc/alloc 189343152.0 187972328.0 -0.7% T11195(normal) ghc/alloc 281208248.0 279727584.0 -0.5% T11276(normal) ghc/alloc 141966952.0 142046224.0 +0.1% T11303b(normal) ghc/alloc 46228360.0 46259024.0 +0.1% T11545(normal) ghc/alloc 2663128768.0 2667412656.0 +0.2% T11822(normal) ghc/alloc 138686944.0 138760176.0 +0.1% T12227(normal) ghc/alloc 482836000.0 475421056.0 -1.5% GOOD T12234(optasm) ghc/alloc 60710520.0 60781808.0 +0.1% T12425(optasm) ghc/alloc 104089000.0 104022424.0 -0.1% T12545(normal) ghc/alloc 1711759416.0 1705711528.0 -0.4% T12707(normal) ghc/alloc 991541120.0 991921776.0 +0.0% T13035(normal) ghc/alloc 108199872.0 108370704.0 +0.2% T13056(optasm) ghc/alloc 414642544.0 412580384.0 -0.5% T13253(normal) ghc/alloc 361701272.0 355838624.0 -1.6% T13253-spj(normal) ghc/alloc 157710168.0 157397768.0 -0.2% T13379(normal) ghc/alloc 370984400.0 371345888.0 +0.1% T13701(normal) ghc/alloc 2439764144.0 2441351984.0 +0.1% T14052(ghci) ghc/alloc 2154090896.0 2156671400.0 +0.1% T15164(normal) ghc/alloc 1478517688.0 1440317696.0 -2.6% GOOD T15630(normal) ghc/alloc 178053912.0 172489808.0 -3.1% T16577(normal) ghc/alloc 7859948896.0 7854524080.0 -0.1% T17516(normal) ghc/alloc 1271520128.0 1202096488.0 -5.5% GOOD T17836(normal) ghc/alloc 1123320632.0 1123922480.0 +0.1% T17836b(normal) ghc/alloc 54526280.0 54576776.0 +0.1% T17977b(normal) ghc/alloc 42706752.0 42730544.0 +0.1% T18140(normal) ghc/alloc 108834568.0 108693816.0 -0.1% T18223(normal) ghc/alloc 5539629264.0 5579500872.0 +0.7% T18304(normal) ghc/alloc 97589720.0 97196944.0 -0.4% T18478(normal) ghc/alloc 770755472.0 771232888.0 +0.1% T18698a(normal) ghc/alloc 408691160.0 374364992.0 -8.4% GOOD T18698b(normal) ghc/alloc 492419768.0 458809408.0 -6.8% GOOD T18923(normal) ghc/alloc 72177032.0 71368824.0 -1.1% T1969(normal) ghc/alloc 803523496.0 804655112.0 +0.1% T3064(normal) ghc/alloc 198411784.0 198608512.0 +0.1% T4801(normal) ghc/alloc 312416688.0 312874976.0 +0.1% T5321Fun(normal) ghc/alloc 325230680.0 325474448.0 +0.1% T5631(normal) ghc/alloc 592064448.0 593518968.0 +0.2% T5837(normal) ghc/alloc 37691496.0 37710904.0 +0.1% T783(normal) ghc/alloc 404629536.0 405064432.0 +0.1% T9020(optasm) ghc/alloc 266004608.0 266375592.0 +0.1% T9198(normal) ghc/alloc 49221336.0 49268648.0 +0.1% T9233(normal) ghc/alloc 913464984.0 742680256.0 -18.7% GOOD T9675(optasm) ghc/alloc 552296608.0 466322000.0 -15.6% GOOD T9872a(normal) ghc/alloc 1789910616.0 1793924472.0 +0.2% T9872b(normal) ghc/alloc 2315141376.0 2310338056.0 -0.2% T9872c(normal) ghc/alloc 1840422424.0 1841567224.0 +0.1% T9872d(normal) ghc/alloc 556713248.0 556838432.0 +0.0% T9961(normal) ghc/alloc 383809160.0 384601600.0 +0.2% WWRec(normal) ghc/alloc 773751272.0 753949608.0 -2.6% GOOD Residency goes down too: Metrics: compile_time/max_bytes_used ------------------------------------ Baseline Test Metric value New value Change ----------------------------------------------------------- T10370(optasm) ghc/max 42058448.0 39481672.0 -6.1% T11545(normal) ghc/max 43641392.0 43634752.0 -0.0% T15304(normal) ghc/max 29895824.0 29439032.0 -1.5% T15630(normal) ghc/max 8822568.0 8772328.0 -0.6% T18698a(normal) ghc/max 13882536.0 13787112.0 -0.7% T18698b(normal) ghc/max 14714112.0 13836408.0 -6.0% T1969(normal) ghc/max 24724128.0 24733496.0 +0.0% T3064(normal) ghc/max 14041152.0 14034768.0 -0.0% T3294(normal) ghc/max 32769248.0 32760312.0 -0.0% T9630(normal) ghc/max 41605120.0 41572184.0 -0.1% T9675(optasm) ghc/max 18652296.0 17253480.0 -7.5% Metric Decrease: T10421 T12227 T15164 T17516 T18698a T18698b T9233 T9675 WWRec Metric Increase: T12545
-rw-r--r--compiler/GHC/Core/Opt/WorkWrap.hs35
-rw-r--r--compiler/GHC/Core/Unfold.hs7
-rw-r--r--compiler/GHC/Iface/Tidy.hs18
-rw-r--r--testsuite/tests/arityanal/should_compile/Arity01.stderr22
-rw-r--r--testsuite/tests/arityanal/should_compile/Arity02.stderr6
-rw-r--r--testsuite/tests/arityanal/should_compile/Arity05.stderr10
-rw-r--r--testsuite/tests/arityanal/should_compile/Arity06.stderr16
-rw-r--r--testsuite/tests/arityanal/should_compile/Arity07.stderr16
-rw-r--r--testsuite/tests/arityanal/should_compile/Arity08.stderr10
-rw-r--r--testsuite/tests/arityanal/should_compile/Arity10.stderr20
-rw-r--r--testsuite/tests/arityanal/should_compile/Arity11.stderr50
-rw-r--r--testsuite/tests/arityanal/should_compile/Arity14.stderr18
-rw-r--r--testsuite/tests/arityanal/should_compile/Arity15.stderr16
-rw-r--r--testsuite/tests/arityanal/should_compile/T18793.stderr21
-rw-r--r--testsuite/tests/codeGen/should_compile/debug.stdout1
-rw-r--r--testsuite/tests/driver/inline-check.stderr5
-rw-r--r--testsuite/tests/numeric/should_compile/T14465.stdout6
-rw-r--r--testsuite/tests/simplCore/should_compile/T17901.stdout8
-rw-r--r--testsuite/tests/simplCore/should_compile/T4201.stdout4
-rw-r--r--testsuite/tests/simplCore/should_compile/T5658b.stdout2
-rw-r--r--testsuite/tests/warnings/should_compile/T16282/T16282.stderr7
21 files changed, 112 insertions, 186 deletions
diff --git a/compiler/GHC/Core/Opt/WorkWrap.hs b/compiler/GHC/Core/Opt/WorkWrap.hs
index aa29daa9c9..f07f6c5a42 100644
--- a/compiler/GHC/Core/Opt/WorkWrap.hs
+++ b/compiler/GHC/Core/Opt/WorkWrap.hs
@@ -493,11 +493,6 @@ tryWW :: DynFlags
tryWW dflags fam_envs is_rec fn_id rhs
-- See Note [Worker/wrapper for NOINLINE functions]
- | Just stable_unf <- certainlyWillInline uf_opts fn_info
- = return [ (new_fn_id `setIdUnfolding` stable_unf, rhs) ]
- -- See Note [Don't w/w INLINE things]
- -- See Note [Don't w/w inline small non-loop-breaker things]
-
| isRecordSelector fn_id -- See Note [No worker/wrapper for record selectors]
= return [ (new_fn_id, rhs ) ]
@@ -511,25 +506,24 @@ tryWW dflags fam_envs is_rec fn_id rhs
= return [ (new_fn_id, rhs) ]
where
- uf_opts = unfoldingOpts dflags
- fn_info = idInfo fn_id
+ fn_info = idInfo fn_id
(wrap_dmds, div) = splitDmdSig (dmdSigInfo fn_info)
- cpr_ty = getCprSig (cprSigInfo fn_info)
+ cpr_ty = getCprSig (cprSigInfo fn_info)
-- Arity of the CPR sig should match idArity when it's not a join point.
-- See Note [Arity trimming for CPR signatures] in GHC.Core.Opt.CprAnal
- cpr = assertPpr (isJoinId fn_id || cpr_ty == topCprType || ct_arty cpr_ty == arityInfo fn_info)
- (ppr fn_id <> colon <+> text "ct_arty:" <+> int (ct_arty cpr_ty)
- <+> text "arityInfo:" <+> ppr (arityInfo fn_info)) $
- ct_cpr cpr_ty
+ cpr = assertPpr (isJoinId fn_id || cpr_ty == topCprType || ct_arty cpr_ty == arityInfo fn_info)
+ (ppr fn_id <> colon <+> text "ct_arty:" <+> int (ct_arty cpr_ty)
+ <+> text "arityInfo:" <+> ppr (arityInfo fn_info)) $
+ ct_cpr cpr_ty
new_fn_id = zapIdUsedOnceInfo (zapIdUsageEnvInfo fn_id)
-- See Note [Zapping DmdEnv after Demand Analyzer] and
-- See Note [Zapping Used Once info WorkWrap]
- is_fun = notNull wrap_dmds || isJoinId fn_id
- -- See Note [Don't eta expand in w/w]
+ -- is_eta_exp: see Note [Don't eta expand in w/w]
is_eta_exp = length wrap_dmds == manifestArity rhs
+ is_fun = notNull wrap_dmds || isJoinId fn_id
is_thunk = not is_fun && not (exprIsHNF rhs) && not (isJoinId fn_id)
&& not (isUnliftedType (idType fn_id))
@@ -640,9 +634,16 @@ splitFun dflags fam_envs fn_id fn_info wrap_dmds div cpr rhs
; case mb_stuff of
Nothing -> return [(fn_id, rhs)]
- Just stuff -> do { work_uniq <- getUniqueM
- ; return (mkWWBindPair dflags fn_id fn_info arity rhs
- work_uniq div cpr stuff) } }
+ Just stuff
+ | Just stable_unf <- certainlyWillInline (unfoldingOpts dflags) fn_info
+ -> return [ (fn_id `setIdUnfolding` stable_unf, rhs) ]
+ -- See Note [Don't w/w INLINE things]
+ -- See Note [Don't w/w inline small non-loop-breaker things]
+
+ | otherwise
+ -> do { work_uniq <- getUniqueM
+ ; return (mkWWBindPair dflags fn_id fn_info arity rhs
+ work_uniq div cpr stuff) } }
where
rhs_fvs = exprFreeVars rhs
arity = arityInfo fn_info
diff --git a/compiler/GHC/Core/Unfold.hs b/compiler/GHC/Core/Unfold.hs
index e0f6943f31..916eb79a45 100644
--- a/compiler/GHC/Core/Unfold.hs
+++ b/compiler/GHC/Core/Unfold.hs
@@ -967,9 +967,10 @@ certainlyWillInline opts fn_info
UnfIfGoodArgs { ug_size = size, ug_args = args }
-> do_cunf expr size args src'
where
- src' = case src of
- InlineRhs -> InlineStable
- _ -> src -- Do not change InlineCompulsory!
+ src' = -- Do not change InlineCompulsory!
+ case src of
+ InlineCompulsory -> InlineCompulsory
+ _ -> InlineStable
DFunUnfolding {} -> Just fn_unf -- Don't w/w DFuns; it never makes sense
-- to do so, and even if it is currently a
diff --git a/compiler/GHC/Iface/Tidy.hs b/compiler/GHC/Iface/Tidy.hs
index b1e7aa1dc6..83a1ea8346 100644
--- a/compiler/GHC/Iface/Tidy.hs
+++ b/compiler/GHC/Iface/Tidy.hs
@@ -752,10 +752,20 @@ addExternal omit_prags expose_all id
|| isStableSource src -- Always expose things whose
-- source is an inline rule
- || not (bottoming_fn -- No need to inline bottom functions
- || never_active -- Or ones that say not to
- || loop_breaker -- Or that are loop breakers
- || neverUnfoldGuidance guidance)
+ || not dont_inline
+ where
+ dont_inline
+ | never_active = True -- Will never inline
+ | loop_breaker = True -- Ditto
+ | otherwise = case guidance of
+ UnfWhen {} -> False
+ UnfIfGoodArgs {} -> bottoming_fn
+ UnfNever {} -> True
+ -- bottoming_fn: don't inline bottoming functions, unless the
+ -- RHS is very small or trivial (UnfWhen), in which case we
+ -- may as well do so For example, a cast might cancel with
+ -- the call site.
+
show_unfolding (DFunUnfolding {}) = True
show_unfolding _ = False
diff --git a/testsuite/tests/arityanal/should_compile/Arity01.stderr b/testsuite/tests/arityanal/should_compile/Arity01.stderr
index 5d88afdce2..c5c5a24a9a 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: 41, coercions: 0, joins: 0/0}
+Result size of Tidy Core = {terms: 61, types: 43, coercions: 0, joins: 0/0}
-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
F1.f2 :: Integer
@@ -31,11 +31,7 @@ f1 = F1.f1_h1 F1.f3 F1.f2 F1.f3
-- RHS size: {terms: 14, types: 5, coercions: 0, joins: 0/0}
g :: Integer -> Integer -> Integer -> Integer -> Integer -> Integer
-[GblId,
- Arity=5,
- Str=<1L><SL><SL><SL><SL>,
- 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}]
+[GblId, Arity=5, Str=<1L><SL><SL><SL><SL>, Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True, WorkFree=True, Expandable=True, Guidance=IF_ARGS [0 0 0 0 0] 120 0}]
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
-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
@@ -43,13 +39,9 @@ F1.s1 :: Integer
[GblId, Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True, WorkFree=True, Expandable=True, Guidance=IF_ARGS [] 100 0}]
F1.s1 = 3
--- RHS size: {terms: 8, types: 7, coercions: 0, joins: 0/0}
+-- RHS size: {terms: 8, types: 8, coercions: 0, joins: 0/0}
s :: forall {t1} {t2}. Num t1 => (t1 -> t2) -> t2
-[GblId,
- Arity=2,
- Str=<MP(A,A,A,A,A,A,MCM(L))><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)}]
+[GblId, Arity=2, Str=<MP(A,A,A,A,A,A,MCM(L))><1C1(L)>, Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True, WorkFree=True, Expandable=True, Guidance=IF_ARGS [30 60] 50 0}]
s = \ (@t) (@t1) ($dNum :: Num t) (f :: t -> t1) -> f (fromInteger @t $dNum F1.s1)
-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
@@ -59,11 +51,7 @@ F1.h1 = 24
-- RHS size: {terms: 4, types: 1, coercions: 0, joins: 0/0}
h :: Integer -> Integer
-[GblId,
- Arity=1,
- Str=<SL>,
- 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}]
+[GblId, Arity=1, Str=<SL>, Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True, WorkFree=True, Expandable=True, Guidance=IF_ARGS [0] 30 0}]
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 a9fd55094e..576718aff4 100644
--- a/testsuite/tests/arityanal/should_compile/Arity02.stderr
+++ b/testsuite/tests/arityanal/should_compile/Arity02.stderr
@@ -9,11 +9,7 @@ F2.f1 = 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=<1C1(C1(L))><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}]
+[GblId, Arity=2, Str=<1C1(C1(L))><L>, Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True, WorkFree=True, Expandable=True, Guidance=ALWAYS_IF(arity=2,unsat_ok=True,boring_ok=True)}]
f2f = \ (@t) (@t1) (h :: t -> Integer -> t1) (x :: t) -> h x F2.f1
-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
diff --git a/testsuite/tests/arityanal/should_compile/Arity05.stderr b/testsuite/tests/arityanal/should_compile/Arity05.stderr
index cac001de31..7045daa0f1 100644
--- a/testsuite/tests/arityanal/should_compile/Arity05.stderr
+++ b/testsuite/tests/arityanal/should_compile/Arity05.stderr
@@ -27,16 +27,12 @@ f5h [InlPrag=[2]] :: forall {a} {t}. Num a => (t -> a) -> t -> (t -> a) -> a
Arity=4,
Str=<1P(SCS(C1(L)),A,A,A,A,A,MCM(L))><MCM(L)><L><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 }
+ 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 ww [Occ=Once1] _ [Occ=Dead] _ [Occ=Dead] _ [Occ=Dead] _ [Occ=Dead] _ [Occ=Dead] ww6 [Occ=Once1] -> F5.$wf5h @a @t ww ww6 w1 w2 w3 }}]
+f5h = \ (@a) (@t) (w :: Num a) (w1 :: t -> a) (w2 :: t) (w3 :: t -> a) -> case w of { GHC.Num.C:Num ww ww1 ww2 ww3 ww4 ww5 ww6 -> F5.$wf5h @a @t ww ww6 w1 w2 w3 }
-- RHS size: {terms: 4, types: 1, coercions: 0, joins: 0/0}
f5y :: Integer -> Integer
-[GblId,
- Arity=1,
- 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}]
+[GblId, Arity=1, Str=<1L>, Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True, WorkFree=True, Expandable=True, Guidance=IF_ARGS [0] 30 0}]
f5y = \ (y :: Integer) -> GHC.Num.Integer.integerAdd y F5.f5g1
-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
diff --git a/testsuite/tests/arityanal/should_compile/Arity06.stderr b/testsuite/tests/arityanal/should_compile/Arity06.stderr
index 50a1ddc76b..88240eea38 100644
--- a/testsuite/tests/arityanal/should_compile/Arity06.stderr
+++ b/testsuite/tests/arityanal/should_compile/Arity06.stderr
@@ -1,28 +1,20 @@
==================== Tidy Core ====================
-Result size of Tidy Core = {terms: 14, types: 22, coercions: 0, joins: 0/0}
+Result size of Tidy Core = {terms: 14, types: 18, coercions: 0, joins: 0/0}
-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
F6.f6f1 :: Integer
[GblId, Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True, WorkFree=True, Expandable=True, Guidance=IF_ARGS [] 100 0}]
F6.f6f1 = 0
--- RHS size: {terms: 7, types: 8, coercions: 0, joins: 0/0}
+-- RHS size: {terms: 7, types: 6, coercions: 0, joins: 0/0}
f6f :: forall {t1} {t2}. (t1 -> Integer -> t2) -> t1 -> t2
-[GblId,
- Arity=2,
- Str=<C(C(S)),1*C1(C1(U))><L,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=True)
- Tmpl= \ (@t) (@t1) (h [Occ=Once1!] :: t -> Integer -> t1) (x [Occ=Once1] :: t) -> h x F6.f6f1}]
+[GblId, Arity=2, Str=<1C1(C1(L))><L>, Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True, WorkFree=True, Expandable=True, Guidance=ALWAYS_IF(arity=2,unsat_ok=True,boring_ok=True)}]
f6f = \ (@t) (@t1) (h :: t -> Integer -> t1) (x :: t) -> h x F6.f6f1
-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
f6t :: Integer -> Integer -> Integer
-[GblId,
- Arity=2,
- Str=<S,1*U><S,U>,
- 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)
- Tmpl= GHC.Num.Integer.integerAdd}]
+[GblId, Arity=2, Str=<1L><SL>, Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True, WorkFree=True, Expandable=True, Guidance=ALWAYS_IF(arity=0,unsat_ok=True,boring_ok=True)}]
f6t = GHC.Num.Integer.integerAdd
-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
diff --git a/testsuite/tests/arityanal/should_compile/Arity07.stderr b/testsuite/tests/arityanal/should_compile/Arity07.stderr
index 3a1852e017..eeb02d8e5c 100644
--- a/testsuite/tests/arityanal/should_compile/Arity07.stderr
+++ b/testsuite/tests/arityanal/should_compile/Arity07.stderr
@@ -1,23 +1,15 @@
==================== Tidy Core ====================
-Result size of Tidy Core = {terms: 8, types: 11, coercions: 0, joins: 0/0}
+Result size of Tidy Core = {terms: 8, types: 9, coercions: 0, joins: 0/0}
--- RHS size: {terms: 3, types: 3, coercions: 0, joins: 0/0}
+-- RHS size: {terms: 3, types: 2, coercions: 0, joins: 0/0}
f7f :: forall {p}. p -> p
-[GblId,
- Arity=1,
- Str=<S,1*U>,
- 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) (x [Occ=Once1] :: p) -> x}]
+[GblId, Arity=1, Str=<1L>, Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True, WorkFree=True, Expandable=True, Guidance=ALWAYS_IF(arity=1,unsat_ok=True,boring_ok=True)}]
f7f = \ (@p) (x :: p) -> x
-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
f7g :: Integer -> Integer -> Integer
-[GblId,
- Arity=2,
- Str=<S,1*U><S,U>,
- 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)
- Tmpl= GHC.Num.Integer.integerAdd}]
+[GblId, Arity=2, Str=<1L><SL>, Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True, WorkFree=True, Expandable=True, Guidance=ALWAYS_IF(arity=0,unsat_ok=True,boring_ok=True)}]
f7g = GHC.Num.Integer.integerAdd
-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
diff --git a/testsuite/tests/arityanal/should_compile/Arity08.stderr b/testsuite/tests/arityanal/should_compile/Arity08.stderr
index 1f2f6c0fa4..406b5c6bdf 100644
--- a/testsuite/tests/arityanal/should_compile/Arity08.stderr
+++ b/testsuite/tests/arityanal/should_compile/Arity08.stderr
@@ -4,15 +4,7 @@ Result size of Tidy Core = {terms: 23, types: 20, coercions: 0, joins: 0/0}
-- RHS size: {terms: 20, types: 11, coercions: 0, joins: 0/0}
f8f :: forall {p}. Num p => Bool -> p -> p -> p
-[GblId,
- Arity=4,
- Str=<L,U(C(C1(U)),A,1*C1(C1(U)),A,A,A,A)><S,1*U><L,U><L,U>,
- 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= \ (@p) ($dNum :: Num p) (b [Occ=Once1!] :: Bool) (x :: p) (y [Occ=Once2] :: p) ->
- case b of {
- False -> + @p $dNum (+ @p $dNum x y) (* @p $dNum x x);
- True -> y
- }}]
+[GblId, Arity=4, Str=<LP(LCL(C1(L)),A,MCM(C1(L)),A,A,A,A)><1L><L><L>, Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True, WorkFree=True, Expandable=True, Guidance=IF_ARGS [90 30 0 0] 140 0}]
f8f
= \ (@p) ($dNum :: Num p) (b :: Bool) (x :: p) (y :: p) ->
case b of {
diff --git a/testsuite/tests/arityanal/should_compile/Arity10.stderr b/testsuite/tests/arityanal/should_compile/Arity10.stderr
index 3c527026ec..7b01f7680f 100644
--- a/testsuite/tests/arityanal/should_compile/Arity10.stderr
+++ b/testsuite/tests/arityanal/should_compile/Arity10.stderr
@@ -1,6 +1,6 @@
==================== Tidy Core ====================
-Result size of Tidy Core = {terms: 28, types: 34, coercions: 0, joins: 0/0}
+Result size of Tidy Core = {terms: 28, types: 32, coercions: 0, joins: 0/0}
-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
F10.f10f3 :: Integer
@@ -17,23 +17,19 @@ F10.f10f1 :: Integer
[GblId, Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True, WorkFree=True, Expandable=True, Guidance=IF_ARGS [] 100 0}]
F10.f10f1 = 3
--- RHS size: {terms: 8, types: 8, coercions: 0, joins: 0/0}
+-- RHS size: {terms: 8, types: 7, coercions: 0, joins: 0/0}
f10f :: forall {a}. (Integer -> Integer -> a) -> (a, Integer -> a)
[GblId,
Arity=1,
- Str=<L,C(U)>,
- Cpr=m1,
+ Str=<L>,
+ Cpr=1,
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= \ (@a) (h :: Integer -> Integer -> a) -> (h F10.f10f3 F10.f10f2, h F10.f10f1)}]
f10f = \ (@a) (h :: Integer -> Integer -> a) -> (h F10.f10f3 F10.f10f2, h F10.f10f1)
-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
f10g :: Integer -> Integer -> Integer
-[GblId,
- Arity=2,
- Str=<S,1*U><S,U>,
- 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)
- Tmpl= GHC.Num.Integer.integerAdd}]
+[GblId, Arity=2, Str=<1L><SL>, Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True, WorkFree=True, Expandable=True, Guidance=ALWAYS_IF(arity=0,unsat_ok=True,boring_ok=True)}]
f10g = GHC.Num.Integer.integerAdd
-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
@@ -43,11 +39,7 @@ f10x1 = F10.f10f1
-- RHS size: {terms: 2, types: 0, coercions: 0, joins: 0/0}
f10x2 :: Integer -> Integer
-[GblId,
- Arity=1,
- Str=<S,U>,
- 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] :: Integer) -> GHC.Num.Integer.integerAdd F10.f10f1 eta}]
+[GblId, Arity=1, Str=<SL>, Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True, WorkFree=True, Expandable=True, Guidance=IF_ARGS [] 20 60}]
f10x2 = GHC.Num.Integer.integerAdd F10.f10f1
-- RHS size: {terms: 3, types: 3, coercions: 0, joins: 0/0}
diff --git a/testsuite/tests/arityanal/should_compile/Arity11.stderr b/testsuite/tests/arityanal/should_compile/Arity11.stderr
index 92c7649dd2..da35b40ab8 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: 94, coercions: 0, joins: 0/5}
+Result size of Tidy Core = {terms: 129, types: 98, coercions: 0, joins: 0/5}
-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
F11.fib1 :: Integer
@@ -33,50 +33,50 @@ F11.f11_fib
}
end Rec }
--- 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
+-- RHS size: {terms: 52, types: 27, coercions: 0, joins: 0/5}
+F11.$wfib [InlPrag=[2]] :: forall {t} {a}. (t -> t -> Bool) -> (Num t, Num a) => t -> a
[GblId, Arity=4, Str=<SCS(C1(L))><LP(A,LCL(C1(L)),A,A,A,A,L)><LP(LCL(C1(L)),A,A,A,A,A,MCM(L))><L>, Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True, WorkFree=True, Expandable=True, Guidance=IF_ARGS [60 150 60 0] 460 0}]
F11.$wfib
- = \ (@a) (@a1) (ww :: a -> a -> Bool) (w :: Num a) (w1 :: Num a1) (w2 :: a) ->
+ = \ (@t) (@a) (ww :: t -> t -> Bool) (w :: Num t) (w1 :: Num a) (w2 :: t) ->
let {
- lvl :: a
+ lvl :: t
[LclId]
- lvl = fromInteger @a w F11.fib3 } in
+ lvl = fromInteger @t w F11.fib3 } in
let {
- lvl1 :: a
+ lvl1 :: t
[LclId]
- lvl1 = fromInteger @a w F11.fib2 } in
+ lvl1 = fromInteger @t w F11.fib2 } in
let {
- lvl2 :: a1
+ lvl2 :: a
[LclId]
- lvl2 = fromInteger @a1 w1 F11.fib3 } in
+ lvl2 = fromInteger @a w1 F11.fib3 } in
let {
- lvl3 :: a
+ lvl3 :: t
[LclId]
- lvl3 = fromInteger @a w F11.fib1 } in
+ lvl3 = fromInteger @t w F11.fib1 } in
letrec {
- fib4 [Occ=LoopBreaker, Dmd=SCS(L)] :: a -> a1
+ fib4 [Occ=LoopBreaker, Dmd=SCS(L)] :: t -> a
[LclId, Arity=1, Str=<L>, Unf=OtherCon []]
fib4
- = \ (ds :: a) ->
+ = \ (ds :: t) ->
case ww ds lvl3 of {
False ->
case ww ds lvl of {
- False -> + @a1 w1 (fib4 (- @a w ds lvl)) (fib4 (- @a w ds lvl1));
+ False -> + @a w1 (fib4 (- @t w ds lvl)) (fib4 (- @t w ds lvl1));
True -> lvl2
};
True -> lvl2
}; } in
fib4 w2
--- 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
+-- RHS size: {terms: 14, types: 20, coercions: 0, joins: 0/0}
+fib [InlPrag=[2]] :: forall {t} {a}. (Eq t, Num t, Num a) => t -> a
[GblId,
Arity=4,
Str=<1P(SCS(C1(L)),A)><LP(A,LCL(C1(L)),A,A,A,A,L)><LP(LCL(C1(L)),A,A,A,A,A,L)><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) (@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 }
+ Tmpl= \ (@t) (@a) (w [Occ=Once1!] :: Eq t) (w1 [Occ=Once1] :: Num t) (w2 [Occ=Once1] :: Num a) (w3 [Occ=Once1] :: t) -> case w of { GHC.Classes.C:Eq ww [Occ=Once1] _ [Occ=Dead] -> F11.$wfib @t @a ww w1 w2 w3 }}]
+fib = \ (@t) (@a) (w :: Eq t) (w1 :: Num t) (w2 :: Num a) (w3 :: t) -> case w of { GHC.Classes.C:Eq ww ww1 -> F11.$wfib @t @a ww w1 w2 w3 }
-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
F11.f3 :: Integer
@@ -90,20 +90,12 @@ F11.f11_x = F11.f11_fib F11.f3
-- RHS size: {terms: 4, types: 1, coercions: 0, joins: 0/0}
F11.f11f1 :: Integer -> Integer
-[GblId,
- Arity=1,
- Str=<SL>,
- 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}]
+[GblId, Arity=1, Str=<SL>, Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True, WorkFree=True, Expandable=True, Guidance=IF_ARGS [0] 30 0}]
F11.f11f1 = \ (y :: Integer) -> GHC.Num.Integer.integerAdd F11.f11_x y
-- RHS size: {terms: 3, types: 2, coercions: 0, joins: 0/0}
f11f :: forall {p}. p -> Integer -> Integer
-[GblId,
- Arity=2,
- Str=<A><SL>,
- 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}]
+[GblId, Arity=2, Str=<A><SL>, Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True, WorkFree=True, Expandable=True, Guidance=ALWAYS_IF(arity=1,unsat_ok=True,boring_ok=True)}]
f11f = \ (@p) _ [Occ=Dead] -> F11.f11f1
-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
diff --git a/testsuite/tests/arityanal/should_compile/Arity14.stderr b/testsuite/tests/arityanal/should_compile/Arity14.stderr
index d2a9716d04..ee54686a29 100644
--- a/testsuite/tests/arityanal/should_compile/Arity14.stderr
+++ b/testsuite/tests/arityanal/should_compile/Arity14.stderr
@@ -1,14 +1,10 @@
==================== Tidy Core ====================
-Result size of Tidy Core = {terms: 56, types: 81, coercions: 0, joins: 0/3}
+Result size of Tidy Core = {terms: 56, types: 87, coercions: 0, joins: 0/3}
--- RHS size: {terms: 3, types: 2, coercions: 0, joins: 0/0}
+-- RHS size: {terms: 3, types: 3, coercions: 0, joins: 0/0}
F14.f1 :: forall {t}. t -> t
-[GblId,
- Arity=1,
- 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}]
+[GblId, Arity=1, Str=<1L>, Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True, WorkFree=True, Expandable=True, Guidance=ALWAYS_IF(arity=1,unsat_ok=True,boring_ok=True)}]
F14.f1 = \ (@t) (y :: t) -> y
-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
@@ -16,7 +12,7 @@ F14.f2 :: Integer
[GblId, Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True, WorkFree=True, Expandable=True, Guidance=IF_ARGS [] 100 0}]
F14.f2 = 1
--- RHS size: {terms: 35, types: 23, coercions: 0, joins: 0/3}
+-- RHS size: {terms: 35, types: 24, coercions: 0, joins: 0/3}
F14.$wf14 [InlPrag=[2]] :: forall {t}. (t -> t -> Bool) -> Num t => t -> t -> t -> t
[GblId, Arity=4, Str=<SCS(C1(L))><LP(LCL(C1(L)),A,A,A,A,A,MCM(L))><L><L>, Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True, WorkFree=True, Expandable=True, Guidance=IF_ARGS [60 90 0 0] 300 0}]
F14.$wf14
@@ -41,14 +37,14 @@ F14.$wf14
}; } in
f3 w1 w2
--- RHS size: {terms: 13, types: 33, coercions: 0, joins: 0/0}
+-- RHS size: {terms: 13, types: 34, coercions: 0, joins: 0/0}
f14 [InlPrag=[2]] :: forall {t}. (Ord t, Num t) => t -> t -> t -> t
[GblId,
Arity=4,
Str=<1P(A,A,SCS(C1(L)),A,A,A,A,A)><LP(LCL(C1(L)),A,A,A,A,A,L)><L><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= \ (@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 }
+ 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] ww2 [Occ=Once1] _ [Occ=Dead] _ [Occ=Dead] _ [Occ=Dead] _ [Occ=Dead] _ [Occ=Dead] -> F14.$wf14 @t ww2 w1 w2 w3 }}]
+f14 = \ (@t) (w :: Ord t) (w1 :: Num t) (w2 :: t) (w3 :: t) -> case w of { GHC.Classes.C:Ord ww ww1 ww2 ww3 ww4 ww5 ww6 ww7 -> F14.$wf14 @t ww2 w1 w2 w3 }
diff --git a/testsuite/tests/arityanal/should_compile/Arity15.stderr b/testsuite/tests/arityanal/should_compile/Arity15.stderr
index 4034be6198..689939ffef 100644
--- a/testsuite/tests/arityanal/should_compile/Arity15.stderr
+++ b/testsuite/tests/arityanal/should_compile/Arity15.stderr
@@ -1,28 +1,20 @@
==================== Tidy Core ====================
-Result size of Tidy Core = {terms: 14, types: 14, coercions: 0, joins: 0/0}
+Result size of Tidy Core = {terms: 14, types: 12, coercions: 0, joins: 0/0}
-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
F15.f15f1 :: Integer
[GblId, Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True, WorkFree=True, Expandable=True, Guidance=IF_ARGS [] 100 0}]
F15.f15f1 = 1
--- RHS size: {terms: 4, types: 4, coercions: 0, joins: 0/0}
+-- RHS size: {terms: 4, types: 3, coercions: 0, joins: 0/0}
f15f :: forall {t}. (Integer -> t) -> t
-[GblId,
- Arity=1,
- Str=<C(S),1*C1(U)>,
- 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) (h [Occ=Once1!] :: Integer -> t) -> h F15.f15f1}]
+[GblId, Arity=1, Str=<1C1(L)>, Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True, WorkFree=True, Expandable=True, Guidance=ALWAYS_IF(arity=1,unsat_ok=True,boring_ok=True)}]
f15f = \ (@t) (h :: Integer -> t) -> h F15.f15f1
-- RHS size: {terms: 4, types: 1, coercions: 0, joins: 0/0}
f15g :: Integer -> Integer
-[GblId,
- Arity=1,
- Str=<S,1*U>,
- 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= \ (x [Occ=Once1] :: Integer) -> GHC.Num.Integer.integerAdd x F15.f15f1}]
+[GblId, Arity=1, Str=<1L>, Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True, WorkFree=True, Expandable=True, Guidance=IF_ARGS [0] 30 0}]
f15g = \ (x :: Integer) -> GHC.Num.Integer.integerAdd x F15.f15f1
-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
diff --git a/testsuite/tests/arityanal/should_compile/T18793.stderr b/testsuite/tests/arityanal/should_compile/T18793.stderr
index d1a6b102a9..ca73ba7157 100644
--- a/testsuite/tests/arityanal/should_compile/T18793.stderr
+++ b/testsuite/tests/arityanal/should_compile/T18793.stderr
@@ -12,10 +12,10 @@ stuff [InlPrag=[final]] :: Int -> [Int]
[GblId,
Arity=1,
Str=<LP(L)>,
- Cpr=m2,
+ Cpr=2,
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 }}]
-stuff = \ (w :: Int) -> case T18793.$wstuff w of { (# ww1, ww2 #) -> GHC.Types.: @Int ww1 ww2 }
+ Tmpl= \ (w [Occ=Once1] :: Int) -> case T18793.$wstuff w of { (# ww [Occ=Once1], ww1 [Occ=Once1] #) -> GHC.Types.: @Int ww ww1 }}]
+stuff = \ (w :: Int) -> case T18793.$wstuff w of { (# ww, ww1 #) -> GHC.Types.: @Int ww ww1 }
Rec {
-- RHS size: {terms: 23, types: 11, coercions: 0, joins: 0/0}
@@ -40,10 +40,10 @@ T18793.f_go1 [InlPrag=[2]] :: [Int] -> Int -> Int
[GblId,
Arity=2,
Str=<1L><1P(L)>,
- Cpr=m1,
+ Cpr=1,
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 } }}]
-T18793.f_go1 = \ (w :: [Int]) (w1 :: Int) -> case w1 of { GHC.Types.I# ww1 -> case T18793.$wgo1 w ww1 of ww2 { __DEFAULT -> GHC.Types.I# ww2 } }
+ Tmpl= \ (w [Occ=Once1] :: [Int]) (w1 [Occ=Once1!] :: Int) -> case w1 of { GHC.Types.I# ww [Occ=Once1] -> case T18793.$wgo1 w ww of ww1 [Occ=Once1] { __DEFAULT -> GHC.Types.I# ww1 } }}]
+T18793.f_go1 = \ (w :: [Int]) (w1 :: Int) -> case w1 of { GHC.Types.I# ww -> case T18793.$wgo1 w ww of ww1 { __DEFAULT -> GHC.Types.I# ww1 } }
-- RHS size: {terms: 2, types: 0, coercions: 0, joins: 0/0}
T18793.f2 :: Int
@@ -53,16 +53,11 @@ T18793.f2 = GHC.Types.I# 1#
-- RHS size: {terms: 7, types: 10, coercions: 0, joins: 0/0}
T18793.f1 :: [Int]
[GblId, Unf=Unf{Src=<vanilla>, TopLvl=True, Value=False, ConLike=False, WorkFree=False, Expandable=False, Guidance=IF_ARGS [] 40 10}]
-T18793.f1 = case T18793.$wstuff T18793.f2 of { (# ww1, ww2 #) -> GHC.Types.: @Int ww1 ww2 }
+T18793.f1 = case T18793.$wstuff T18793.f2 of { (# ww, ww1 #) -> GHC.Types.: @Int ww ww1 }
-- RHS size: {terms: 2, types: 0, coercions: 0, joins: 0/0}
f :: Int -> Int
-[GblId,
- Arity=1,
- 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}]
+[GblId, Arity=1, Str=<1P(L)>, Cpr=1, Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True, WorkFree=True, Expandable=True, Guidance=IF_ARGS [] 20 60}]
f = T18793.f_go1 T18793.f1
diff --git a/testsuite/tests/codeGen/should_compile/debug.stdout b/testsuite/tests/codeGen/should_compile/debug.stdout
index 25df0c258f..3dca62a419 100644
--- a/testsuite/tests/codeGen/should_compile/debug.stdout
+++ b/testsuite/tests/codeGen/should_compile/debug.stdout
@@ -18,7 +18,6 @@ src<debug.hs:4:9>
src<debug.hs:5:21-29>
src<debug.hs:5:9-29>
src<debug.hs:6:1-21>
-src<debug.hs:6:16-21>
== CBE ==
src<debug.hs:4:9>
89
diff --git a/testsuite/tests/driver/inline-check.stderr b/testsuite/tests/driver/inline-check.stderr
index 953e101315..40b5b59d19 100644
--- a/testsuite/tests/driver/inline-check.stderr
+++ b/testsuite/tests/driver/inline-check.stderr
@@ -23,6 +23,9 @@ Considering inlining: foo
some_benefit False
is exp: True
is work-free: True
- guidance ALWAYS_IF(arity=1,unsat_ok=True,boring_ok=False)
+ guidance IF_ARGS [0] 30 0
+ case depth = 0
+ depth based penalty = 0
+ discounted size = 20
ANSWER = NO
Inactive unfolding: foo1
diff --git a/testsuite/tests/numeric/should_compile/T14465.stdout b/testsuite/tests/numeric/should_compile/T14465.stdout
index 00d3101eb4..7c2e846101 100644
--- a/testsuite/tests/numeric/should_compile/T14465.stdout
+++ b/testsuite/tests/numeric/should_compile/T14465.stdout
@@ -75,10 +75,8 @@ plusOne :: Natural -> Natural
[GblId,
Arity=1,
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= \ (n [Occ=Once1] :: Natural) -> naturalAdd n M.minusOne1}]
+ Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
+ WorkFree=True, Expandable=True, Guidance=IF_ARGS [0] 30 0}]
plusOne = \ (n :: Natural) -> naturalAdd n M.minusOne1
-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
diff --git a/testsuite/tests/simplCore/should_compile/T17901.stdout b/testsuite/tests/simplCore/should_compile/T17901.stdout
index 3017c7a4a6..15a4d4df66 100644
--- a/testsuite/tests/simplCore/should_compile/T17901.stdout
+++ b/testsuite/tests/simplCore/should_compile/T17901.stdout
@@ -1,14 +1,6 @@
- (wombat1 [Occ=Once3!] :: T -> t)
- A -> wombat1 T17901.A;
- B -> wombat1 T17901.B;
- C -> wombat1 T17901.C
= \ (@t) (wombat1 :: T -> t) (x :: T) ->
case x of wild { __DEFAULT -> wombat1 wild }
- (wombat2 [Occ=Once1!] :: S -> t)
- case x of wild [Occ=Once1] { __DEFAULT -> wombat2 wild }}]
= \ (@t) (wombat2 :: S -> t) (x :: S) ->
case x of wild { __DEFAULT -> wombat2 wild }
- (wombat3 [Occ=Once1!] :: W -> t)
- case x of wild [Occ=Once1] { __DEFAULT -> wombat3 wild }}]
= \ (@t) (wombat3 :: W -> t) (x :: W) ->
case x of wild { __DEFAULT -> wombat3 wild }
diff --git a/testsuite/tests/simplCore/should_compile/T4201.stdout b/testsuite/tests/simplCore/should_compile/T4201.stdout
index ef54a0da7c..383d652757 100644
--- a/testsuite/tests/simplCore/should_compile/T4201.stdout
+++ b/testsuite/tests/simplCore/should_compile/T4201.stdout
@@ -1,4 +1,4 @@
+ lift :: Foo -> T
[HasNoCafRefs, LambdaFormInfo: LFReEntrant 1, Arity: 1,
Strictness: <1L>,
- Unfolding: InlineRule (0, True, True)
- bof `cast` (Sym (N:Foo[0]) %<'Many>_N ->_R <T>_R)]
+ Unfolding: (bof `cast` (Sym (N:Foo[0]) %<'Many>_N ->_R <T>_R))]
diff --git a/testsuite/tests/simplCore/should_compile/T5658b.stdout b/testsuite/tests/simplCore/should_compile/T5658b.stdout
index b8626c4cff..0cfbf08886 100644
--- a/testsuite/tests/simplCore/should_compile/T5658b.stdout
+++ b/testsuite/tests/simplCore/should_compile/T5658b.stdout
@@ -1 +1 @@
-4
+2
diff --git a/testsuite/tests/warnings/should_compile/T16282/T16282.stderr b/testsuite/tests/warnings/should_compile/T16282/T16282.stderr
index b25c4c3563..e0da0ab80a 100644
--- a/testsuite/tests/warnings/should_compile/T16282/T16282.stderr
+++ b/testsuite/tests/warnings/should_compile/T16282/T16282.stderr
@@ -7,7 +7,6 @@ T16282.hs: warning: [-Wall-missed-specialisations]
Probable fix: add INLINABLE pragma on ‘T16282A.$wmyMapM_’
T16282.hs: warning: [-Wall-missed-specialisations]
- Could not specialise imported function ‘T16282A.$w$cshowsPrec’
- when specialising ‘T16282A.$fShowMyMap_$cshowsPrec’
- Probable fix: add INLINABLE pragma on ‘T16282A.$w$cshowsPrec’
-Linking T16282.exe ...
+ Could not specialise imported function ‘GHC.Show.$fShow(,)_$cshowList’
+ Probable fix: add INLINABLE pragma on ‘GHC.Show.$fShow(,)_$cshowList’
+