summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastian Graf <sebastian.graf@kit.edu>2021-02-22 18:37:41 +0100
committerSebastian Graf <sgraf1337@gmail.com>2021-03-01 12:47:35 -0500
commitf1886389b9a76ee0c802b326f440abe71d6fe10f (patch)
treeeb3b680f5b40ba440866d36707461ddfe2d81df3
parentf512f9e232329c3c6c5a809d82216cc90a3a3ec7 (diff)
downloadhaskell-wip/T19016.tar.gz
DmdAnal: Better syntax for demand signatures (#19016)wip/T19016
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.
-rw-r--r--compiler/GHC/Core/Opt/DmdAnal.hs61
-rw-r--r--compiler/GHC/Types/Demand.hs179
-rw-r--r--docs/users_guide/using-optimisation.rst60
-rw-r--r--testsuite/tests/arityanal/should_compile/Arity01.stderr16
-rw-r--r--testsuite/tests/arityanal/should_compile/Arity02.stderr12
-rw-r--r--testsuite/tests/arityanal/should_compile/Arity03.stderr6
-rw-r--r--testsuite/tests/arityanal/should_compile/Arity04.stderr6
-rw-r--r--testsuite/tests/arityanal/should_compile/Arity05.stderr16
-rw-r--r--testsuite/tests/arityanal/should_compile/Arity09.stderr8
-rw-r--r--testsuite/tests/arityanal/should_compile/Arity11.stderr38
-rw-r--r--testsuite/tests/arityanal/should_compile/Arity14.stderr20
-rw-r--r--testsuite/tests/arityanal/should_compile/Arity16.stderr12
-rw-r--r--testsuite/tests/arityanal/should_compile/T18793.stderr10
-rw-r--r--testsuite/tests/deSugar/should_compile/T2431.stderr2
-rw-r--r--testsuite/tests/numeric/should_compile/T14465.stdout2
-rw-r--r--testsuite/tests/numeric/should_compile/T7116.stdout8
-rw-r--r--testsuite/tests/simplCore/should_compile/EvalTest.stdout2
-rw-r--r--testsuite/tests/simplCore/should_compile/T13143.stderr4
-rw-r--r--testsuite/tests/simplCore/should_compile/T13543.stderr8
-rw-r--r--testsuite/tests/simplCore/should_compile/T18013.stderr2
-rw-r--r--testsuite/tests/simplCore/should_compile/T3717.stderr4
-rw-r--r--testsuite/tests/simplCore/should_compile/T3772.stdout6
-rw-r--r--testsuite/tests/simplCore/should_compile/T4201.stdout2
-rw-r--r--testsuite/tests/simplCore/should_compile/T4908.stderr6
-rw-r--r--testsuite/tests/simplCore/should_compile/T4930.stderr4
-rw-r--r--testsuite/tests/simplCore/should_compile/T7360.stderr6
-rw-r--r--testsuite/tests/simplCore/should_compile/par01.stderr2
-rw-r--r--testsuite/tests/simplCore/should_compile/spec-inline.stderr8
-rw-r--r--testsuite/tests/stranal/should_compile/T10694.stderr6
-rw-r--r--testsuite/tests/stranal/should_compile/T13031.stdout2
-rw-r--r--testsuite/tests/stranal/should_compile/T18894.stderr100
-rw-r--r--testsuite/tests/stranal/should_compile/T18903.stderr12
-rw-r--r--testsuite/tests/stranal/sigs/BottomFromInnerLambda.hs6
-rw-r--r--testsuite/tests/stranal/sigs/BottomFromInnerLambda.stderr8
-rw-r--r--testsuite/tests/stranal/sigs/DmdAnalGADTs.hs2
-rw-r--r--testsuite/tests/stranal/sigs/DmdAnalGADTs.stderr16
-rw-r--r--testsuite/tests/stranal/sigs/HyperStrUse.stderr4
-rw-r--r--testsuite/tests/stranal/sigs/NewtypeArity.stderr8
-rw-r--r--testsuite/tests/stranal/sigs/StrAnalExample.stderr4
-rw-r--r--testsuite/tests/stranal/sigs/T12370.stderr8
-rw-r--r--testsuite/tests/stranal/sigs/T13380f.stderr24
-rw-r--r--testsuite/tests/stranal/sigs/T17932.stderr4
-rw-r--r--testsuite/tests/stranal/sigs/T18086.hs2
-rw-r--r--testsuite/tests/stranal/sigs/T18086.stderr8
-rw-r--r--testsuite/tests/stranal/sigs/T18957.stderr20
-rw-r--r--testsuite/tests/stranal/sigs/T5075.stderr4
-rw-r--r--testsuite/tests/stranal/sigs/T8569.stderr4
-rw-r--r--testsuite/tests/stranal/sigs/T8598.stderr4
-rw-r--r--testsuite/tests/stranal/sigs/UnsatFun.stderr24
49 files changed, 384 insertions, 396 deletions
diff --git a/compiler/GHC/Core/Opt/DmdAnal.hs b/compiler/GHC/Core/Opt/DmdAnal.hs
index 413da0794a..eedc9b4489 100644
--- a/compiler/GHC/Core/Opt/DmdAnal.hs
+++ b/compiler/GHC/Core/Opt/DmdAnal.hs
@@ -145,7 +145,7 @@ Consider a CoreProgram like
where e* are exported, but n* are not.
Intuitively, we can see that @n1@ is only ever called with two arguments
and in every call site, the first component of the result of the call
-is evaluated. Thus, we'd like it to have idDemandInfo @UCU(C1(P(SU,A))@.
+is evaluated. Thus, we'd like it to have idDemandInfo @LCL(CM(P(1L,A))@.
NB: We may *not* give e2 a similar annotation, because it is exported and
external callers might use it in arbitrary ways, expressed by 'topDmd'.
This can then be exploited by Nested CPR and eta-expansion,
@@ -313,24 +313,6 @@ dmdAnalBindLetDown top_lvl env dmd bind anal_body = case bind of
-- the vanilla call demand seem to be due to (b). So we don't
-- bother to re-analyse the RHS.
-{-
-Note [Ensure demand is strict]
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-It's important not to analyse e with a lazy demand because
-a) When we encounter case s of (a,b) ->
- we demand s with U(d1d2)... but if the overall demand is lazy
- that is wrong, and we'd need to reduce the demand on s,
- which is inconvenient
-b) More important, consider
- f (let x = R in x+x), where f is lazy
- We still want to mark x as demanded, because it will be when we
- enter the let. If we analyse f's arg with a Lazy demand, we'll
- just mark x as Lazy
-c) The application rule wouldn't be right either
- Evaluating (f x) in a L demand does *not* cause
- evaluation of f in a C(L) demand!
--}
-
-- If e is complicated enough to become a thunk, its contents will be evaluated
-- at most once, so oneify it.
dmdTransformThunkDmd :: CoreExpr -> Demand -> Demand
@@ -357,9 +339,6 @@ dmdAnal, dmdAnal' :: AnalEnv
-> SubDemand -- The main one takes a *SubDemand*
-> CoreExpr -> (DmdType, CoreExpr)
--- The SubDemand is always strict and not absent
--- See Note [Ensure demand is strict]
-
dmdAnal env d e = -- pprTrace "dmdAnal" (ppr d <+> ppr e) $
dmdAnal' env d e
@@ -649,7 +628,7 @@ But note that these include the demand on the case binder;
see Note [Demand on case-alternative binders] in GHC.Types.Demand.
This is crucial. Example:
f x = case x of y { (a,b) -> k y a }
-If we just take scrut_demand = U(L,A), then we won't pass x to the
+If we just take scrut_demand = 1P(L,A), then we won't pass x to the
worker, so the worker will rebuild
x = (a, absent-error)
and that'll crash.
@@ -761,12 +740,12 @@ dmdTransform env var dmd
-- | @dmdAnalRhsSig@ analyses the given RHS to compute a demand signature
-- for the LetDown rule. It works as follows:
--
--- * assuming a demand of <U>
+-- * assuming the weakest possible body sub-demand, L
-- * looking at the definition
-- * determining a strictness signature
--
--- Since it assumed a demand of <U>, the resulting signature is applicable at
--- any call site.
+-- Since it assumed a body sub-demand of L, the resulting signature is
+-- applicable at any call site.
dmdAnalRhsSig
:: TopLevelFlag
-> RecFlag
@@ -906,10 +885,10 @@ look a little puzzling. E.g.
( B -> j 4 )
( C -> \y. blah )
-The entire thing is in a C(S) context, so j's strictness signature
+The entire thing is in a C1(L) context, so j's strictness signature
will be [A]b
meaning one absent argument, returns bottom. That seems odd because
-there's a \y inside. But it's right because when consumed in a C(1)
+there's a \y inside. But it's right because when consumed in a C1(L)
context the RHS of the join point is indeed bottom.
Note [Demand signatures are computed for a threshold demand based on idArity]
@@ -940,12 +919,12 @@ arguments than idArity. Example:
then \y -> ... y ...
else \y -> ... y ...
-We'd analyse `f` under a unary call demand C(S), corresponding to idArity
+We'd analyse `f` under a unary call demand C1(L), corresponding to idArity
being 1. That's enough to look under the manifest lambda and find out how a
unary call would use `x`, but not enough to look into the lambdas in the if
branches.
-On the other hand, if we analysed for call demand C(C(S)), we'd get useful
+On the other hand, if we analysed for call demand C1(C1(L)), we'd get useful
strictness info for `y` (and more precise info on `x`) and possibly CPR
information, but
@@ -977,7 +956,7 @@ Consider the following expression, for example:
(let go x y = `x` seq ... in go) |> co
-`go` might have a strictness signature of `<S><L>`. The simplifier will identify
+`go` might have a strictness signature of `<1L><L>`. The simplifier will identify
`go` as a nullary join point through `joinPointBinding_maybe` and float the
coercion into the binding, leading to an arity decrease:
@@ -1058,11 +1037,11 @@ Here we *really* want to unbox z, even though it appears to be used boxed in
the Nil case. Partly the Nil case is not a hot path. But more specifically,
the whole function gets the CPR property if we do.
-That motivated using a demand of C(C(C(S(L,L)))) for the RHS, where
+That motivated using a demand of C1(C1(C1(P(L,L)))) for the RHS, where
(solely because the result was a product) we used a product demand
(albeit with lazy components) for the body. But that gives very silly
behaviour -- see #17932. Happily it turns out now to be entirely
-unnecessary: we get good results with C(C(C(S))). So I simply
+unnecessary: we get good results with C1(C1(C1(L))). So I simply
deleted the special case.
-}
@@ -1169,7 +1148,7 @@ Now to the reasons. For (1) consider
A g1 -> case (x |> g1) of (p,q) -> ...
B -> error "urk"
-where A,B are the constructors of a GADT. We'll get a U(U,U) demand
+where A,B are the constructors of a GADT. We'll get a 1P(L,L) demand
on x from the A branch, but that's a stupid demand for x itself, which
has type 'a'. Indeed we get ASSERTs going off (notably in
splitUseProdDmd, #8569).
@@ -1180,7 +1159,7 @@ For (2) consider
f 0 _ = 0
f _ (MkT n t) = f n t
-Here f is lazy in T, but its *usage* is infinite: U(U,U(U,U(U, ...))).
+Here f is lazy in T, but its *usage* is infinite: P(L,P(L,P(L, ...))).
Notice that this happens because T is a product type, and is recrusive.
If we are not careful, we'll fail to iterate to a fixpoint in dmdFix,
and bale out entirely, which is inefficient and over-conservative.
@@ -1221,11 +1200,11 @@ addVarDmd (DmdType fv ds res) var dmd
addLazyFVs :: DmdType -> DmdEnv -> DmdType
addLazyFVs dmd_ty lazy_fvs
= dmd_ty `plusDmdType` mkPlusDmdArg lazy_fvs
- -- Using bothDmdType (rather than just both'ing the envs)
+ -- Using plusDmdType (rather than just plus'ing the envs)
-- is vital. Consider
-- let f = \x -> (x,y)
-- in error (f 3)
- -- Here, y is treated as a lazy-fv of f, but we must `bothDmd` that L
+ -- Here, y is treated as a lazy-fv of f, but we must `plusDmd` that L
-- demand with the bottom coming up from 'error'
--
-- I got a loop in the fixpointer without this, due to an interaction
@@ -1521,10 +1500,10 @@ Note [Final Demand Analyser run]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Some of the information that the demand analyser determines is not always
preserved by the simplifier. For example, the simplifier will happily rewrite
- \y [Demand=1*U] let x = y in x + x
+ \y [Demand=MU] let x = y in x + x
to
- \y [Demand=1*U] y + y
-which is quite a lie.
+ \y [Demand=MU] y + y
+which is quite a lie: Now y occurs more than just once.
The once-used information is (currently) only used by the code
generator, though. So:
@@ -1541,7 +1520,7 @@ generator, though. So:
This way, correct information finds its way into the module interface
(strictness signatures!) and the code generator (single-entry thunks!)
-Note that, in contrast, the single-call information (C1(..)) /can/ be
+Note that, in contrast, the single-call information (CM(..)) /can/ be
relied upon, as the simplifier tends to be very careful about not
duplicating actual function calls.
diff --git a/compiler/GHC/Types/Demand.hs b/compiler/GHC/Types/Demand.hs
index 8e2fec9ff6..3d6f315f66 100644
--- a/compiler/GHC/Types/Demand.hs
+++ b/compiler/GHC/Types/Demand.hs
@@ -127,6 +127,8 @@ Intervals describe sets, so the underlying lattice is the powerset lattice.
Usually l<=u, but we also have C_10, the interval [1,0], the empty interval,
denoting the empty set. This is the bottom element of the lattice.
+
+See Note [Demand notation] for the notation we use for each of the constructors.
-}
@@ -244,18 +246,19 @@ multCard _ _ = C_0N
-- The "how deep" component is represented by a 'SubDemand'.
-- Examples (using Note [Demand notation]):
--
--- * 'seq' puts demand @SA@ on its argument: It evaluates the argument
--- strictly (@S@), but not any deeper (@A@).
--- * 'fst' puts demand @SP(SU,A)@ on its argument: It evaluates the argument
+-- * 'seq' puts demand @1A@ on its first argument: It evaluates the argument
+-- strictly (@1@), but not any deeper (@A@).
+-- * 'fst' puts demand @1P(1L,A)@ on its argument: It evaluates the argument
-- pair strictly and the first component strictly, but no nested info
--- beyond that (@U@). Its second argument is not used at all.
--- * '$' puts demand @SCS(U)@ on its first argument: It calls (@C@) the
--- argument function with one argument, exactly once (@S@). No info
--- on how the result of that call is evaluated (@U@).
--- * 'maybe' puts demand @1C1(U)@ on its second argument: It evaluates
--- the argument function lazily and calls it once when it is evaluated.
--- * @fst p + fst p@ puts demand @MP(MU,A)@ on @p@: It's @SP(SU,A)@
--- multiplied by two, so we get @M@ (used at least once, possibly multiple
+-- beyond that (@L@). Its second argument is not used at all.
+-- * '$' puts demand @1C1(L)@ on its first argument: It calls (@C@) the
+-- argument function with one argument, exactly once (@1@). No info
+-- on how the result of that call is evaluated (@L@).
+-- * 'maybe' puts demand @MCM(L)@ on its second argument: It evaluates
+-- the argument function at most once ((M)aybe) and calls it once when
+-- it is evaluated.
+-- * @fst p + fst p@ puts demand @SP(SL,A)@ on @p@: It's @1P(1L,A)@
+-- multiplied by two, so we get @S@ (used at least once, possibly multiple
-- times).
--
-- This data type is quite similar to @'Scaled' 'SubDemand'@, but it's scaled
@@ -269,14 +272,14 @@ data Demand
-- denoted thing is evaluated. See 'Demand' for examples.
--
-- The nested 'SubDemand' @d@ of a 'Call' @Cn(d)@ is /relative/ to a single such call.
--- E.g. The expression @f 1 2 + f 3 4@ puts call demand @MCM(CS(U))@ on @f@:
--- @f@ is called exactly twice (@M@), each time exactly once (@S@) with an
+-- E.g. The expression @f 1 2 + f 3 4@ puts call demand @SCS(C1(L))@ on @f@:
+-- @f@ is called exactly twice (@S@), each time exactly once (@1@) with an
-- additional argument.
--
-- The nested 'Demand's @dn@ of a 'Prod' @P(d1,d2,...)@ apply /absolutely/:
-- If @dn@ is a used once demand (cf. 'isUsedOnce'), then that means that
-- the denoted sub-expression is used once in the entire evaluation context
--- described by the surrounding 'Demand'. E.g., @UP(1U)@ means that the
+-- described by the surrounding 'Demand'. E.g., @LP(ML)@ means that the
-- field of the denoted expression is used at most once, although the
-- entire expression might be used many times.
--
@@ -291,12 +294,12 @@ data SubDemand
-- @Poly n@ is semantically equivalent to @Prod [n :* Poly n, ...]@ or
-- @Call n (Poly n)@. 'mkCall' and 'mkProd' do these rewrites.
--
- -- In Note [Demand notation]: @U === P(U,U,...)@ and @U === CU(U)@,
- -- @S === P(S,S,...)@ and @S === CS(S)@, and so on.
+ -- In Note [Demand notation]: @L === P(L,L,...)@ and @L === CL(L)@,
+ -- @1 === P(1,1,...)@ and @1 === C1(1)@, and so on.
--
- -- We only really use 'Poly' with 'C_10' (bottom), 'C_00' (absent),
- -- 'C_0N' (top) and sometimes 'C_1N', but it's simpler to treat it uniformly
- -- than to have a special constructor for each of the three cases.
+ -- We only really use 'Poly' with 'C_10' (B), 'C_00' (A), 'C_0N' (L) and
+ -- sometimes 'C_1N' (S), but it's simpler to treat it uniformly than to
+ -- have a special constructor for each of the three cases.
| Call !Card !SubDemand
-- ^ @Call n sd@ describes the evaluation context of @n@ function
-- applications, where every individual result is evaluated according to @sd@.
@@ -340,7 +343,7 @@ mkProd ds@(n:*sd : _)
| otherwise = Prod ds
where
-- We only want to simplify absent and bottom demands and unbox the others.
- -- See also Note [U should win] and Note [Don't optimise UP(U,U,...) to U].
+ -- See also Note [L should win] and Note [Don't optimise LP(L,L,...) to L].
want_to_simplify C_00 = True
want_to_simplify C_10 = True
want_to_simplify _ = False
@@ -491,22 +494,22 @@ isWeakDmd dmd@(n :* _) = not (isStrict n) && is_plus_idem_dmd dmd
evalDmd :: Demand
evalDmd = C_1N :* topSubDmd
--- | First argument of 'GHC.Exts.maskAsyncExceptions#': @SCS(U)@.
+-- | First argument of 'GHC.Exts.maskAsyncExceptions#': @1C1(L)@.
-- Called exactly once.
strictOnceApply1Dmd :: Demand
strictOnceApply1Dmd = C_11 :* mkCall C_11 topSubDmd
--- | First argument of 'GHC.Exts.atomically#': @MCM(U)@.
+-- | First argument of 'GHC.Exts.atomically#': @SCS(L)@.
-- Called at least once, possibly many times.
strictManyApply1Dmd :: Demand
strictManyApply1Dmd = C_1N :* mkCall C_1N topSubDmd
--- | First argument of catch#: @1C1(U)@.
+-- | First argument of catch#: @MCM(L)@.
-- Evaluates its arg lazily, but then applies it exactly once to one argument.
lazyApply1Dmd :: Demand
lazyApply1Dmd = C_01 :* mkCall C_01 topSubDmd
--- | Second argument of catch#: @1C1(CS(U))@.
+-- | Second argument of catch#: @MCM(C1(L))@.
-- Calls its arg lazily, but then applies it exactly once to an additional argument.
lazyApply2Dmd :: Demand
lazyApply2Dmd = C_01 :* mkCall C_01 (mkCall C_11 topSubDmd)
@@ -548,11 +551,11 @@ strictifyDictDmd ty (n :* Prod ds)
= Nothing
strictifyDictDmd _ dmd = dmd
--- | Wraps the 'SubDemand' with a one-shot call demand: @d@ -> @CS(d)@.
+-- | Wraps the 'SubDemand' with a one-shot call demand: @d@ -> @C1(d)@.
mkCalledOnceDmd :: SubDemand -> SubDemand
mkCalledOnceDmd sd = mkCall C_11 sd
--- | @mkCalledOnceDmds n d@ returns @CS(CS...(CS d))@ where there are @n@ @CS@'s.
+-- | @mkCalledOnceDmds n d@ returns @C1(C1...(C1 d))@ where there are @n@ @C1@'s.
mkCalledOnceDmds :: Arity -> SubDemand -> SubDemand
mkCalledOnceDmds arity sd = iterate mkCalledOnceDmd sd !! arity
@@ -613,9 +616,9 @@ argOneShots (_ :* sd) = go sd -- See Note [Call demands are relative]
go _ = []
-- |
--- @saturatedByOneShots n C1(C1(...)) = True@
+-- @saturatedByOneShots n CM(CM(...)) = True@
-- <=>
--- There are at least n nested C1(..) calls.
+-- There are at least n nested CM(..) calls.
-- See Note [Demand on the worker] in GHC.Core.Opt.WorkWrap
saturatedByOneShots :: Int -> Demand -> Bool
saturatedByOneShots n (_ :* sd) = isUsedOnce (peelManyCalls n sd)
@@ -643,12 +646,12 @@ In #7319 we get
Note [Call demands are relative]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The expression @if b then 0 else f 1 2 + f 3 4@ uses @f@ according to the demand
-@UCU(CS(P(U)))@, meaning
+@LCL(C1(P(L)))@, meaning
- "f is called multiple times or not at all (CU), but each time it
- is called, it's called with *exactly one* (CS) more argument.
+ "f is called multiple times or not at all (CL), but each time it
+ is called, it's called with *exactly one* (C1) more argument.
Whenever it is called with two arguments, we have no info on how often
- the field of the product result is used (U)."
+ the field of the product result is used (L)."
So the 'SubDemand' nested in a 'Call' demand is relative to exactly one call.
And that extends to the information we have how its results are used in each
@@ -665,7 +668,7 @@ call site. Consider (#18903)
2 -> snd (g m)
_ -> uncurry (+) (g m)
-We want to give @g@ the demand @1C1(P(1P(U),SP(U)))@, so we see that in each call
+We want to give @g@ the demand @MCM(P(MP(L),1P(L)))@, so we see that in each call
site of @g@, we are strict in the second component of the returned pair.
This relative cardinality leads to an otherwise unexpected call to 'lubSubDmd'
@@ -674,8 +677,8 @@ in 'plusSubDmd', but if you do the math it's just the right thing.
There's one more subtlety: Since the nested demand is relative to exactly one
call, in the case where we have *at most zero calls* (e.g. CA(...)), the premise
is hurt and we can assume that the nested demand is 'botSubDmd'. That ensures
-that @g@ above actually gets the @SP(U)@ demand on its second pair component,
-rather than the lazy @1P(U)@ if we 'lub'bed with an absent demand.
+that @g@ above actually gets the @1P(L)@ demand on its second pair component,
+rather than the lazy @MP(L)@ if we 'lub'bed with an absent demand.
Demand on case-alternative binders]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -691,10 +694,10 @@ Example. Source code:
foo (p,q) = foo (q,p)
After strictness analysis:
- f = \ (x_an1 [Dmd=<SP(SL),1*UP(U,1*U)>] :: (Bool, Bool)) ->
+ f = \ (x_an1 [Dmd=1P(1L,ML)] :: (Bool, Bool)) ->
case x_an1
- of wild_X7 [Dmd=<L,1*UP(1*U,1*U)>]
- { (p_an2 [Dmd=<S,1*U>], ds_dnz [Dmd=<L,A>]) ->
+ of wild_X7 [Dmd=MP(ML,ML)]
+ { (p_an2 [Dmd=1L], ds_dnz [Dmd=A]) ->
case p_an2 of _ {
False -> GHC.Types.True;
True -> foo wild_X7 }
@@ -706,43 +709,43 @@ consequences play out.
This is needed even for non-product types, in case the case-binder
is used but the components of the case alternative are not.
-Note [Don't optimise UP(U,U,...) to U]
+Note [Don't optimise LP(L,L,...) to L]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
These two SubDemands:
- UP(U,U) (@Prod [topDmd, topDmd]@) and U (@topSubDmd@)
+ LP(L,L) (@Prod [topDmd, topDmd]@) and L (@topSubDmd@)
are semantically equivalent, but we do not turn the former into
the latter, for a regrettable-subtle reason. Consider
f p1@(x,y) = (y,x)
g h p2@(_,_) = h p
We want to unbox @p1@ of @f@, but not @p2@ of @g@, because @g@ only uses
-@p2@ boxed and we'd have to rebox. So we give @p1@ demand UP(U,U) and @p2@
-demand @U@ to inform 'GHC.Core.Opt.WorkWrap.Utils.wantToUnbox', which will
+@p2@ boxed and we'd have to rebox. So we give @p1@ demand LP(L,L) and @p2@
+demand @L@ to inform 'GHC.Core.Opt.WorkWrap.Utils.wantToUnbox', which will
say "unbox" for @p1@ and "don't unbox" for @p2@.
So the solution is: don't aggressively collapse @Prod [topDmd, topDmd]@ to
@topSubDmd@; instead leave it as-is. In effect we are using the UseDmd to do a
little bit of boxity analysis. Not very nice.
-Note [U should win]
+Note [L should win]
~~~~~~~~~~~~~~~~~~~
-Both in 'lubSubDmd' and 'plusSubDmd' we want @U `plusSubDmd` UP(..)) to be @U@.
+Both in 'lubSubDmd' and 'plusSubDmd' we want @L `plusSubDmd` LP(..))@ to be @L@.
Why? Because U carries the implication the whole thing is used, box and all,
-so we don't want to w/w it, cf. Note [Don't optimise UP(U,U,...) to U].
+so we don't want to w/w it, cf. Note [Don't optimise LP(L,L,...) to L].
If we use it both boxed and unboxed, then we are definitely using the box,
and so we are quite likely to pay a reboxing cost. So we make U win here.
TODO: Investigate why since 2013, we don't.
Example is in the Buffer argument of GHC.IO.Handle.Internals.writeCharBuffer
-Baseline: (A) Not making Used win (UProd wins)
+Baseline: (A) Not making Used win (LP(..) wins)
Compare with: (B) making Used win for lub and both
Min -0.3% -5.6% -10.7% -11.0% -33.3%
Max +0.3% +45.6% +11.5% +11.5% +6.9%
Geometric Mean -0.0% +0.5% +0.3% +0.2% -0.8%
-Baseline: (B) Making Used win for both lub and both
-Compare with: (C) making Used win for plus, but UProd win for lub
+Baseline: (B) Making L win for both lub and both
+Compare with: (C) making L win for plus, but LP(..) win for lub
Min -0.1% -0.3% -7.9% -8.0% -6.5%
Max +0.1% +1.0% +21.0% +21.0% +0.5%
@@ -753,7 +756,7 @@ Note [Computing one-shot info]
Consider a call
f (\pqr. e1) (\xyz. e2) e3
where f has usage signature
- C1(C(C1(U))) C1(U) U
+ <CM(CL(CM(L)))><CM(L)><L>
Then argsOneShots returns a [[OneShotInfo]] of
[[OneShot,NoOneShotInfo,OneShot], [OneShot]]
The occurrence analyser propagates this one-shot infor to the
@@ -1262,18 +1265,18 @@ scenario.
Consider
err x y = x `seq` y `seq` error (show x)
this has a strictness signature of
- <SU><SU>b
+ <1L><1L>b
meaning that we don't know what happens when we call err in weaker contexts than
-CS(CS(U)), like @err `seq` ()@ (SU) and @err 1 `seq` ()@ (CS(U)). We
+C1(C1(L)), like @err `seq` ()@ (1A) and @err 1 `seq` ()@ (CS(A)). We
may not unleash the botDiv, hence assume topDiv. Of course, in
-@err 1 2 `seq` ()@ the incoming demand CS(CS(S)) is strong enough and we see
+@err 1 2 `seq` ()@ the incoming demand CS(CS(A)) is strong enough and we see
that the expression diverges.
Now consider a function
f g = g 1 2
-with signature <CS(CS(U))>, and the expression
+with signature <C1(C1(L))>, and the expression
f err `seq` ()
-now f puts a strictness demand of CS(CS(U)) onto its argument, which is unleashed
+now f puts a strictness demand of C1(C1(L)) onto its argument, which is unleashed
on err via the App rule. In contrast to weaker head strictness, this demand is
strong enough to unleash err's signature and hence we see that the whole
expression diverges!
@@ -1308,7 +1311,7 @@ Note [Demands from unsaturated function calls]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Consider a demand transformer d1 -> d2 -> r for f.
If a sufficiently detailed demand is fed into this transformer,
-e.g <CS(CS(U))> arising from "f x1 x2" in a strict, use-once context,
+e.g <C1(C1(L))> arising from "f x1 x2" in a strict, use-once context,
then d1 and d2 is precisely the demand unleashed onto x1 and x2 (similar for
the free variable environment) and furthermore the result information r is the
one we want to use.
@@ -1316,9 +1319,9 @@ one we want to use.
An anonymous lambda is also an unsaturated function all (needs one argument,
none given), so this applies to that case as well.
-But the demand fed into f might be less than CS(CS(U)). Then we have to
+But the demand fed into f might be less than C1(C1(L)). Then we have to
'multDmdType' the announced demand type. Examples:
- * Not strict enough, e.g. C1(C1(U)):
+ * Not strict enough, e.g. C1(C1(L)):
- We have to multiply all argument and free variable demands with C_01,
zapping strictness.
- We have to multiply divergence with C_01. If r says that f Diverges for sure,
@@ -1326,7 +1329,7 @@ But the demand fed into f might be less than CS(CS(U)). Then we have to
be passed. If the demand is lower, we may just as well converge.
If we were tracking definite convergence, than that would still hold under
a weaker demand than expected by the demand transformer.
- * Used more than once, e.g. CM(CS(U)):
+ * Used more than once, e.g. CS(C1(L)):
- Multiply with C_1N. Even if f puts a used-once demand on any of its argument
or free variables, if we call f multiple times, we may evaluate this
argument or free variable multiple times.
@@ -1373,13 +1376,13 @@ demand on all arguments. Otherwise, the demand is specified by Id's
signature.
For example, the demand transformer described by the demand signature
- StrictSig (DmdType {x -> <S,1*U>} <L,A><C_,(U,U)>m)
+ StrictSig (DmdType {x -> <1L>} <A><1P(L,L)>)
says that when the function is applied to two arguments, it
-unleashes demand <S,1*U> on the free var x, <L,A> on the first arg,
-and <C_,(U,U)> on the second, then returning a constructor.
+unleashes demand 1L on the free var x, A on the first arg,
+and 1P(L,L) on the second.
If this same function is applied to one arg, all we can say is that it
-uses x with <C_,>, and its arg with demand <C_,>.
+uses x with 1L, and its arg with demand 1P(L,L).
Note [Understanding DmdType and StrictSig]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -1395,9 +1398,9 @@ yields a more precise demand type:
incoming demand | demand type
--------------------------------
- SA | <U><U>{}
- CS(CS(U)) | <SP(U)><U>{}
- CS(CS(SP(SP(U),A))) | <SP(A)><A>{}
+ 1A | <L><L>{}
+ C1(C1(L)) | <1P(L)><L>{}
+ C1(C1(1P(1P(L),A))) | <1P(A)><A>{}
Note that in the first example, the depth of the demand type was *higher* than
the arity of the incoming call demand due to the anonymous lambda.
@@ -1574,11 +1577,11 @@ was evaluated. Here's an example:
else \z -> z * ...
The abstract transformer (let's call it F_e) of the if expression (let's
-call it e) would transform an incoming (undersaturated!) head demand SA into
-a demand type like {x-><SU>,y-><U>}<U>. In pictures:
+call it e) would transform an incoming (undersaturated!) head demand 1A into
+a demand type like {x-><1L>,y-><L>}<L>. In pictures:
Demand ---F_e---> DmdType
- <SA> {x-><SU>,y-><U>}<U>
+ <1A> {x-><1L>,y-><L>}<L>
Let's assume that the demand transformers we compute for an expression are
correct wrt. to some concrete semantics for Core. How do demand signatures fit
@@ -1586,7 +1589,7 @@ in? They are strange beasts, given that they come with strict rules when to
it's sound to unleash them.
Fortunately, we can formalise the rules with Galois connections. Consider
-f's strictness signature, {}<SU><U>. It's a single-point approximation of
+f's strictness signature, {}<1L><L>. It's a single-point approximation of
the actual abstract transformer of f's RHS for arity 2. So, what happens is that
we abstract *once more* from the abstract domain we already are in, replacing
the incoming Demand by a simple lattice with two elements denoting incoming
@@ -1600,14 +1603,14 @@ element). Here's the diagram:
SubDemand --F_f----> DmdType
With
- α(CS(CS(_))) = >=2
+ α(C1(C1(_))) = >=2
α(_) = <2
γ(ty) = ty
and F_f being the abstract transformer of f's RHS and f_f being the abstracted
abstract transformer computable from our demand signature simply by
- f_f(>=2) = {}<S,1*U><L,U>
- f_f(<2) = multDmdType C_0N {}<S,1*U><L,U>
+ f_f(>=2) = {}<1L><L>
+ f_f(<2) = multDmdType C_0N {}<1L><L>
where multDmdType makes a proper top element out of the given demand type.
@@ -1616,14 +1619,14 @@ exactly the Card with which we have to multDmdType. The Card for arity n
is computed by calling @peelManyCalls n@, which corresponds to α above.
Note [Demand transformer for a dictionary selector]
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
If we evaluate (op dict-expr) under demand 'd', then we can push the demand 'd'
into the appropriate field of the dictionary. What *is* the appropriate field?
We just look at the strictness signature of the class op, which will be
-something like: UP(AAASAAAAA). Then replace the 'S' by the demand 'd'.
+something like: P(AAA1AAAAA). Then replace the '1' by the demand 'd'.
For single-method classes, which are represented by newtypes the signature
-of 'op' won't look like UP(...), so matching on Prod will fail.
+of 'op' won't look like P(...), so matching on Prod will fail.
That's fine: if we are doing strictness analysis we are also doing inlining,
so we'll have inlined 'op' into a cast. So we can bale out in a conservative
way, returning nopDmdType.
@@ -1650,7 +1653,7 @@ zapUsageDemand = kill_usage $ KillFlags
, kf_called_once = True
}
--- | Remove all 1* information (but not C1 information) from the demand
+-- | Remove all `C_01 :*` info (but not `CM` sub-demands) from the demand
zapUsedOnceDemand :: Demand -> Demand
zapUsedOnceDemand = kill_usage $ KillFlags
{ kf_abs = False
@@ -1658,7 +1661,7 @@ zapUsedOnceDemand = kill_usage $ KillFlags
, kf_called_once = False
}
--- | Remove all 1* information (but not C1 information) from the strictness
+-- | Remove all `C_01 :*` info (but not `CM` sub-demands) from the strictness
-- signature
zapUsedOnceSig :: StrictSig -> StrictSig
zapUsedOnceSig (StrictSig (DmdType env ds r))
@@ -1756,7 +1759,12 @@ in the user's guide.
For pretty-printing demands, we use quite a compact notation with some
abbreviations. Here's the BNF:
- card ::= B | A | 1 | U | S | M {}, {0}, {0,1}, {0,1,n}, {1}, {1,n}
+ card ::= B {}
+ | A {0}
+ | M {0,1}
+ | L {0,1,n}
+ | 1 {1}
+ | S {1,n}
d ::= card sd The :* constructor, just juxtaposition
| card abbreviation: Same as "card card",
@@ -1766,7 +1774,7 @@ abbreviations. Here's the BNF:
| P(d,d,..) @Prod [d1,d2,..]@
| Ccard(sd) @Call card sd@
-So, U can denote a 'Card', polymorphic 'SubDemand' or polymorphic 'Demand',
+So, L can denote a 'Card', polymorphic 'SubDemand' or polymorphic 'Demand',
but it's always clear from context which "overload" is meant. It's like
return-type inference of e.g. 'read'.
@@ -1792,13 +1800,14 @@ This is the syntax for demand signatures:
-}
-- | See Note [Demand notation]
+-- Current syntax was discussed in #19016.
instance Outputable Card where
- ppr C_00 = char 'A'
- ppr C_01 = char '1'
- ppr C_0N = char 'U'
- ppr C_11 = char 'S'
- ppr C_1N = char 'M'
- ppr C_10 = char 'B'
+ ppr C_00 = char 'A' -- "Absent"
+ ppr C_01 = char 'M' -- "Maybe"
+ ppr C_0N = char 'L' -- "Lazy"
+ ppr C_11 = char '1' -- "exactly 1"
+ ppr C_1N = char 'S' -- "Strict"
+ ppr C_10 = char 'B' -- "Bottom"
-- | See Note [Demand notation]
instance Outputable Demand where
diff --git a/docs/users_guide/using-optimisation.rst b/docs/users_guide/using-optimisation.rst
index a6e5a60ffb..2722a285df 100644
--- a/docs/users_guide/using-optimisation.rst
+++ b/docs/users_guide/using-optimisation.rst
@@ -1169,18 +1169,18 @@ by saying ``-fno-wombat``.
+----------+------------------------------+--------+---------------------------------------+
| Interval | Set of denoted cardinalities | Syntax | Explanation tying syntax to semantics |
+==========+==============================+========+=======================================+
- | [1,0] | {} | ``B`` | bottom element |
+ | [1,0] | {} | ``B`` | Bottom element |
+----------+------------------------------+--------+---------------------------------------+
- | [0,0] | {0} | ``A`` | absent |
+ | [0,0] | {0} | ``A`` | Absent |
+----------+------------------------------+--------+---------------------------------------+
- | [0,1] | {0,1} | ``1`` | used at most once |
+ | [0,1] | {0,1} | ``M`` | Used at most once ("Maybe") |
+----------+------------------------------+--------+---------------------------------------+
- | [0,ω] | {0,1,ω} | ``U`` | top element, no information, |
+ | [0,ω] | {0,1,ω} | ``L`` | Lazy. Top element, no information, |
| | | | used at least 0, at most many times |
+----------+------------------------------+--------+---------------------------------------+
- | [1,1] | {1} | ``S`` | strict, used exactly once |
+ | [1,1] | {1} | ``1`` | Strict, used exactly once |
+----------+------------------------------+--------+---------------------------------------+
- | [1,ω] | {1,ω} | ``M`` | strict, used possibly many times |
+ | [1,ω] | {1,ω} | ``S`` | Strict, used possibly many times |
+----------+------------------------------+--------+---------------------------------------+
Note that it's never interesting to differentiate between a cardinality
@@ -1195,7 +1195,7 @@ by saying ``-fno-wombat``.
.. code-block:: none
- card ::= B | A | 1 | U | S | M semantics as in the table above
+ card ::= B | A | M | L | 1 | S semantics as in the table above
d ::= card sd card = how often, sd = how deep
| card abbreviation: Same as "card card"
@@ -1206,23 +1206,23 @@ by saying ``-fno-wombat``.
For example, ``fst`` is strict in its argument, and also in the first
component of the argument. It will not evaluate the argument's second
- component. That is expressed by the demand ``SP(SU,A)``. The ``P`` is for
+ component. That is expressed by the demand ``1P(1L,A)``. The ``P`` is for
"product sub-demand", which has a *demand* for each product field. The
- notation ``SU`` just says "evaluated strictly (``S``), with everything
- nested inside evaluated according to ``U``" -- e.g., no information,
+ notation ``1L`` just says "evaluated strictly (``1``), with everything
+ nested inside evaluated according to ``L``" -- e.g., no information,
because that would depend on the evaluation context of the call site of
- ``fst``. The role of ``U`` in ``SU`` is that of a *polymorphic* sub-demand,
- being semantically equivalent to the sub-demand ``P(UP(..))``, which we
+ ``fst``. The role of ``L`` in ``1L`` is that of a *polymorphic* sub-demand,
+ being semantically equivalent to the sub-demand ``P(LP(..))``, which we
simply abbreviate by the (consequently overloaded) cardinality notation
- ``U``.
+ ``L``.
For another example, the expression ``x + 1`` evaluates ``x`` according to
- demand ``SP(U)``. We have seen single letters stand for cardinalities and
- polymorphic sub-demands, but what does the single letter ``U`` mean for a
+ demand ``1P(L)``. We have seen single letters stand for cardinalities and
+ polymorphic sub-demands, but what does the single letter ``L`` mean for a
*demand*? Such a single letter demand simply expands to a cardinality and
- a polymorphic sub-demand of the same letter: E.g. ``U`` is equivalent to
- ``UU`` by expansion of the single letter demand, which is equivalent to
- ``UP(UP(..))``, so ``U``\s all the way down. It is always clear from
+ a polymorphic sub-demand of the same letter: E.g. ``L`` is equivalent to
+ ``LL`` by expansion of the single letter demand, which is equivalent to
+ ``LP(LP(..))``, so ``L``\s all the way down. It is always clear from
context whether we talk about about a cardinality, sub-demand or demand.
**Demand signatures**
@@ -1243,15 +1243,15 @@ by saying ``-fno-wombat``.
no information)
We summarise ``fst``'s demand properties in its *demand signature*
- ``<SP(SU,A)>``, which just says "If ``fst`` is applied to one argument,
- that argument is evaluated according to ``SP(SU,A)``". For another
- example, the demand signature of ``seq`` would be ``<SA>`` and that of
- ``+`` would be ``<SP(U)><SP(U)>``.
+ ``<1P(1L,A)>``, which just says "If ``fst`` is applied to one argument,
+ that argument is evaluated according to ``1P(1L,A)``". For another
+ example, the demand signature of ``seq`` would be ``<1A><1L>`` and that of
+ ``+`` would be ``<1P(L)><1P(L)>``.
If not omitted, the divergence information can be ``b`` (surely diverges)
or ``x`` (surely diverges or throws a precise exception). For example,
- ``error`` has demand signature ``<M>b`` and ``throwIO`` (which is the
- only way to throw precise exceptions) has demand signature ``<_><U><U>x``
+ ``error`` has demand signature ``<S>b`` and ``throwIO`` (which is the
+ only way to throw precise exceptions) has demand signature ``<_><L><L>x``
(leaving out the complicated demand on the ``Exception`` dictionary).
**Call sub-demands**
@@ -1262,16 +1262,16 @@ by saying ``-fno-wombat``.
maybe n _ Nothing = n
maybe _ s (Just a) = s a
- We give it demand signature ``<U><1C1(U)><SU>``. The ``C1(U)`` is a *call
+ We give it demand signature ``<L><MCM(L)><1L>``. The ``CM(L)`` is a *call
sub-demand* that says "Called at most once, where the result is used
- according to ``U``". The expression ``f `seq` f 1 2`` puts ``f`` under
- demand ``MCS(U)`` and serves as an example where the upper bound on
+ according to ``L``". The expression ``f `seq` f 1`` puts ``f`` under
+ demand ``SC1(L)`` and serves as an example where the upper bound on
evaluation cardinality doesn't conincide with that of the call cardinality.
Cardinality is always relative to the enclosing call cardinality, so
- ``g 1 2 + g 3 4`` puts ``g`` under demand ``MCM(CS(U))``, which says
- "called multiple times (``M``), but every time it is called with one
- argument, it is applied exactly once to another argument (``S``)".
+ ``g 1 2 + g 3 4`` puts ``g`` under demand ``SCS(C1(L))``, which says
+ "called multiple times (``S``), but every time it is called with one
+ argument, it is applied exactly once to another argument (``1``)".
.. ghc-flag:: -fstrictness-before=⟨n⟩
:shortdesc: Run an additional demand analysis before simplifier phase ⟨n⟩
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=<MU><MU><MU>, Unf=OtherCon []]
+[GblId, Arity=3, Str=<SL><SL><SL>, 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=<SU><MU><MU><MU><MU>,
+ 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}]
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=<vanilla>, 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))><SCS(U)>,
+ 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)}]
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=<MU>,
+ 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}]
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=<vanilla>, 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=<SCS(CS(U))><U>,
+ 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}]
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=<MU><MU>, Unf=OtherCon []]
+[GblId, Arity=2, Str=<SL><SL>, 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=<SU>, 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=<SP(SU)>,
+ 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=<SP(SU)>,
+ 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=<SP(U)>,
+ 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=<SCS(U)><SU>, 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=<SCS(U)><SP(SU)>,
+ 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=<vanilla>, 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=<MP(SCS(CS(U)),A,A,A,A,A,1C1(U))><1C1(U)><U>,
+ Str=<SP(1C1(C1(L)),A,A,A,A,A,MCM(L))><MCM(L)><L>,
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=<MCM(CS(U))><1C1(U)><1C1(U)><U><1C1(U)>, Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True, WorkFree=True, Expandable=True, Guidance=IF_ARGS [60 60 60 0 60] 120 0}]
+[GblId, Arity=5, Str=<SCS(C1(L))><MCM(L)><MCM(L)><L><MCM(L)>, Unf=Unf{Src=<vanilla>, 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=<SP(MCM(CS(U)),A,A,A,A,A,1C1(U))><1C1(U)><U><1C1(U)>,
+ 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 }
@@ -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=<SU>,
+ 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=<MU>, Unf=OtherCon []]
+[GblId, Arity=1, Str=<SL>, 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=<MU>, Unf=OtherCon []]
+[GblId, Arity=1, Str=<SL>, 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=<MCM(CS(U))><UP(A,UCU(CS(U)),A,A,A,A,U)><UP(UCU(CS(U)),A,A,A,A,A,1C1(U))><U>, Unf=Unf{Src=<vanilla>, 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=<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) (@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=<U>, Unf=OtherCon []]
+ fib4 [Occ=LoopBreaker, Dmd=SCS(L)] :: a -> a1
+ [LclId, Arity=1, Str=<L>, 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=<SP(MCM(CS(U)),A)><UP(A,UCU(CS(U)),A,A,A,A,U)><UP(UCU(CS(U)),A,A,A,A,A,U)><U>,
+ 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) (@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=<MU>,
+ 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}]
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=<A><MU>,
+ 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}]
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=<SU>,
+ 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=<vanilla>, 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=<MCM(CS(U))><UP(UCU(CS(U)),A,A,A,A,A,1C1(U))><U><U>, Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True, WorkFree=True, Expandable=True, Guidance=IF_ARGS [60 90 0 0] 300 0}]
+[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
= \ (@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=<U><U>, Unf=OtherCon []]
+ f3 [Occ=LoopBreaker, Dmd=SCS(C1(L))] :: t -> t -> t -> t
+ [LclId, Arity=2, Str=<L><L>, 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=<SP(A,A,MCM(CS(U)),A,A,A,A,A)><UP(UCU(CS(U)),A,A,A,A,A,UCU(U))><U><U>,
+ 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 }
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=<U><SU>, Unf=OtherCon []]
+[GblId, Arity=2, Str=<L><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=<UCU(CS(U))><SU><SU>, Unf=OtherCon []]
+[GblId, Arity=3, Str=<LCL(C1(L))><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=<UP(U)>, Unf=OtherCon []]
+[GblId, Arity=1, Str=<LP(L)>, 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=<UP(U)>,
+ Str=<LP(L)>,
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=<SU><U>, Unf=OtherCon []]
+[GblId, Arity=2, Str=<1L><L>, 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=<SU><SP(U)>,
+ 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=<SP(U)>,
+ 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}]
diff --git a/testsuite/tests/deSugar/should_compile/T2431.stderr b/testsuite/tests/deSugar/should_compile/T2431.stderr
index 6e7df6c5de..69f40310b4 100644
--- a/testsuite/tests/deSugar/should_compile/T2431.stderr
+++ b/testsuite/tests/deSugar/should_compile/T2431.stderr
@@ -17,7 +17,7 @@ T2431.$WRefl
-- RHS size: {terms: 4, types: 7, coercions: 0, joins: 0/0}
absurd :: forall a. (Int :~: Bool) -> a
-[GblId, Arity=1, Str=<U>b, Cpr=b, Unf=OtherCon []]
+[GblId, Arity=1, Str=<L>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/T14465.stdout b/testsuite/tests/numeric/should_compile/T14465.stdout
index b493cee119..970ceb4fd2 100644
--- a/testsuite/tests/numeric/should_compile/T14465.stdout
+++ b/testsuite/tests/numeric/should_compile/T14465.stdout
@@ -74,7 +74,7 @@ twoTimesTwo = 4
plusOne :: Natural -> Natural
[GblId,
Arity=1,
- Str=<SU>,
+ 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)
diff --git a/testsuite/tests/numeric/should_compile/T7116.stdout b/testsuite/tests/numeric/should_compile/T7116.stdout
index 996d391b44..bf15e69b3f 100644
--- a/testsuite/tests/numeric/should_compile/T7116.stdout
+++ b/testsuite/tests/numeric/should_compile/T7116.stdout
@@ -43,7 +43,7 @@ T7116.$trModule
dr :: Double -> Double
[GblId,
Arity=1,
- Str=<SP(U)>,
+ Str=<1P(L)>,
Cpr=m1,
Unf=Unf{Src=InlineStable, TopLvl=True, Value=True, ConLike=True,
WorkFree=True, Expandable=True,
@@ -60,7 +60,7 @@ dr
dl :: Double -> Double
[GblId,
Arity=1,
- Str=<SP(U)>,
+ Str=<1P(L)>,
Cpr=m1,
Unf=Unf{Src=InlineStable, TopLvl=True, Value=True, ConLike=True,
WorkFree=True, Expandable=True,
@@ -73,7 +73,7 @@ dl = dr
fr :: Float -> Float
[GblId,
Arity=1,
- Str=<SP(U)>,
+ Str=<1P(L)>,
Cpr=m1,
Unf=Unf{Src=InlineStable, TopLvl=True, Value=True, ConLike=True,
WorkFree=True, Expandable=True,
@@ -92,7 +92,7 @@ fr
fl :: Float -> Float
[GblId,
Arity=1,
- Str=<SP(U)>,
+ Str=<1P(L)>,
Cpr=m1,
Unf=Unf{Src=InlineStable, TopLvl=True, Value=True, ConLike=True,
WorkFree=True, Expandable=True,
diff --git a/testsuite/tests/simplCore/should_compile/EvalTest.stdout b/testsuite/tests/simplCore/should_compile/EvalTest.stdout
index fa65324317..db916bd575 100644
--- a/testsuite/tests/simplCore/should_compile/EvalTest.stdout
+++ b/testsuite/tests/simplCore/should_compile/EvalTest.stdout
@@ -1 +1 @@
-rght [Dmd=MU] :: AList a
+rght [Dmd=SL] :: AList a
diff --git a/testsuite/tests/simplCore/should_compile/T13143.stderr b/testsuite/tests/simplCore/should_compile/T13143.stderr
index c2bc42a872..ec423d7b4a 100644
--- a/testsuite/tests/simplCore/should_compile/T13143.stderr
+++ b/testsuite/tests/simplCore/should_compile/T13143.stderr
@@ -68,7 +68,7 @@ Rec {
-- RHS size: {terms: 28, types: 7, coercions: 0, joins: 0/0}
T13143.$wg [InlPrag=[2], Occ=LoopBreaker]
:: Bool -> Bool -> GHC.Prim.Int# -> GHC.Prim.Int#
-[GblId, Arity=3, Str=<SU><SU><U>, Unf=OtherCon []]
+[GblId, Arity=3, Str=<1L><1L><L>, Unf=OtherCon []]
T13143.$wg
= \ (w :: Bool) (w1 :: Bool) (ww :: GHC.Prim.Int#) ->
case w of {
@@ -89,7 +89,7 @@ end Rec }
g [InlPrag=[2]] :: Bool -> Bool -> Int -> Int
[GblId,
Arity=3,
- Str=<SU><SU><SP(U)>,
+ Str=<1L><1L><1P(L)>,
Cpr=m1,
Unf=Unf{Src=InlineStable, TopLvl=True, Value=True, ConLike=True,
WorkFree=True, Expandable=True,
diff --git a/testsuite/tests/simplCore/should_compile/T13543.stderr b/testsuite/tests/simplCore/should_compile/T13543.stderr
index ce5b23ff4a..32e34ea559 100644
--- a/testsuite/tests/simplCore/should_compile/T13543.stderr
+++ b/testsuite/tests/simplCore/should_compile/T13543.stderr
@@ -1,8 +1,8 @@
==================== Strictness signatures ====================
Foo.$trModule:
-Foo.f: <SP(SU)><SP(U)><SP(U)>
-Foo.g: <SP(SP(U),SP(U))>
+Foo.f: <1P(1L)><1P(L)><1P(L)>
+Foo.g: <1P(1P(L),1P(L))>
@@ -15,7 +15,7 @@ Foo.g: m1
==================== Strictness signatures ====================
Foo.$trModule:
-Foo.f: <SP(SU)><SP(U)><SP(U)>
-Foo.g: <SP(SP(U),SP(U))>
+Foo.f: <1P(1L)><1P(L)><1P(L)>
+Foo.g: <1P(1P(L),1P(L))>
diff --git a/testsuite/tests/simplCore/should_compile/T18013.stderr b/testsuite/tests/simplCore/should_compile/T18013.stderr
index a0d90899e1..8b1b57e6bd 100644
--- a/testsuite/tests/simplCore/should_compile/T18013.stderr
+++ b/testsuite/tests/simplCore/should_compile/T18013.stderr
@@ -136,7 +136,7 @@ mapMaybeRule [InlPrag=[2]]
:: forall a b. Rule IO a b -> Rule IO (Maybe a) (Maybe b)
[GblId,
Arity=1,
- Str=<SP(U,UCU(CS(CS(P(U,SP(U,U))))))>,
+ Str=<1P(L,LCL(C1(C1(P(L,1P(L,L))))))>,
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/T3717.stderr b/testsuite/tests/simplCore/should_compile/T3717.stderr
index f428cfc1fa..69b1766a84 100644
--- a/testsuite/tests/simplCore/should_compile/T3717.stderr
+++ b/testsuite/tests/simplCore/should_compile/T3717.stderr
@@ -43,7 +43,7 @@ Rec {
-- RHS size: {terms: 10, types: 2, coercions: 0, joins: 0/0}
T3717.$wfoo [InlPrag=[2], Occ=LoopBreaker]
:: GHC.Prim.Int# -> GHC.Prim.Int#
-[GblId, Arity=1, Str=<SU>, Unf=OtherCon []]
+[GblId, Arity=1, Str=<1L>, Unf=OtherCon []]
T3717.$wfoo
= \ (ww :: GHC.Prim.Int#) ->
case ww of ds {
@@ -56,7 +56,7 @@ end Rec }
foo [InlPrag=[2]] :: Int -> Int
[GblId,
Arity=1,
- Str=<SP(SU)>,
+ Str=<1P(1L)>,
Cpr=m1,
Unf=Unf{Src=InlineStable, TopLvl=True, Value=True, ConLike=True,
WorkFree=True, Expandable=True,
diff --git a/testsuite/tests/simplCore/should_compile/T3772.stdout b/testsuite/tests/simplCore/should_compile/T3772.stdout
index 34947f5392..b37882484c 100644
--- a/testsuite/tests/simplCore/should_compile/T3772.stdout
+++ b/testsuite/tests/simplCore/should_compile/T3772.stdout
@@ -42,7 +42,7 @@ T3772.$trModule
Rec {
-- RHS size: {terms: 10, types: 2, coercions: 0, joins: 0/0}
$wxs :: GHC.Prim.Int# -> ()
-[GblId, Arity=1, Str=<SU>, Unf=OtherCon []]
+[GblId, Arity=1, Str=<1L>, Unf=OtherCon []]
$wxs
= \ (ww :: GHC.Prim.Int#) ->
case ww of ds1 {
@@ -53,7 +53,7 @@ end Rec }
-- RHS size: {terms: 10, types: 2, coercions: 0, joins: 0/0}
T3772.$wfoo [InlPrag=NOINLINE] :: GHC.Prim.Int# -> ()
-[GblId, Arity=1, Str=<U>, Unf=OtherCon []]
+[GblId, Arity=1, Str=<L>, Unf=OtherCon []]
T3772.$wfoo
= \ (ww :: GHC.Prim.Int#) ->
case GHC.Prim.<# 0# ww of {
@@ -65,7 +65,7 @@ T3772.$wfoo
foo [InlPrag=[final]] :: Int -> ()
[GblId,
Arity=1,
- Str=<SP(U)>,
+ Str=<1P(L)>,
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/T4201.stdout b/testsuite/tests/simplCore/should_compile/T4201.stdout
index c8b6acb12a..ef54a0da7c 100644
--- a/testsuite/tests/simplCore/should_compile/T4201.stdout
+++ b/testsuite/tests/simplCore/should_compile/T4201.stdout
@@ -1,4 +1,4 @@
[HasNoCafRefs, LambdaFormInfo: LFReEntrant 1, Arity: 1,
- Strictness: <SU>,
+ Strictness: <1L>,
Unfolding: InlineRule (0, True, True)
bof `cast` (Sym (N:Foo[0]) %<'Many>_N ->_R <T>_R)]
diff --git a/testsuite/tests/simplCore/should_compile/T4908.stderr b/testsuite/tests/simplCore/should_compile/T4908.stderr
index 5db6bc8506..f005d660c8 100644
--- a/testsuite/tests/simplCore/should_compile/T4908.stderr
+++ b/testsuite/tests/simplCore/should_compile/T4908.stderr
@@ -42,7 +42,7 @@ T4908.$trModule
Rec {
-- RHS size: {terms: 19, types: 5, coercions: 0, joins: 0/0}
T4908.f_$s$wf [Occ=LoopBreaker] :: Int -> Int# -> Int# -> Bool
-[GblId, Arity=3, Str=<A><1U><SU>, Unf=OtherCon []]
+[GblId, Arity=3, Str=<A><ML><1L>, Unf=OtherCon []]
T4908.f_$s$wf
= \ (sc :: Int) (sc1 :: Int#) (sc2 :: Int#) ->
case sc2 of ds {
@@ -59,7 +59,7 @@ end Rec }
T4908.$wf [InlPrag=[2]] :: Int# -> (Int, Int) -> Bool
[GblId,
Arity=2,
- Str=<SU><1P(A,1P(1U))>,
+ Str=<1L><MP(A,MP(ML))>,
Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
WorkFree=True, Expandable=True, Guidance=IF_ARGS [30 20] 101 20}]
T4908.$wf
@@ -81,7 +81,7 @@ T4908.$wf
f [InlPrag=[2]] :: Int -> (Int, Int) -> Bool
[GblId,
Arity=2,
- Str=<SP(SU)><1P(A,1P(1U))>,
+ Str=<1P(1L)><MP(A,MP(ML))>,
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)
diff --git a/testsuite/tests/simplCore/should_compile/T4930.stderr b/testsuite/tests/simplCore/should_compile/T4930.stderr
index d0319763fa..04e065f51c 100644
--- a/testsuite/tests/simplCore/should_compile/T4930.stderr
+++ b/testsuite/tests/simplCore/should_compile/T4930.stderr
@@ -43,7 +43,7 @@ Rec {
-- RHS size: {terms: 17, types: 3, coercions: 0, joins: 0/0}
T4930.$wfoo [InlPrag=[2], Occ=LoopBreaker]
:: GHC.Prim.Int# -> GHC.Prim.Int#
-[GblId, Arity=1, Str=<U>, Unf=OtherCon []]
+[GblId, Arity=1, Str=<L>, Unf=OtherCon []]
T4930.$wfoo
= \ (ww :: GHC.Prim.Int#) ->
case GHC.Prim.<# ww 5# of {
@@ -56,7 +56,7 @@ end Rec }
foo [InlPrag=[2]] :: Int -> Int
[GblId,
Arity=1,
- Str=<SP(U)>,
+ Str=<1P(L)>,
Cpr=m1,
Unf=Unf{Src=InlineStable, TopLvl=True, Value=True, ConLike=True,
WorkFree=True, Expandable=True,
diff --git a/testsuite/tests/simplCore/should_compile/T7360.stderr b/testsuite/tests/simplCore/should_compile/T7360.stderr
index 21fe15d4f5..0b45e8a390 100644
--- a/testsuite/tests/simplCore/should_compile/T7360.stderr
+++ b/testsuite/tests/simplCore/should_compile/T7360.stderr
@@ -8,7 +8,7 @@ T7360.$WFoo3 [InlPrag=INLINE[final] CONLIKE] :: Int %1 -> Foo
[GblId[DataConWrapper],
Arity=1,
Caf=NoCafRefs,
- Str=<MU>,
+ Str=<SL>,
Cpr=m3,
Unf=Unf{Src=InlineStable, TopLvl=True, Value=True, ConLike=True,
WorkFree=True, Expandable=True,
@@ -21,7 +21,7 @@ T7360.$WFoo3
-- RHS size: {terms: 5, types: 2, coercions: 0, joins: 0/0}
fun1 [InlPrag=NOINLINE] :: Foo -> ()
-[GblId, Arity=1, Str=<SA>, Unf=OtherCon []]
+[GblId, Arity=1, Str=<1A>, Unf=OtherCon []]
fun1 = \ (x :: Foo) -> case x of { __DEFAULT -> GHC.Tuple.() }
-- RHS size: {terms: 2, types: 0, coercions: 0, joins: 0/0}
@@ -35,7 +35,7 @@ T7360.fun4 = fun1 T7360.Foo1
fun2 :: forall {a}. [a] -> ((), Int)
[GblId,
Arity=1,
- Str=<1U>,
+ Str=<ML>,
Cpr=m1,
Unf=Unf{Src=InlineStable, TopLvl=True, Value=True, ConLike=True,
WorkFree=True, Expandable=True,
diff --git a/testsuite/tests/simplCore/should_compile/par01.stderr b/testsuite/tests/simplCore/should_compile/par01.stderr
index 91213ee1dc..d70331f4a9 100644
--- a/testsuite/tests/simplCore/should_compile/par01.stderr
+++ b/testsuite/tests/simplCore/should_compile/par01.stderr
@@ -6,7 +6,7 @@ Result size of CorePrep
Rec {
-- RHS size: {terms: 7, types: 3, coercions: 0, joins: 0/0}
Par01.depth [Occ=LoopBreaker] :: GHC.Types.Int -> GHC.Types.Int
-[GblId, Arity=1, Str=<U>, Unf=OtherCon []]
+[GblId, Arity=1, Str=<L>, Unf=OtherCon []]
Par01.depth
= \ (d :: GHC.Types.Int) ->
case GHC.Prim.par# @GHC.Types.Int d of { __DEFAULT ->
diff --git a/testsuite/tests/simplCore/should_compile/spec-inline.stderr b/testsuite/tests/simplCore/should_compile/spec-inline.stderr
index 87e8bd7980..a9da295e8b 100644
--- a/testsuite/tests/simplCore/should_compile/spec-inline.stderr
+++ b/testsuite/tests/simplCore/should_compile/spec-inline.stderr
@@ -54,7 +54,7 @@ Rec {
-- RHS size: {terms: 40, types: 5, coercions: 0, joins: 0/0}
Roman.foo_$s$wgo [Occ=LoopBreaker]
:: GHC.Prim.Int# -> GHC.Prim.Int# -> GHC.Prim.Int#
-[GblId, Arity=2, Str=<A><U>, Unf=OtherCon []]
+[GblId, Arity=2, Str=<A><L>, Unf=OtherCon []]
Roman.foo_$s$wgo
= \ (sc :: GHC.Prim.Int#) (sc1 :: GHC.Prim.Int#) ->
case GHC.Prim.<=# sc1 0# of {
@@ -76,7 +76,7 @@ end Rec }
Roman.$wgo [InlPrag=[2]] :: Maybe Int -> Maybe Int -> GHC.Prim.Int#
[GblId,
Arity=2,
- Str=<SU><SU>,
+ Str=<1L><1L>,
Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
WorkFree=True, Expandable=True, Guidance=IF_ARGS [61 30] 249 0}]
Roman.$wgo
@@ -111,7 +111,7 @@ Roman.$wgo
Roman.foo_go [InlPrag=[2]] :: Maybe Int -> Maybe Int -> Int
[GblId,
Arity=2,
- Str=<SU><SU>,
+ Str=<1L><1L>,
Cpr=m1,
Unf=Unf{Src=InlineStable, TopLvl=True, Value=True, ConLike=True,
WorkFree=True, Expandable=True,
@@ -143,7 +143,7 @@ Roman.foo1 = GHC.Maybe.Just @Int Roman.foo2
foo :: Int -> Int
[GblId,
Arity=1,
- Str=<SP(U)>,
+ Str=<1P(L)>,
Cpr=m1,
Unf=Unf{Src=InlineStable, TopLvl=True, Value=True, ConLike=True,
WorkFree=True, Expandable=True,
diff --git a/testsuite/tests/stranal/should_compile/T10694.stderr b/testsuite/tests/stranal/should_compile/T10694.stderr
index 45060226c1..29b6e9e816 100644
--- a/testsuite/tests/stranal/should_compile/T10694.stderr
+++ b/testsuite/tests/stranal/should_compile/T10694.stderr
@@ -4,7 +4,7 @@ Result size of Tidy Core = {terms: 74, types: 65, coercions: 0, joins: 0/4}
-- RHS size: {terms: 39, types: 25, coercions: 0, joins: 0/4}
T10694.$wpm [InlPrag=NOINLINE] :: Int -> Int -> (# Int, Int #)
-[GblId, Arity=2, Str=<UP(U)><UP(U)>, Unf=OtherCon []]
+[GblId, Arity=2, Str=<LP(L)><LP(L)>, Unf=OtherCon []]
T10694.$wpm
= \ (w :: Int) (w1 :: Int) ->
let {
@@ -29,7 +29,7 @@ T10694.$wpm
pm [InlPrag=[final]] :: Int -> Int -> (Int, Int)
[GblId,
Arity=2,
- Str=<UP(U)><UP(U)>,
+ Str=<LP(L)><LP(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)
@@ -41,7 +41,7 @@ pm = \ (w :: Int) (w1 :: Int) -> case T10694.$wpm w w1 of { (# ww1, ww2 #) -> (w
m :: Int -> Int -> Int
[GblId,
Arity=2,
- Str=<UP(U)><UP(U)>,
+ Str=<LP(L)><LP(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= \ (x [Occ=Once1] :: Int) (y [Occ=Once1] :: Int) -> case pm x y of { (_ [Occ=Dead], mr [Occ=Once1]) -> mr }}]
diff --git a/testsuite/tests/stranal/should_compile/T13031.stdout b/testsuite/tests/stranal/should_compile/T13031.stdout
index 0b40ec8eeb..748452f733 100644
--- a/testsuite/tests/stranal/should_compile/T13031.stdout
+++ b/testsuite/tests/stranal/should_compile/T13031.stdout
@@ -1,2 +1,2 @@
hello
-[GblId, Arity=3, Str=<U><U><U>b, Cpr=b, Unf=OtherCon []]
+[GblId, Arity=3, Str=<L><L><L>b, Cpr=b, Unf=OtherCon []]
diff --git a/testsuite/tests/stranal/should_compile/T18894.stderr b/testsuite/tests/stranal/should_compile/T18894.stderr
index ee2df2f667..cb5b344d4e 100644
--- a/testsuite/tests/stranal/should_compile/T18894.stderr
+++ b/testsuite/tests/stranal/should_compile/T18894.stderr
@@ -1,7 +1,7 @@
==================== Demand analysis ====================
Result size of Demand analysis
- = {terms: 177, types: 97, coercions: 0, joins: 0/0}
+ = {terms: 177, types: 95, coercions: 0, joins: 0/0}
-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
$trModule :: GHC.Prim.Addr#
@@ -45,18 +45,18 @@ lvl :: Int
WorkFree=True, Expandable=True, Guidance=IF_ARGS [] 10 10}]
lvl = GHC.Types.I# 0#
--- RHS size: {terms: 36, types: 16, coercions: 0, joins: 0/0}
-g2 [InlPrag=NOINLINE, Dmd=UCU(CS(P(1P(U),SP(U))))]
+-- RHS size: {terms: 36, types: 15, coercions: 0, joins: 0/0}
+g2 [InlPrag=NOINLINE, Dmd=LCL(C1(P(MP(L),1P(L))))]
:: Int -> Int -> (Int, Int)
[LclId,
Arity=2,
- Str=<UP(U)><SP(SU)>,
+ Str=<LP(L)><1P(1L)>,
Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
WorkFree=True, Expandable=True, Guidance=IF_ARGS [20 20] 161 20}]
g2
- = \ (m [Dmd=UP(U)] :: Int) (ds [Dmd=SP(SU)] :: Int) ->
- case ds of { GHC.Types.I# ds [Dmd=SU] ->
- case ds of ds [Dmd=1U] {
+ = \ (m [Dmd=LP(L)] :: Int) (ds [Dmd=1P(1L)] :: Int) ->
+ case ds of { GHC.Types.I# ds [Dmd=1L] ->
+ case ds of ds [Dmd=ML] {
__DEFAULT ->
(case m of { GHC.Types.I# y -> GHC.Types.I# (GHC.Prim.*# 2# y) },
case ds of wild {
@@ -96,19 +96,19 @@ lvl = GHC.Types.I# 0#
h2 :: Int -> Int
[LclIdX,
Arity=1,
- Str=<SP(MU)>,
+ Str=<1P(SL)>,
Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
WorkFree=True, Expandable=True, Guidance=IF_ARGS [20] 162 10}]
h2
- = \ (ds [Dmd=SP(MU)] :: Int) ->
- case ds of wild [Dmd=UP(U)] { GHC.Types.I# ds [Dmd=MU] ->
+ = \ (ds [Dmd=1P(SL)] :: Int) ->
+ case ds of wild [Dmd=LP(L)] { GHC.Types.I# ds [Dmd=SL] ->
case ds of ds {
__DEFAULT ->
case GHC.Prim.remInt# ds 2# of {
__DEFAULT ->
- case g2 wild lvl of { (ds1 [Dmd=A], y [Dmd=SU]) -> y };
+ case g2 wild lvl of { (ds1 [Dmd=A], y [Dmd=1L]) -> y };
0# ->
- case g2 lvl wild of { (x [Dmd=SP(U)], ds [Dmd=SP(U)]) ->
+ case g2 lvl wild of { (x [Dmd=1P(L)], ds [Dmd=1P(L)]) ->
case x of { GHC.Types.I# x ->
case ds of { GHC.Types.I# y -> GHC.Types.I# (GHC.Prim.+# x y) }
}
@@ -139,16 +139,16 @@ lvl :: (Int, Int)
WorkFree=True, Expandable=True, Guidance=IF_ARGS [] 10 10}]
lvl = (lvl, lvl)
--- RHS size: {terms: 30, types: 11, coercions: 0, joins: 0/0}
-g1 [InlPrag=NOINLINE, Dmd=UCU(P(UP(U),UP(U)))] :: Int -> (Int, Int)
+-- RHS size: {terms: 30, types: 10, coercions: 0, joins: 0/0}
+g1 [InlPrag=NOINLINE, Dmd=LCL(P(LP(L),LP(L)))] :: Int -> (Int, Int)
[LclId,
Arity=1,
- Str=<SP(SU)>,
+ Str=<1P(1L)>,
Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
WorkFree=True, Expandable=True, Guidance=IF_ARGS [20] 141 10}]
g1
- = \ (ds [Dmd=SP(SU)] :: Int) ->
- case ds of { GHC.Types.I# ds [Dmd=SU] ->
+ = \ (ds [Dmd=1P(1L)] :: Int) ->
+ case ds of { GHC.Types.I# ds [Dmd=1L] ->
case ds of ds {
__DEFAULT ->
(GHC.Types.I# (GHC.Prim.*# 2# ds),
@@ -182,21 +182,21 @@ lvl = g1 (GHC.Types.I# 2#)
h1 :: Int -> Int
[LclIdX,
Arity=1,
- Str=<SP(MU)>,
+ Str=<1P(SL)>,
Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
WorkFree=True, Expandable=True, Guidance=IF_ARGS [20] 111 10}]
h1
- = \ (ds [Dmd=SP(MU)] :: Int) ->
- case ds of wild [Dmd=1P(1U)] { GHC.Types.I# ds [Dmd=MU] ->
+ = \ (ds [Dmd=1P(SL)] :: Int) ->
+ case ds of wild [Dmd=MP(ML)] { GHC.Types.I# ds [Dmd=SL] ->
case ds of {
__DEFAULT ->
- case g1 wild of { (x [Dmd=SP(U)], ds [Dmd=SP(U)]) ->
+ case g1 wild of { (x [Dmd=1P(L)], ds [Dmd=1P(L)]) ->
case x of { GHC.Types.I# x ->
case ds of { GHC.Types.I# y -> GHC.Types.I# (GHC.Prim.+# x y) }
}
};
1# -> lvl;
- 2# -> case lvl of { (ds1 [Dmd=A], y [Dmd=SU]) -> y }
+ 2# -> case lvl of { (ds1 [Dmd=A], y [Dmd=1L]) -> y }
}
}
@@ -205,7 +205,7 @@ h1
==================== Demand analysis ====================
Result size of Demand analysis
- = {terms: 171, types: 120, coercions: 0, joins: 0/0}
+ = {terms: 171, types: 118, coercions: 0, joins: 0/0}
-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
$trModule :: GHC.Prim.Addr#
@@ -256,16 +256,16 @@ lvl :: Int
WorkFree=True, Expandable=True, Guidance=IF_ARGS [] 10 10}]
lvl = GHC.Types.I# -2#
--- RHS size: {terms: 32, types: 18, coercions: 0, joins: 0/0}
-$wg2 [InlPrag=NOINLINE, Dmd=UCU(CS(P(1P(U),SP(U))))]
+-- RHS size: {terms: 32, types: 17, coercions: 0, joins: 0/0}
+$wg2 [InlPrag=NOINLINE, Dmd=LCL(C1(P(MP(L),1P(L))))]
:: Int -> GHC.Prim.Int# -> (# Int, Int #)
[LclId,
Arity=2,
- Str=<UP(U)><SU>,
+ Str=<LP(L)><1L>,
Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
WorkFree=True, Expandable=True, Guidance=IF_ARGS [20 30] 121 20}]
$wg2
- = \ (w [Dmd=UP(U)] :: Int) (ww [Dmd=SU] :: GHC.Prim.Int#) ->
+ = \ (w [Dmd=LP(L)] :: Int) (ww [Dmd=1L] :: GHC.Prim.Int#) ->
case ww of ds {
__DEFAULT ->
(# case w of { GHC.Types.I# y -> GHC.Types.I# (GHC.Prim.*# 2# y) },
@@ -291,21 +291,21 @@ lvl = GHC.Types.I# 2#
$wh2 [InlPrag=[2]] :: GHC.Prim.Int# -> Int
[LclId,
Arity=1,
- Str=<SU>,
+ Str=<1L>,
Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
WorkFree=True, Expandable=True, Guidance=IF_ARGS [30] 162 10}]
$wh2
- = \ (ww [Dmd=SU] :: GHC.Prim.Int#) ->
+ = \ (ww [Dmd=1L] :: GHC.Prim.Int#) ->
case ww of ds {
__DEFAULT ->
case GHC.Prim.remInt# ds 2# of {
__DEFAULT ->
case $wg2 (GHC.Types.I# ds) 2# of
- { (# ww [Dmd=A], ww [Dmd=SU] #) ->
+ { (# ww [Dmd=A], ww [Dmd=1L] #) ->
ww
};
0# ->
- case $wg2 lvl ds of { (# ww [Dmd=SP(U)], ww [Dmd=SP(U)] #) ->
+ case $wg2 lvl ds of { (# ww [Dmd=1P(L)], ww [Dmd=1P(L)] #) ->
case ww of { GHC.Types.I# x ->
case ww of { GHC.Types.I# y -> GHC.Types.I# (GHC.Prim.+# x y) }
}
@@ -318,15 +318,15 @@ $wh2
h2 [InlPrag=[2]] :: Int -> Int
[LclIdX,
Arity=1,
- Str=<SP(SU)>,
+ Str=<1P(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= \ (w [Occ=Once1!] :: Int) ->
- case w of { GHC.Types.I# ww [Occ=Once1, Dmd=MU] -> $wh2 ww }}]
+ Tmpl= \ (w [Occ=Once1!, Dmd=1P(SL)] :: Int) ->
+ case w of { GHC.Types.I# ww [Occ=Once1, Dmd=SL] -> $wh2 ww }}]
h2
- = \ (w [Dmd=SP(SU)] :: Int) ->
- case w of { GHC.Types.I# ww [Dmd=SU] -> $wh2 ww }
+ = \ (w [Dmd=1P(1L)] :: Int) ->
+ case w of { GHC.Types.I# ww [Dmd=1L] -> $wh2 ww }
-- RHS size: {terms: 2, types: 0, coercions: 0, joins: 0/0}
lvl :: Int
@@ -335,16 +335,16 @@ lvl :: Int
WorkFree=True, Expandable=True, Guidance=IF_ARGS [] 10 10}]
lvl = GHC.Types.I# 15#
--- RHS size: {terms: 28, types: 15, coercions: 0, joins: 0/0}
-$wg1 [InlPrag=NOINLINE, Dmd=UCU(P(UP(U),UP(U)))]
+-- RHS size: {terms: 28, types: 14, coercions: 0, joins: 0/0}
+$wg1 [InlPrag=NOINLINE, Dmd=LCL(P(LP(L),LP(L)))]
:: GHC.Prim.Int# -> (# Int, Int #)
[LclId,
Arity=1,
- Str=<SU>,
+ Str=<1L>,
Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
WorkFree=True, Expandable=True, Guidance=IF_ARGS [30] 111 20}]
$wg1
- = \ (ww [Dmd=SU] :: GHC.Prim.Int#) ->
+ = \ (ww [Dmd=1L] :: GHC.Prim.Int#) ->
case ww of ds {
__DEFAULT ->
(# GHC.Types.I# (GHC.Prim.*# 2# ds),
@@ -370,35 +370,35 @@ lvl = case $wg1 2# of { (# ww, ww #) -> (ww, ww) }
$wh1 [InlPrag=[2]] :: GHC.Prim.Int# -> Int
[LclId,
Arity=1,
- Str=<SU>,
+ Str=<1L>,
Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
WorkFree=True, Expandable=True, Guidance=IF_ARGS [50] 101 10}]
$wh1
- = \ (ww [Dmd=SU] :: GHC.Prim.Int#) ->
- case ww of ds [Dmd=1U] {
+ = \ (ww [Dmd=1L] :: GHC.Prim.Int#) ->
+ case ww of ds [Dmd=ML] {
__DEFAULT ->
- case $wg1 ds of { (# ww [Dmd=SP(U)], ww [Dmd=SP(U)] #) ->
+ case $wg1 ds of { (# ww [Dmd=1P(L)], ww [Dmd=1P(L)] #) ->
case ww of { GHC.Types.I# x ->
case ww of { GHC.Types.I# y -> GHC.Types.I# (GHC.Prim.+# x y) }
}
};
1# -> lvl;
- 2# -> case lvl of { (ds1 [Dmd=A], y [Dmd=SU]) -> y }
+ 2# -> case lvl of { (ds1 [Dmd=A], y [Dmd=1L]) -> y }
}
-- RHS size: {terms: 6, types: 3, coercions: 0, joins: 0/0}
h1 [InlPrag=[2]] :: Int -> Int
[LclIdX,
Arity=1,
- Str=<SP(SU)>,
+ Str=<1P(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= \ (w [Occ=Once1!] :: Int) ->
- case w of { GHC.Types.I# ww [Occ=Once1, Dmd=MU] -> $wh1 ww }}]
+ Tmpl= \ (w [Occ=Once1!, Dmd=1P(SL)] :: Int) ->
+ case w of { GHC.Types.I# ww [Occ=Once1, Dmd=SL] -> $wh1 ww }}]
h1
- = \ (w [Dmd=SP(SU)] :: Int) ->
- case w of { GHC.Types.I# ww [Dmd=SU] -> $wh1 ww }
+ = \ (w [Dmd=1P(1L)] :: Int) ->
+ case w of { GHC.Types.I# ww [Dmd=1L] -> $wh1 ww }
diff --git a/testsuite/tests/stranal/should_compile/T18903.stderr b/testsuite/tests/stranal/should_compile/T18903.stderr
index 4adbdd566c..c909bd0e0e 100644
--- a/testsuite/tests/stranal/should_compile/T18903.stderr
+++ b/testsuite/tests/stranal/should_compile/T18903.stderr
@@ -1,7 +1,7 @@
==================== Tidy Core ====================
Result size of Tidy Core
- = {terms: 84, types: 55, coercions: 0, joins: 0/1}
+ = {terms: 84, types: 54, coercions: 0, joins: 0/1}
-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
T18903.$trModule4 :: GHC.Prim.Addr#
@@ -53,19 +53,19 @@ T18903.h2 :: Int
WorkFree=True, Expandable=True, Guidance=IF_ARGS [] 10 10}]
T18903.h2 = GHC.Types.I# -2#
--- RHS size: {terms: 56, types: 41, coercions: 0, joins: 0/1}
+-- RHS size: {terms: 56, types: 40, coercions: 0, joins: 0/1}
T18903.$wh [InlPrag=[2]] :: GHC.Prim.Int# -> Int
[GblId,
Arity=1,
- Str=<MU>,
+ Str=<SL>,
Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
WorkFree=True, Expandable=True, Guidance=IF_ARGS [70] 262 10}]
T18903.$wh
= \ (ww :: GHC.Prim.Int#) ->
let {
- $wg [InlPrag=NOINLINE, Dmd=1C1(P(1P(U),SP(U)))]
+ $wg [InlPrag=NOINLINE, Dmd=MCM(P(MP(L),1P(L)))]
:: GHC.Prim.Int# -> (# Int, Int #)
- [LclId, Arity=1, Str=<SU>, Unf=OtherCon []]
+ [LclId, Arity=1, Str=<1L>, Unf=OtherCon []]
$wg
= \ (ww1 [OS=OneShot] :: GHC.Prim.Int#) ->
case ww1 of ds {
@@ -96,7 +96,7 @@ T18903.$wh
h [InlPrag=[2]] :: Int -> Int
[GblId,
Arity=1,
- Str=<SP(MU)>,
+ Str=<1P(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)
diff --git a/testsuite/tests/stranal/sigs/BottomFromInnerLambda.hs b/testsuite/tests/stranal/sigs/BottomFromInnerLambda.hs
index 8d3b77f832..b7453934f4 100644
--- a/testsuite/tests/stranal/sigs/BottomFromInnerLambda.hs
+++ b/testsuite/tests/stranal/sigs/BottomFromInnerLambda.hs
@@ -5,8 +5,8 @@ expensive 0 = 0
expensive n = expensive n
{-# NOINLINE expensive #-}
--- We could be saying "<S(S),1*(U(U))><L,A>b"
--- but we are saying "<S(S),1*(U(U))>"
--- We should not be saying "<S(S),1*(U(U))>b"
+-- We could be saying "<1P(1)><A>b"
+-- but we are saying "<1P(1)>"
+-- We should not be saying "<1P(1)>b"
f :: Int -> Int -> Int
f x = expensive x `seq` (\y -> error (show y))
diff --git a/testsuite/tests/stranal/sigs/BottomFromInnerLambda.stderr b/testsuite/tests/stranal/sigs/BottomFromInnerLambda.stderr
index a2dade38df..7b954564a7 100644
--- a/testsuite/tests/stranal/sigs/BottomFromInnerLambda.stderr
+++ b/testsuite/tests/stranal/sigs/BottomFromInnerLambda.stderr
@@ -1,8 +1,8 @@
==================== Strictness signatures ====================
BottomFromInnerLambda.$trModule:
-BottomFromInnerLambda.expensive: <SP(MU)>
-BottomFromInnerLambda.f: <SP(MU)>
+BottomFromInnerLambda.expensive: <1P(SL)>
+BottomFromInnerLambda.f: <1P(SL)>
@@ -15,7 +15,7 @@ BottomFromInnerLambda.f:
==================== Strictness signatures ====================
BottomFromInnerLambda.$trModule:
-BottomFromInnerLambda.expensive: <SP(SU)>
-BottomFromInnerLambda.f: <SP(SU)>
+BottomFromInnerLambda.expensive: <1P(1L)>
+BottomFromInnerLambda.f: <1P(1L)>
diff --git a/testsuite/tests/stranal/sigs/DmdAnalGADTs.hs b/testsuite/tests/stranal/sigs/DmdAnalGADTs.hs
index 1a6d68a3b2..2bdd2a679e 100644
--- a/testsuite/tests/stranal/sigs/DmdAnalGADTs.hs
+++ b/testsuite/tests/stranal/sigs/DmdAnalGADTs.hs
@@ -19,7 +19,7 @@ diverges :: Int
diverges = diverges
-- The result should not have a CPR property
--- Because we are lub’ing "m" and "<S,U>m" in the case expression.
+-- Because we are lub’ing "m" and "<L>m" in the case expression.
f :: D x -> x
f x = case x of
A -> hasCPR
diff --git a/testsuite/tests/stranal/sigs/DmdAnalGADTs.stderr b/testsuite/tests/stranal/sigs/DmdAnalGADTs.stderr
index 41fae8f5ce..8f70d7d5e0 100644
--- a/testsuite/tests/stranal/sigs/DmdAnalGADTs.stderr
+++ b/testsuite/tests/stranal/sigs/DmdAnalGADTs.stderr
@@ -5,11 +5,11 @@ DmdAnalGADTs.$tc'B:
DmdAnalGADTs.$tcD:
DmdAnalGADTs.$trModule:
DmdAnalGADTs.diverges: b
-DmdAnalGADTs.f: <SU>
-DmdAnalGADTs.f': <SU>
-DmdAnalGADTs.g: <SU>
+DmdAnalGADTs.f: <1L>
+DmdAnalGADTs.f': <1L>
+DmdAnalGADTs.g: <1L>
DmdAnalGADTs.hasCPR:
-DmdAnalGADTs.hasStrSig: <SP(U)>
+DmdAnalGADTs.hasStrSig: <1P(L)>
@@ -33,10 +33,10 @@ DmdAnalGADTs.$tc'B:
DmdAnalGADTs.$tcD:
DmdAnalGADTs.$trModule:
DmdAnalGADTs.diverges: b
-DmdAnalGADTs.f: <SU>
-DmdAnalGADTs.f': <SU>
-DmdAnalGADTs.g: <SU>
+DmdAnalGADTs.f: <1L>
+DmdAnalGADTs.f': <1L>
+DmdAnalGADTs.g: <1L>
DmdAnalGADTs.hasCPR:
-DmdAnalGADTs.hasStrSig: <SP(U)>
+DmdAnalGADTs.hasStrSig: <1P(L)>
diff --git a/testsuite/tests/stranal/sigs/HyperStrUse.stderr b/testsuite/tests/stranal/sigs/HyperStrUse.stderr
index dc26e84381..e8a806e4ad 100644
--- a/testsuite/tests/stranal/sigs/HyperStrUse.stderr
+++ b/testsuite/tests/stranal/sigs/HyperStrUse.stderr
@@ -1,7 +1,7 @@
==================== Strictness signatures ====================
HyperStrUse.$trModule:
-HyperStrUse.f: <SP(SP(U),A)><SU>
+HyperStrUse.f: <1P(1P(L),A)><1L>
@@ -13,6 +13,6 @@ HyperStrUse.f: m1
==================== Strictness signatures ====================
HyperStrUse.$trModule:
-HyperStrUse.f: <SP(SP(U),A)><SU>
+HyperStrUse.f: <1P(1P(L),A)><1L>
diff --git a/testsuite/tests/stranal/sigs/NewtypeArity.stderr b/testsuite/tests/stranal/sigs/NewtypeArity.stderr
index ebbbbc0c30..5a73b53524 100644
--- a/testsuite/tests/stranal/sigs/NewtypeArity.stderr
+++ b/testsuite/tests/stranal/sigs/NewtypeArity.stderr
@@ -3,8 +3,8 @@
Test.$tc'MkT:
Test.$tcT:
Test.$trModule:
-Test.t: <SP(U)><SP(U)>
-Test.t2: <SP(U)><SP(U)>
+Test.t: <1P(L)><1P(L)>
+Test.t2: <1P(L)><1P(L)>
@@ -21,7 +21,7 @@ Test.t2: m1
Test.$tc'MkT:
Test.$tcT:
Test.$trModule:
-Test.t: <SP(U)><SP(U)>
-Test.t2: <SP(U)><SP(U)>
+Test.t: <1P(L)><1P(L)>
+Test.t2: <1P(L)><1P(L)>
diff --git a/testsuite/tests/stranal/sigs/StrAnalExample.stderr b/testsuite/tests/stranal/sigs/StrAnalExample.stderr
index e9ac8bab6a..80855b392e 100644
--- a/testsuite/tests/stranal/sigs/StrAnalExample.stderr
+++ b/testsuite/tests/stranal/sigs/StrAnalExample.stderr
@@ -1,7 +1,7 @@
==================== Strictness signatures ====================
StrAnalExample.$trModule:
-StrAnalExample.foo: <SU>
+StrAnalExample.foo: <1L>
@@ -13,6 +13,6 @@ StrAnalExample.foo:
==================== Strictness signatures ====================
StrAnalExample.$trModule:
-StrAnalExample.foo: <SU>
+StrAnalExample.foo: <1L>
diff --git a/testsuite/tests/stranal/sigs/T12370.stderr b/testsuite/tests/stranal/sigs/T12370.stderr
index 44a90106cf..d557b437b1 100644
--- a/testsuite/tests/stranal/sigs/T12370.stderr
+++ b/testsuite/tests/stranal/sigs/T12370.stderr
@@ -1,8 +1,8 @@
==================== Strictness signatures ====================
T12370.$trModule:
-T12370.bar: <SP(U)><SP(U)>
-T12370.foo: <SP(SP(U),SP(U))>
+T12370.bar: <1P(L)><1P(L)>
+T12370.foo: <1P(1P(L),1P(L))>
@@ -15,7 +15,7 @@ T12370.foo: m1
==================== Strictness signatures ====================
T12370.$trModule:
-T12370.bar: <SP(U)><SP(U)>
-T12370.foo: <SP(SP(U),SP(U))>
+T12370.bar: <1P(L)><1P(L)>
+T12370.foo: <1P(1P(L),1P(L))>
diff --git a/testsuite/tests/stranal/sigs/T13380f.stderr b/testsuite/tests/stranal/sigs/T13380f.stderr
index a856a1794b..e1b6597223 100644
--- a/testsuite/tests/stranal/sigs/T13380f.stderr
+++ b/testsuite/tests/stranal/sigs/T13380f.stderr
@@ -1,12 +1,12 @@
==================== Strictness signatures ====================
T13380f.$trModule:
-T13380f.f: <SP(U)><SP(U)><U>
-T13380f.g: <SP(U)><1P(U)><U>
-T13380f.h: <SP(U)><1P(U)><U>
-T13380f.interruptibleCall: <U>
-T13380f.safeCall: <U>
-T13380f.unsafeCall: <U>
+T13380f.f: <1P(L)><1P(L)><L>
+T13380f.g: <1P(L)><MP(L)><L>
+T13380f.h: <1P(L)><MP(L)><L>
+T13380f.interruptibleCall: <L>
+T13380f.safeCall: <L>
+T13380f.unsafeCall: <L>
@@ -23,11 +23,11 @@ T13380f.unsafeCall:
==================== Strictness signatures ====================
T13380f.$trModule:
-T13380f.f: <SP(U)><SP(U)><U>
-T13380f.g: <SP(U)><1P(U)><U>
-T13380f.h: <SP(U)><1P(U)><U>
-T13380f.interruptibleCall: <U>
-T13380f.safeCall: <U>
-T13380f.unsafeCall: <U>
+T13380f.f: <1P(L)><1P(L)><L>
+T13380f.g: <1P(L)><MP(L)><L>
+T13380f.h: <1P(L)><MP(L)><L>
+T13380f.interruptibleCall: <L>
+T13380f.safeCall: <L>
+T13380f.unsafeCall: <L>
diff --git a/testsuite/tests/stranal/sigs/T17932.stderr b/testsuite/tests/stranal/sigs/T17932.stderr
index 072af8d45e..0875f5844e 100644
--- a/testsuite/tests/stranal/sigs/T17932.stderr
+++ b/testsuite/tests/stranal/sigs/T17932.stderr
@@ -5,7 +5,7 @@ T17932.$tc'X:
T17932.$tcOptions:
T17932.$tcX:
T17932.$trModule:
-T17932.flags: <SP(SU,SU)>
+T17932.flags: <1P(1L,1L)>
@@ -25,6 +25,6 @@ T17932.$tc'X:
T17932.$tcOptions:
T17932.$tcX:
T17932.$trModule:
-T17932.flags: <SP(SU,SU)>
+T17932.flags: <1P(1L,1L)>
diff --git a/testsuite/tests/stranal/sigs/T18086.hs b/testsuite/tests/stranal/sigs/T18086.hs
index 9a6f67c6d1..9a23062f5a 100644
--- a/testsuite/tests/stranal/sigs/T18086.hs
+++ b/testsuite/tests/stranal/sigs/T18086.hs
@@ -6,7 +6,7 @@ import GHC.Utils.Panic.Plain
import Control.Exception
import System.IO.Unsafe
--- Should have strictness signature <L,U>x, emphasis on the exceptional
+-- Should have strictness signature <L>x, emphasis on the exceptional
-- divergence result.
m :: IO ()
m = do
diff --git a/testsuite/tests/stranal/sigs/T18086.stderr b/testsuite/tests/stranal/sigs/T18086.stderr
index 0ac4c846ee..43266ad0da 100644
--- a/testsuite/tests/stranal/sigs/T18086.stderr
+++ b/testsuite/tests/stranal/sigs/T18086.stderr
@@ -1,8 +1,8 @@
==================== Strictness signatures ====================
T18086.$trModule:
-T18086.m: <U>x
-T18086.panic: <U>x
+T18086.m: <L>x
+T18086.panic: <L>x
@@ -15,7 +15,7 @@ T18086.panic:
==================== Strictness signatures ====================
T18086.$trModule:
-T18086.m: <U>x
-T18086.panic: <U>x
+T18086.m: <L>x
+T18086.panic: <L>x
diff --git a/testsuite/tests/stranal/sigs/T18957.stderr b/testsuite/tests/stranal/sigs/T18957.stderr
index c536410e0a..2beea34dfb 100644
--- a/testsuite/tests/stranal/sigs/T18957.stderr
+++ b/testsuite/tests/stranal/sigs/T18957.stderr
@@ -1,11 +1,11 @@
==================== Strictness signatures ====================
T18957.$trModule:
-T18957.g: <1C1(U)><SP(U)>
-T18957.h1: <MC1(U)><SP(U)>
-T18957.h2: <SC1(U)><SP(U)>
-T18957.h3: <UCU(P(U))><SP(U)>
-T18957.seq': <SA><SU>
+T18957.g: <MCM(L)><1P(L)>
+T18957.h1: <SCM(L)><1P(L)>
+T18957.h2: <1CM(L)><1P(L)>
+T18957.h3: <LCL(P(L))><1P(L)>
+T18957.seq': <1A><1L>
@@ -21,10 +21,10 @@ T18957.seq':
==================== Strictness signatures ====================
T18957.$trModule:
-T18957.g: <1C1(U)><SP(U)>
-T18957.h1: <MC1(U)><SP(U)>
-T18957.h2: <SC1(U)><SP(U)>
-T18957.h3: <UCU(P(U))><SP(U)>
-T18957.seq': <SA><SU>
+T18957.g: <MCM(L)><1P(L)>
+T18957.h1: <SCM(L)><1P(L)>
+T18957.h2: <1CM(L)><1P(L)>
+T18957.h3: <LCL(P(L))><1P(L)>
+T18957.seq': <1A><1L>
diff --git a/testsuite/tests/stranal/sigs/T5075.stderr b/testsuite/tests/stranal/sigs/T5075.stderr
index a918028c82..e17d5e7c5c 100644
--- a/testsuite/tests/stranal/sigs/T5075.stderr
+++ b/testsuite/tests/stranal/sigs/T5075.stderr
@@ -1,7 +1,7 @@
==================== Strictness signatures ====================
T5075.$trModule:
-T5075.loop: <MP(A,A,MCM(CS(U)),A,A,A,A,A)><UP(A,A,UCU(CS(U)),A,A,A,U)><U>
+T5075.loop: <SP(A,A,SCS(C1(L)),A,A,A,A,A)><LP(A,A,LCL(C1(L)),A,A,A,L)><L>
@@ -13,6 +13,6 @@ T5075.loop:
==================== Strictness signatures ====================
T5075.$trModule:
-T5075.loop: <SP(A,A,MCM(CS(U)),A,A,A,A,A)><UP(A,A,UCU(CS(U)),A,A,A,U)><U>
+T5075.loop: <1P(A,A,SCS(C1(L)),A,A,A,A,A)><LP(A,A,LCL(C1(L)),A,A,A,L)><L>
diff --git a/testsuite/tests/stranal/sigs/T8569.stderr b/testsuite/tests/stranal/sigs/T8569.stderr
index cc7a5e9fb0..187047e612 100644
--- a/testsuite/tests/stranal/sigs/T8569.stderr
+++ b/testsuite/tests/stranal/sigs/T8569.stderr
@@ -4,7 +4,7 @@ T8569.$tc'Rdata:
T8569.$tc'Rint:
T8569.$tcRep:
T8569.$trModule:
-T8569.addUp: <SU><U>
+T8569.addUp: <1L><L>
@@ -22,6 +22,6 @@ T8569.$tc'Rdata:
T8569.$tc'Rint:
T8569.$tcRep:
T8569.$trModule:
-T8569.addUp: <SU><U>
+T8569.addUp: <1L><L>
diff --git a/testsuite/tests/stranal/sigs/T8598.stderr b/testsuite/tests/stranal/sigs/T8598.stderr
index 7e68094018..9f49534945 100644
--- a/testsuite/tests/stranal/sigs/T8598.stderr
+++ b/testsuite/tests/stranal/sigs/T8598.stderr
@@ -1,7 +1,7 @@
==================== Strictness signatures ====================
T8598.$trModule:
-T8598.fun: <SP(U)>
+T8598.fun: <1P(L)>
@@ -13,6 +13,6 @@ T8598.fun: m1
==================== Strictness signatures ====================
T8598.$trModule:
-T8598.fun: <SP(U)>
+T8598.fun: <1P(L)>
diff --git a/testsuite/tests/stranal/sigs/UnsatFun.stderr b/testsuite/tests/stranal/sigs/UnsatFun.stderr
index 18723bad40..691fe21c98 100644
--- a/testsuite/tests/stranal/sigs/UnsatFun.stderr
+++ b/testsuite/tests/stranal/sigs/UnsatFun.stderr
@@ -1,13 +1,13 @@
==================== Strictness signatures ====================
UnsatFun.$trModule:
-UnsatFun.f: <SP(M)><B>b
-UnsatFun.g: <SP(M)>b
-UnsatFun.g': <1P(U)>
+UnsatFun.f: <1P(S)><B>b
+UnsatFun.g: <1P(S)>b
+UnsatFun.g': <MP(L)>
UnsatFun.g3: <A>
-UnsatFun.h: <SCS(U)>
-UnsatFun.h2: <SU><1C1(U)>
-UnsatFun.h3: <SCS(A)>
+UnsatFun.h: <1C1(L)>
+UnsatFun.h2: <1L><MCM(L)>
+UnsatFun.h3: <1C1(A)>
@@ -25,12 +25,12 @@ UnsatFun.h3: m1
==================== Strictness signatures ====================
UnsatFun.$trModule:
-UnsatFun.f: <SP(M)><B>b
-UnsatFun.g: <SP(M)>b
-UnsatFun.g': <1P(U)>
+UnsatFun.f: <1P(S)><B>b
+UnsatFun.g: <1P(S)>b
+UnsatFun.g': <MP(L)>
UnsatFun.g3: <A>
-UnsatFun.h: <SCS(U)>
-UnsatFun.h2: <SU><1C1(U)>
-UnsatFun.h3: <SCS(A)>
+UnsatFun.h: <1C1(L)>
+UnsatFun.h2: <1L><MCM(L)>
+UnsatFun.h3: <1C1(A)>