summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Peyton Jones <simonpj@microsoft.com>2018-01-03 10:48:26 +0000
committerSimon Peyton Jones <simonpj@microsoft.com>2018-01-03 11:26:20 +0000
commitbd438b2d67ec8f5d8ac8472f13b3175b569951b9 (patch)
tree341778b90b4544430393898d3bdfc93ce08601bd
parent9e5535ca667e060ce1431d42cdfc3a13ae080a88 (diff)
downloadhaskell-bd438b2d67ec8f5d8ac8472f13b3175b569951b9.tar.gz
Get evaluated-ness right in the back end
See Trac #14626, comment:4. We want to maintain evaluted-ness info on Ids into the code generateor for two reasons (see Note [Preserve evaluated-ness in CorePrep] in CorePrep) - DataToTag magic - Potentially using it in the codegen (this is Gabor's current work) But it was all being done very inconsistently, and actually outright wrong -- the DataToTag magic hasn't been working for years. This patch tidies it all up, with Notes to match.
-rw-r--r--compiler/basicTypes/IdInfo.hs7
-rw-r--r--compiler/coreSyn/CorePrep.hs142
-rw-r--r--compiler/coreSyn/CoreTidy.hs9
-rw-r--r--compiler/iface/ToIface.hs11
-rw-r--r--compiler/main/TidyPgm.hs30
-rw-r--r--testsuite/tests/codeGen/should_compile/Makefile3
-rw-r--r--testsuite/tests/codeGen/should_compile/T14626.hs15
-rw-r--r--testsuite/tests/codeGen/should_compile/T14626.stdout2
-rw-r--r--testsuite/tests/codeGen/should_compile/all.T5
-rw-r--r--testsuite/tests/deSugar/should_compile/T2431.stderr32
-rw-r--r--testsuite/tests/roles/should_compile/Roles13.stderr52
-rw-r--r--testsuite/tests/simplCore/should_compile/T13143.stderr4
-rw-r--r--testsuite/tests/simplCore/should_compile/T3717.stderr2
-rw-r--r--testsuite/tests/simplCore/should_compile/T3772.stdout4
-rw-r--r--testsuite/tests/simplCore/should_compile/T4908.stderr6
-rw-r--r--testsuite/tests/simplCore/should_compile/T4930.stderr2
-rw-r--r--testsuite/tests/simplCore/should_compile/T7360.stderr6
-rw-r--r--testsuite/tests/simplCore/should_compile/T9400.stderr64
-rw-r--r--testsuite/tests/simplCore/should_compile/spec-inline.stderr4
-rw-r--r--testsuite/tests/stranal/should_compile/T10694.stderr96
20 files changed, 299 insertions, 197 deletions
diff --git a/compiler/basicTypes/IdInfo.hs b/compiler/basicTypes/IdInfo.hs
index 07f8814767..f6febaf4dc 100644
--- a/compiler/basicTypes/IdInfo.hs
+++ b/compiler/basicTypes/IdInfo.hs
@@ -29,7 +29,7 @@ module IdInfo (
-- ** Zapping various forms of Info
zapLamInfo, zapFragileInfo,
zapDemandInfo, zapUsageInfo, zapUsageEnvInfo, zapUsedOnceInfo,
- zapTailCallInfo, zapCallArityInfo,
+ zapTailCallInfo, zapCallArityInfo, zapUnfolding,
-- ** The ArityInfo type
ArityInfo,
@@ -547,6 +547,11 @@ zapFragileUnfolding unf
| isFragileUnfolding unf = noUnfolding
| otherwise = unf
+zapUnfolding :: Unfolding -> Unfolding
+-- Squash all unfolding info, preserving only evaluated-ness
+zapUnfolding unf | isEvaldUnfolding unf = evaldUnfolding
+ | otherwise = noUnfolding
+
zapTailCallInfo :: IdInfo -> Maybe IdInfo
zapTailCallInfo info
= case occInfo info of
diff --git a/compiler/coreSyn/CorePrep.hs b/compiler/coreSyn/CorePrep.hs
index f618a60514..16f69cc6a7 100644
--- a/compiler/coreSyn/CorePrep.hs
+++ b/compiler/coreSyn/CorePrep.hs
@@ -407,23 +407,21 @@ cpeBind top_lvl env (NonRec bndr rhs)
= do { (_, bndr1) <- cpCloneBndr env bndr
; let dmd = idDemandInfo bndr
is_unlifted = isUnliftedType (idType bndr)
- ; (floats, bndr2, rhs2) <- cpePair top_lvl NonRecursive
- dmd
- is_unlifted
- env bndr1 rhs
+ ; (floats, rhs1) <- cpePair top_lvl NonRecursive
+ dmd is_unlifted
+ env bndr1 rhs
-- See Note [Inlining in CorePrep]
- ; if exprIsTrivial rhs2 && isNotTopLevel top_lvl
- then return (extendCorePrepEnvExpr env bndr rhs2, floats, Nothing)
+ ; if exprIsTrivial rhs1 && isNotTopLevel top_lvl
+ then return (extendCorePrepEnvExpr env bndr rhs1, floats, Nothing)
else do {
- ; let new_float = mkFloat dmd is_unlifted bndr2 rhs2
+ ; let new_float = mkFloat dmd is_unlifted bndr1 rhs1
- -- We want bndr'' in the envt, because it records
- -- the evaluated-ness of the binder
- ; return (extendCorePrepEnv env bndr bndr2,
+ ; return (extendCorePrepEnv env bndr bndr1,
addFloat floats new_float,
Nothing) }}
- | otherwise -- See Note [Join points and floating]
+
+ | otherwise -- A join point; see Note [Join points and floating]
= ASSERT(not (isTopLevel top_lvl)) -- can't have top-level join point
do { (_, bndr1) <- cpCloneBndr env bndr
; (bndr2, rhs1) <- cpeJoinPair env bndr1 rhs
@@ -434,14 +432,17 @@ cpeBind top_lvl env (NonRec bndr rhs)
cpeBind top_lvl env (Rec pairs)
| not (isJoinId (head bndrs))
= do { (env', bndrs1) <- cpCloneBndrs env bndrs
- ; stuff <- zipWithM (cpePair top_lvl Recursive topDmd False env') bndrs1 rhss
+ ; stuff <- zipWithM (cpePair top_lvl Recursive topDmd False env')
+ bndrs1 rhss
- ; let (floats_s, bndrs2, rhss2) = unzip3 stuff
- all_pairs = foldrOL add_float (bndrs2 `zip` rhss2)
+ ; let (floats_s, rhss1) = unzip stuff
+ all_pairs = foldrOL add_float (bndrs1 `zip` rhss1)
(concatFloats floats_s)
- ; return (extendCorePrepEnvList env (bndrs `zip` bndrs2),
+
+ ; return (extendCorePrepEnvList env (bndrs `zip` bndrs1),
unitFloat (FloatLet (Rec all_pairs)),
Nothing) }
+
| otherwise -- See Note [Join points and floating]
= do { (env', bndrs1) <- cpCloneBndrs env bndrs
; pairs1 <- zipWithM (cpeJoinPair env') bndrs1 rhss
@@ -461,9 +462,10 @@ cpeBind top_lvl env (Rec pairs)
---------------
cpePair :: TopLevelFlag -> RecFlag -> Demand -> Bool
- -> CorePrepEnv -> Id -> CoreExpr
- -> UniqSM (Floats, Id, CpeRhs)
+ -> CorePrepEnv -> OutId -> CoreExpr
+ -> UniqSM (Floats, CpeRhs)
-- Used for all bindings
+-- The binder is already cloned, hence an OutId
cpePair top_lvl is_rec dmd is_unlifted env bndr rhs
= ASSERT(not (isJoinId bndr)) -- those should use cpeJoinPair
do { (floats1, rhs1) <- cpeRhsE env rhs
@@ -485,15 +487,7 @@ cpePair top_lvl is_rec dmd is_unlifted env bndr rhs
-- Wrap floating ticks
; let (floats4, rhs4) = wrapTicks floats3 rhs3
- -- Record if the binder is evaluated
- -- and otherwise trim off the unfolding altogether
- -- It's not used by the code generator; getting rid of it reduces
- -- heap usage and, since we may be changing uniques, we'd have
- -- to substitute to keep it right
- ; let bndr' | exprIsHNF rhs3 = bndr `setIdUnfolding` evaldUnfolding
- | otherwise = bndr `setIdUnfolding` noUnfolding
-
- ; return (floats4, bndr', rhs4) }
+ ; return (floats4, rhs4) }
where
platform = targetPlatform (cpe_dynFlags env)
@@ -573,7 +567,6 @@ cpeJoinPair env bndr rhs
{-
Note [Arity and join points]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
Up to now, we've allowed a join point to have an arity greater than its join
arity (minus type arguments), since this is what's useful for eta expansion.
However, for code gen purposes, its arity must be exactly the number of value
@@ -644,9 +637,7 @@ cpeRhsE env expr@(Lam {})
cpeRhsE env (Case scrut bndr ty alts)
= do { (floats, scrut') <- cpeBody env scrut
- ; let bndr1 = bndr `setIdUnfolding` evaldUnfolding
- -- Record that the case binder is evaluated in the alternatives
- ; (env', bndr2) <- cpCloneBndr env bndr1
+ ; (env', bndr2) <- cpCloneBndr env bndr
; let alts'
-- This flag is intended to aid in debugging strictness
-- analysis bugs. These are particularly nasty to chase down as
@@ -1083,16 +1074,26 @@ saturateDataToTag sat_expr
eval_data2tag_arg other -- Should not happen
= pprPanic "eval_data2tag" (ppr other)
-{-
-Note [dataToTag magic]
-~~~~~~~~~~~~~~~~~~~~~~
-Horrid: we must ensure that the arg of data2TagOp is evaluated
- (data2tag x) --> (case x of y -> data2tag y)
+{- Note [dataToTag magic]
+~~~~~~~~~~~~~~~~~~~~~~~~~
+We must ensure that the arg of data2TagOp is evaluated. So
+in general CorePrep does this transformation:
+ data2tag e --> case e of y -> data2tag y
(yuk yuk) take into account the lambdas we've now introduced
How might it not be evaluated? Well, we might have floated it out
of the scope of a `seq`, or dropped the `seq` altogether.
+We only do this if 'e' is not a WHNF. But if it's a simple
+variable (common case) we need to know it's evaluated-ness flag.
+Example:
+ data T = MkT !Bool
+ f v = case v of
+ MkT y -> dataToTag# y
+Here we don't want to generate an extra case on 'y', because it's
+already evaluated. So we want to keep the evaluated-ness flag
+on y. See Note [Preserve evaluated-ness in CorePrep].
+
************************************************************************
* *
@@ -1545,26 +1546,67 @@ getMkIntegerId = cpe_mkIntegerId
-- Cloning binders
-- ---------------------------------------------------------------------------
-cpCloneBndrs :: CorePrepEnv -> [Var] -> UniqSM (CorePrepEnv, [Var])
+cpCloneBndrs :: CorePrepEnv -> [InVar] -> UniqSM (CorePrepEnv, [OutVar])
cpCloneBndrs env bs = mapAccumLM cpCloneBndr env bs
-cpCloneBndr :: CorePrepEnv -> Var -> UniqSM (CorePrepEnv, Var)
+cpCloneBndr :: CorePrepEnv -> InVar -> UniqSM (CorePrepEnv, OutVar)
cpCloneBndr env bndr
- | isLocalId bndr, not (isCoVar bndr)
- = do bndr' <- setVarUnique bndr <$> getUniqueM
-
- -- We are going to OccAnal soon, so drop (now-useless) rules/unfoldings
- -- so that we can drop more stuff as dead code.
- -- See also Note [Dead code in CorePrep]
- let bndr'' = bndr' `setIdUnfolding` noUnfolding
- `setIdSpecialisation` emptyRuleInfo
- return (extendCorePrepEnv env bndr bndr'', bndr'')
-
- | otherwise -- Top level things, which we don't want
- -- to clone, have become GlobalIds by now
- -- And we don't clone tyvars, or coercion variables
+ | not (isId bndr)
= return (env, bndr)
+ | otherwise
+ = do { bndr' <- clone_it bndr
+
+ -- Drop (now-useless) rules/unfoldings
+ -- See Note [Drop unfoldings and rules]
+ -- and Note [Preserve evaluated-ness in CorePrep]
+ ; let unfolding' = zapUnfolding (realIdUnfolding bndr)
+ -- Simplifier will set the Id's unfolding
+
+ bndr'' = bndr' `setIdUnfolding` unfolding'
+ `setIdSpecialisation` emptyRuleInfo
+
+ ; return (extendCorePrepEnv env bndr bndr'', bndr'') }
+ where
+ clone_it bndr
+ | isLocalId bndr, not (isCoVar bndr)
+ = do { uniq <- getUniqueM; return (setVarUnique bndr uniq) }
+ | otherwise -- Top level things, which we don't want
+ -- to clone, have become GlobalIds by now
+ -- And we don't clone tyvars, or coercion variables
+ = return bndr
+
+{- Note [Drop unfoldings and rules]
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+We want to drop the unfolding/rules on every Id:
+
+ - We are now past interface-file generation, and in the
+ codegen pipeline, so we really don't need full unfoldings/rules
+
+ - The unfolding/rule may be keeping stuff alive that we'd like
+ to discard. See Note [Dead code in CorePrep]
+
+ - Getting rid of unnecessary unfoldings reduces heap usage
+
+ - We are changing uniques, so if we didn't discard unfoldings/rules
+ we'd have to substitute in them
+
+HOWEVER, we want to preserve evaluated-ness; see
+Note [Preserve evaluated-ness in CorePrep]
+
+Note [Preserve evaluated-ness in CorePrep]
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+We want to preserve the evaluated-ness of each binder (via
+evaldUnfolding) for two reasons
+
+* In the code generator if we have
+ case x of y { Red -> e1; DEFAULT -> y }
+ we can return 'y' rather than entering it, if we know
+ it is evaluated (Trac #14626)
+
+* In the DataToTag magic (in CorePrep itself) we rely on
+ evaluated-ness. See Note Note [dataToTag magic].
+-}
------------------------------------------------------------------------------
-- Cloning ccall Ids; each must have a unique name,
diff --git a/compiler/coreSyn/CoreTidy.hs b/compiler/coreSyn/CoreTidy.hs
index 38e6052da0..5c2a44f909 100644
--- a/compiler/coreSyn/CoreTidy.hs
+++ b/compiler/coreSyn/CoreTidy.hs
@@ -159,9 +159,7 @@ tidyIdBndr env@(tidy_env, var_env) id
`setOneShotInfo` oneShotInfo old_info
old_info = idInfo id
old_unf = unfoldingInfo old_info
- new_unf | isEvaldUnfolding old_unf = evaldUnfolding
- | otherwise = noUnfolding
- -- See Note [Preserve evaluatedness]
+ new_unf = zapUnfolding old_unf -- See Note [Preserve evaluatedness]
in
((tidy_env', var_env'), id')
}
@@ -207,11 +205,10 @@ tidyLetBndr rec_tidy_env env@(tidy_env, var_env) (id,rhs)
`setInlinePragInfo` inlinePragInfo old_info
`setUnfoldingInfo` new_unf
+ old_unf = unfoldingInfo old_info
new_unf | isStableUnfolding old_unf = tidyUnfolding rec_tidy_env old_unf old_unf
- | isEvaldUnfolding old_unf = evaldUnfolding
+ | otherwise = zapUnfolding old_unf
-- See Note [Preserve evaluatedness]
- | otherwise = noUnfolding
- old_unf = unfoldingInfo old_info
in
((tidy_env', var_env'), id') }
diff --git a/compiler/iface/ToIface.hs b/compiler/iface/ToIface.hs
index deb84ca694..da24d38f9e 100644
--- a/compiler/iface/ToIface.hs
+++ b/compiler/iface/ToIface.hs
@@ -437,8 +437,15 @@ toIfUnfolding lb (DFunUnfolding { df_bndrs = bndrs, df_args = args })
-- No need to serialise the data constructor;
-- we can recover it from the type of the dfun
-toIfUnfolding _ _
- = Nothing
+toIfUnfolding _ (OtherCon {}) = Nothing
+ -- The binding site of an Id doesn't have OtherCon, except perhaps
+ -- where we have called zapUnfolding; and that evald'ness info is
+ -- not needed by importing modules
+
+toIfUnfolding _ BootUnfolding = Nothing
+ -- Can't happen; we only have BootUnfolding for imported binders
+
+toIfUnfolding _ NoUnfolding = Nothing
{-
************************************************************************
diff --git a/compiler/main/TidyPgm.hs b/compiler/main/TidyPgm.hs
index fd5339180c..1b94d834d9 100644
--- a/compiler/main/TidyPgm.hs
+++ b/compiler/main/TidyPgm.hs
@@ -221,18 +221,22 @@ globaliseAndTidyId id
Plan B: include pragmas, make interfaces
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-* Figure out which Ids are externally visible
+* Step 1: Figure out which Ids are externally visible
+ See Note [Choosing external Ids]
-* Tidy the bindings, externalising appropriate Ids
+* Step 2: Gather the extenally visible rules, separately from
+ the top-level bindings.
+ See Note [Finding external rules]
+
+* Step 3: Tidy the bindings, externalising appropriate Ids
+ See Note [Tidy the top-level bindings]
* Drop all Ids from the TypeEnv, and add all the External Ids from
the bindings. (This adds their IdInfo to the TypeEnv; and adds
floated-out Ids that weren't even in the TypeEnv before.)
-Step 1: Figure out external Ids
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-Note [choosing external names]
-
+Note [Choosing external Ids]
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~
See also the section "Interface stability" in the
RecompilationAvoidance commentary:
http://ghc.haskell.org/trac/ghc/wiki/Commentary/Compiler/RecompilationAvoidance
@@ -272,8 +276,8 @@ as the bindings themselves are deterministic (they sometimes aren't!),
the order in which they are presented to the tidying phase does not
affect the names we assign.
-Step 2: Tidy the program
-~~~~~~~~~~~~~~~~~~~~~~~~
+Note [Tidy the top-level bindings]
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Next we traverse the bindings top to bottom. For each *top-level*
binder
@@ -621,7 +625,7 @@ get_defn id = NonRec id (unfoldingTemplate (realIdUnfolding id))
* *
************************************************************************
-See Note [Choosing external names].
+See Note [Choosing external Ids].
-}
type UnfoldEnv = IdEnv (Name{-new name-}, Bool {-show unfolding-})
@@ -780,7 +784,7 @@ a VarSet, which is in a non-deterministic order when converted to a
list. Hence, here we define a free-variable finder that returns
the free variables in the order that they are encountered.
-See Note [Choosing external names]
+See Note [Choosing external Ids]
-}
bndrFvsInOrder :: Bool -> Id -> [Id]
@@ -1244,6 +1248,8 @@ tidyTopIdInfo dflags rhs_tidy_env name orig_rhs tidy_rhs idinfo show_unfold caf_
`setCafInfo` caf_info
`setArityInfo` arity
`setStrictnessInfo` final_sig
+ `setUnfoldingInfo` minimal_unfold_info -- See note [Preserve evaluatedness]
+ -- in CoreTidy
| otherwise -- Externally-visible Ids get the whole lot
= vanillaIdInfo
@@ -1280,7 +1286,8 @@ tidyTopIdInfo dflags rhs_tidy_env name orig_rhs tidy_rhs idinfo show_unfold caf_
--------- Unfolding ------------
unf_info = unfoldingInfo idinfo
unfold_info | show_unfold = tidyUnfolding rhs_tidy_env unf_info unf_from_rhs
- | otherwise = noUnfolding
+ | otherwise = minimal_unfold_info
+ minimal_unfold_info = zapUnfolding unf_info
unf_from_rhs = mkTopUnfolding dflags is_bot tidy_rhs
is_bot = isBottomingSig final_sig
-- NB: do *not* expose the worker if show_unfold is off,
@@ -1297,6 +1304,7 @@ tidyTopIdInfo dflags rhs_tidy_env name orig_rhs tidy_rhs idinfo show_unfold caf_
-- for bottoming functions), but we might still have a worker/wrapper
-- split (see Note [Worker-wrapper for bottoming functions] in WorkWrap.hs
+
--------- Arity ------------
-- Usually the Id will have an accurate arity on it, because
-- the simplifier has just run, but not always.
diff --git a/testsuite/tests/codeGen/should_compile/Makefile b/testsuite/tests/codeGen/should_compile/Makefile
index a3e03d244b..a8414384cf 100644
--- a/testsuite/tests/codeGen/should_compile/Makefile
+++ b/testsuite/tests/codeGen/should_compile/Makefile
@@ -5,6 +5,9 @@ include $(TOP)/mk/test.mk
T2578:
'$(TEST_HC)' $(TEST_HC_OPTS) --make T2578 -fforce-recomp -v0
+T14626:
+ '$(TEST_HC)' $(TEST_HC_OPTS) -c -O -ddump-prep -dsuppress-uniques T14626.hs | grep case
+
debug:
# Without optimisations, we should get annotations for basically
# all expressions in the example program.
diff --git a/testsuite/tests/codeGen/should_compile/T14626.hs b/testsuite/tests/codeGen/should_compile/T14626.hs
new file mode 100644
index 0000000000..a665694bfc
--- /dev/null
+++ b/testsuite/tests/codeGen/should_compile/T14626.hs
@@ -0,0 +1,15 @@
+{-# LANGUAGE MagicHash #-}
+
+module T14626 where
+
+import GHC.Prim
+
+data T = MkT !Bool
+
+f v = case v of
+ MkT y -> dataToTag# y
+
+-- This should /not/ produce an inner case on the y, thus:
+-- f v = case v of
+-- MkT y -> case y of z -> dataToTag# z
+-- But it was! See Trac #14626 comment:4
diff --git a/testsuite/tests/codeGen/should_compile/T14626.stdout b/testsuite/tests/codeGen/should_compile/T14626.stdout
new file mode 100644
index 0000000000..31e280e062
--- /dev/null
+++ b/testsuite/tests/codeGen/should_compile/T14626.stdout
@@ -0,0 +1,2 @@
+ case dt of dt { __DEFAULT -> T14626.MkT dt }
+ case v of { T14626.MkT y [Occ=Once] ->
diff --git a/testsuite/tests/codeGen/should_compile/all.T b/testsuite/tests/codeGen/should_compile/all.T
index 6ae4e1cb4e..fb813a497a 100644
--- a/testsuite/tests/codeGen/should_compile/all.T
+++ b/testsuite/tests/codeGen/should_compile/all.T
@@ -30,8 +30,11 @@ test('debug',
run_command, ['$MAKE -s --no-print-directory debug'])
test('T9964', normal, compile, ['-O'])
test('T10518', [cmm_src], compile, [''])
-test('T10667', [ when((arch('powerpc64') or arch('powerpc64le')),
+test('T10667', [ when((arch('powerpc64') or arch('powerpc64le')),
expect_broken(11261))],
compile, ['-g'])
test('T12115', normal, compile, [''])
test('T12355', normal, compile, [''])
+test('T14626',
+ normal,
+ run_command, ['$MAKE -s --no-print-directory T14626'])
diff --git a/testsuite/tests/deSugar/should_compile/T2431.stderr b/testsuite/tests/deSugar/should_compile/T2431.stderr
index aaa1696331..e1c4b43d16 100644
--- a/testsuite/tests/deSugar/should_compile/T2431.stderr
+++ b/testsuite/tests/deSugar/should_compile/T2431.stderr
@@ -19,52 +19,52 @@ T2431.$WRefl
-- RHS size: {terms: 4, types: 8, coercions: 0, joins: 0/0}
absurd :: forall a. (Int :~: Bool) -> a
-[GblId, Arity=1, Caf=NoCafRefs, Str=<L,U>x]
+[GblId, Arity=1, Caf=NoCafRefs, Str=<L,U>x, Unf=OtherCon []]
absurd = \ (@ a) (x :: Int :~: Bool) -> case x of { }
-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
$trModule1 :: GHC.Prim.Addr#
-[GblId, Caf=NoCafRefs]
+[GblId, Caf=NoCafRefs, Unf=OtherCon []]
$trModule1 = "main"#
-- RHS size: {terms: 2, types: 0, coercions: 0, joins: 0/0}
$trModule2 :: GHC.Types.TrName
-[GblId, Caf=NoCafRefs]
+[GblId, Caf=NoCafRefs, Unf=OtherCon []]
$trModule2 = GHC.Types.TrNameS $trModule1
-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
$trModule3 :: GHC.Prim.Addr#
-[GblId, Caf=NoCafRefs]
+[GblId, Caf=NoCafRefs, Unf=OtherCon []]
$trModule3 = "T2431"#
-- RHS size: {terms: 2, types: 0, coercions: 0, joins: 0/0}
$trModule4 :: GHC.Types.TrName
-[GblId, Caf=NoCafRefs]
+[GblId, Caf=NoCafRefs, Unf=OtherCon []]
$trModule4 = GHC.Types.TrNameS $trModule3
-- RHS size: {terms: 3, types: 0, coercions: 0, joins: 0/0}
T2431.$trModule :: GHC.Types.Module
-[GblId, Caf=NoCafRefs]
+[GblId, Caf=NoCafRefs, Unf=OtherCon []]
T2431.$trModule = GHC.Types.Module $trModule2 $trModule4
-- RHS size: {terms: 2, types: 0, coercions: 0, joins: 0/0}
$krep :: GHC.Types.KindRep
-[GblId, Caf=NoCafRefs]
+[GblId, Caf=NoCafRefs, Unf=OtherCon []]
$krep = GHC.Types.KindRepVar 0#
-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
$tc:~:1 :: GHC.Prim.Addr#
-[GblId, Caf=NoCafRefs]
+[GblId, Caf=NoCafRefs, Unf=OtherCon []]
$tc:~:1 = ":~:"#
-- RHS size: {terms: 2, types: 0, coercions: 0, joins: 0/0}
$tc:~:2 :: GHC.Types.TrName
-[GblId, Caf=NoCafRefs]
+[GblId, Caf=NoCafRefs, Unf=OtherCon []]
$tc:~:2 = GHC.Types.TrNameS $tc:~:1
-- RHS size: {terms: 7, types: 0, coercions: 0, joins: 0/0}
T2431.$tc:~: :: GHC.Types.TyCon
-[GblId]
+[GblId, Unf=OtherCon []]
T2431.$tc:~:
= GHC.Types.TyCon
4608886815921030019##
@@ -76,34 +76,34 @@ T2431.$tc:~:
-- RHS size: {terms: 3, types: 2, coercions: 0, joins: 0/0}
$krep1 :: [GHC.Types.KindRep]
-[GblId, Caf=NoCafRefs]
+[GblId, Caf=NoCafRefs, Unf=OtherCon []]
$krep1
= GHC.Types.:
@ GHC.Types.KindRep $krep (GHC.Types.[] @ GHC.Types.KindRep)
-- RHS size: {terms: 3, types: 1, coercions: 0, joins: 0/0}
$krep2 :: [GHC.Types.KindRep]
-[GblId, Caf=NoCafRefs]
+[GblId, Caf=NoCafRefs, Unf=OtherCon []]
$krep2 = GHC.Types.: @ GHC.Types.KindRep $krep $krep1
-- RHS size: {terms: 3, types: 0, coercions: 0, joins: 0/0}
$krep3 :: GHC.Types.KindRep
-[GblId]
+[GblId, Unf=OtherCon []]
$krep3 = GHC.Types.KindRepTyConApp T2431.$tc:~: $krep2
-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
$tc'Refl1 :: GHC.Prim.Addr#
-[GblId, Caf=NoCafRefs]
+[GblId, Caf=NoCafRefs, Unf=OtherCon []]
$tc'Refl1 = "'Refl"#
-- RHS size: {terms: 2, types: 0, coercions: 0, joins: 0/0}
$tc'Refl2 :: GHC.Types.TrName
-[GblId, Caf=NoCafRefs]
+[GblId, Caf=NoCafRefs, Unf=OtherCon []]
$tc'Refl2 = GHC.Types.TrNameS $tc'Refl1
-- RHS size: {terms: 7, types: 0, coercions: 0, joins: 0/0}
T2431.$tc'Refl :: GHC.Types.TyCon
-[GblId]
+[GblId, Unf=OtherCon []]
T2431.$tc'Refl
= GHC.Types.TyCon
2478588351447975921##
diff --git a/testsuite/tests/roles/should_compile/Roles13.stderr b/testsuite/tests/roles/should_compile/Roles13.stderr
index 414ef801d5..67ff4035c3 100644
--- a/testsuite/tests/roles/should_compile/Roles13.stderr
+++ b/testsuite/tests/roles/should_compile/Roles13.stderr
@@ -5,12 +5,12 @@ Result size of Tidy Core
-- RHS size: {terms: 2, types: 2, coercions: 0, joins: 0/0}
convert1 :: Wrap Age -> Wrap Age
-[GblId, Arity=1, Caf=NoCafRefs]
+[GblId, Arity=1, Caf=NoCafRefs, Unf=OtherCon []]
convert1 = \ (ds :: Wrap Age) -> ds
-- RHS size: {terms: 1, types: 0, coercions: 5, joins: 0/0}
convert :: Wrap Age -> Int
-[GblId, Arity=1, Caf=NoCafRefs]
+[GblId, Arity=1, Caf=NoCafRefs, Unf=OtherCon []]
convert
= convert1
`cast` (<Wrap Age>_R ->_R Roles13.N:Wrap[0] (Roles13.N:Age[0])
@@ -18,54 +18,54 @@ convert
-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
$trModule1 :: GHC.Prim.Addr#
-[GblId, Caf=NoCafRefs]
+[GblId, Caf=NoCafRefs, Unf=OtherCon []]
$trModule1 = "main"#
-- RHS size: {terms: 2, types: 0, coercions: 0, joins: 0/0}
$trModule2 :: GHC.Types.TrName
-[GblId, Caf=NoCafRefs]
+[GblId, Caf=NoCafRefs, Unf=OtherCon []]
$trModule2 = GHC.Types.TrNameS $trModule1
-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
$trModule3 :: GHC.Prim.Addr#
-[GblId, Caf=NoCafRefs]
+[GblId, Caf=NoCafRefs, Unf=OtherCon []]
$trModule3 = "Roles13"#
-- RHS size: {terms: 2, types: 0, coercions: 0, joins: 0/0}
$trModule4 :: GHC.Types.TrName
-[GblId, Caf=NoCafRefs]
+[GblId, Caf=NoCafRefs, Unf=OtherCon []]
$trModule4 = GHC.Types.TrNameS $trModule3
-- RHS size: {terms: 3, types: 0, coercions: 0, joins: 0/0}
Roles13.$trModule :: GHC.Types.Module
-[GblId, Caf=NoCafRefs]
+[GblId, Caf=NoCafRefs, Unf=OtherCon []]
Roles13.$trModule = GHC.Types.Module $trModule2 $trModule4
-- RHS size: {terms: 3, types: 1, coercions: 0, joins: 0/0}
$krep :: GHC.Types.KindRep
-[GblId]
+[GblId, Unf=OtherCon []]
$krep
= GHC.Types.KindRepTyConApp
GHC.Types.$tcInt (GHC.Types.[] @ GHC.Types.KindRep)
-- RHS size: {terms: 2, types: 0, coercions: 0, joins: 0/0}
$krep1 :: GHC.Types.KindRep
-[GblId, Caf=NoCafRefs]
+[GblId, Caf=NoCafRefs, Unf=OtherCon []]
$krep1 = GHC.Types.KindRepVar 0#
-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
$tcAge1 :: GHC.Prim.Addr#
-[GblId, Caf=NoCafRefs]
+[GblId, Caf=NoCafRefs, Unf=OtherCon []]
$tcAge1 = "Age"#
-- RHS size: {terms: 2, types: 0, coercions: 0, joins: 0/0}
$tcAge2 :: GHC.Types.TrName
-[GblId, Caf=NoCafRefs]
+[GblId, Caf=NoCafRefs, Unf=OtherCon []]
$tcAge2 = GHC.Types.TrNameS $tcAge1
-- RHS size: {terms: 7, types: 0, coercions: 0, joins: 0/0}
Roles13.$tcAge :: GHC.Types.TyCon
-[GblId]
+[GblId, Unf=OtherCon []]
Roles13.$tcAge
= GHC.Types.TyCon
3456257068627873222##
@@ -77,29 +77,29 @@ Roles13.$tcAge
-- RHS size: {terms: 3, types: 1, coercions: 0, joins: 0/0}
$krep2 :: GHC.Types.KindRep
-[GblId]
+[GblId, Unf=OtherCon []]
$krep2
= GHC.Types.KindRepTyConApp
Roles13.$tcAge (GHC.Types.[] @ GHC.Types.KindRep)
-- RHS size: {terms: 3, types: 0, coercions: 0, joins: 0/0}
$krep3 :: GHC.Types.KindRep
-[GblId]
+[GblId, Unf=OtherCon []]
$krep3 = GHC.Types.KindRepFun $krep $krep2
-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
$tc'MkAge1 :: GHC.Prim.Addr#
-[GblId, Caf=NoCafRefs]
+[GblId, Caf=NoCafRefs, Unf=OtherCon []]
$tc'MkAge1 = "'MkAge"#
-- RHS size: {terms: 2, types: 0, coercions: 0, joins: 0/0}
$tc'MkAge2 :: GHC.Types.TrName
-[GblId, Caf=NoCafRefs]
+[GblId, Caf=NoCafRefs, Unf=OtherCon []]
$tc'MkAge2 = GHC.Types.TrNameS $tc'MkAge1
-- RHS size: {terms: 7, types: 0, coercions: 0, joins: 0/0}
Roles13.$tc'MkAge :: GHC.Types.TyCon
-[GblId]
+[GblId, Unf=OtherCon []]
Roles13.$tc'MkAge
= GHC.Types.TyCon
18264039750958872441##
@@ -111,17 +111,17 @@ Roles13.$tc'MkAge
-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
$tcWrap1 :: GHC.Prim.Addr#
-[GblId, Caf=NoCafRefs]
+[GblId, Caf=NoCafRefs, Unf=OtherCon []]
$tcWrap1 = "Wrap"#
-- RHS size: {terms: 2, types: 0, coercions: 0, joins: 0/0}
$tcWrap2 :: GHC.Types.TrName
-[GblId, Caf=NoCafRefs]
+[GblId, Caf=NoCafRefs, Unf=OtherCon []]
$tcWrap2 = GHC.Types.TrNameS $tcWrap1
-- RHS size: {terms: 7, types: 0, coercions: 0, joins: 0/0}
Roles13.$tcWrap :: GHC.Types.TyCon
-[GblId]
+[GblId, Unf=OtherCon []]
Roles13.$tcWrap
= GHC.Types.TyCon
13773534096961634492##
@@ -133,34 +133,34 @@ Roles13.$tcWrap
-- RHS size: {terms: 3, types: 2, coercions: 0, joins: 0/0}
$krep4 :: [GHC.Types.KindRep]
-[GblId, Caf=NoCafRefs]
+[GblId, Caf=NoCafRefs, Unf=OtherCon []]
$krep4
= GHC.Types.:
@ GHC.Types.KindRep $krep1 (GHC.Types.[] @ GHC.Types.KindRep)
-- RHS size: {terms: 3, types: 0, coercions: 0, joins: 0/0}
$krep5 :: GHC.Types.KindRep
-[GblId]
+[GblId, Unf=OtherCon []]
$krep5 = GHC.Types.KindRepTyConApp Roles13.$tcWrap $krep4
-- RHS size: {terms: 3, types: 0, coercions: 0, joins: 0/0}
$krep6 :: GHC.Types.KindRep
-[GblId]
+[GblId, Unf=OtherCon []]
$krep6 = GHC.Types.KindRepFun $krep1 $krep5
-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
$tc'MkWrap1 :: GHC.Prim.Addr#
-[GblId, Caf=NoCafRefs]
+[GblId, Caf=NoCafRefs, Unf=OtherCon []]
$tc'MkWrap1 = "'MkWrap"#
-- RHS size: {terms: 2, types: 0, coercions: 0, joins: 0/0}
$tc'MkWrap2 :: GHC.Types.TrName
-[GblId, Caf=NoCafRefs]
+[GblId, Caf=NoCafRefs, Unf=OtherCon []]
$tc'MkWrap2 = GHC.Types.TrNameS $tc'MkWrap1
-- RHS size: {terms: 7, types: 0, coercions: 0, joins: 0/0}
Roles13.$tc'MkWrap :: GHC.Types.TyCon
-[GblId]
+[GblId, Unf=OtherCon []]
Roles13.$tc'MkWrap
= GHC.Types.TyCon
15580677875333883466##
diff --git a/testsuite/tests/simplCore/should_compile/T13143.stderr b/testsuite/tests/simplCore/should_compile/T13143.stderr
index 9ac62ad090..01cb771e20 100644
--- a/testsuite/tests/simplCore/should_compile/T13143.stderr
+++ b/testsuite/tests/simplCore/should_compile/T13143.stderr
@@ -7,7 +7,7 @@ Rec {
-- RHS size: {terms: 4, types: 4, coercions: 0, joins: 0/0}
T13143.$wf [InlPrag=NOINLINE, Occ=LoopBreaker]
:: forall a. GHC.Prim.Void# -> a
-[GblId, Arity=1, Caf=NoCafRefs, Str=<B,A>b]
+[GblId, Arity=1, Caf=NoCafRefs, Str=<B,A>b, Unf=OtherCon []]
T13143.$wf = \ (@ a) _ [Occ=Dead] -> T13143.$wf @ a GHC.Prim.void#
end Rec }
@@ -76,7 +76,7 @@ Rec {
-- RHS size: {terms: 28, types: 7, coercions: 0, joins: 0/0}
T13143.$wg [InlPrag=NOUSERINLINE[0], Occ=LoopBreaker]
:: Bool -> Bool -> GHC.Prim.Int# -> GHC.Prim.Int#
-[GblId, Arity=3, Str=<S,1*U><S,1*U><S,U>]
+[GblId, Arity=3, Str=<S,1*U><S,1*U><S,U>, Unf=OtherCon []]
T13143.$wg
= \ (w :: Bool) (w1 :: Bool) (ww :: GHC.Prim.Int#) ->
case w of {
diff --git a/testsuite/tests/simplCore/should_compile/T3717.stderr b/testsuite/tests/simplCore/should_compile/T3717.stderr
index 35b4fa8dbd..c32dffddd8 100644
--- a/testsuite/tests/simplCore/should_compile/T3717.stderr
+++ b/testsuite/tests/simplCore/should_compile/T3717.stderr
@@ -51,7 +51,7 @@ Rec {
-- RHS size: {terms: 10, types: 2, coercions: 0, joins: 0/0}
T3717.$wfoo [InlPrag=NOUSERINLINE[0], Occ=LoopBreaker]
:: GHC.Prim.Int# -> GHC.Prim.Int#
-[GblId, Arity=1, Caf=NoCafRefs, Str=<S,1*U>]
+[GblId, Arity=1, Caf=NoCafRefs, Str=<S,1*U>, Unf=OtherCon []]
T3717.$wfoo
= \ (ww :: GHC.Prim.Int#) ->
case ww of ds {
diff --git a/testsuite/tests/simplCore/should_compile/T3772.stdout b/testsuite/tests/simplCore/should_compile/T3772.stdout
index 409db79c93..37d5a3c742 100644
--- a/testsuite/tests/simplCore/should_compile/T3772.stdout
+++ b/testsuite/tests/simplCore/should_compile/T3772.stdout
@@ -50,7 +50,7 @@ T3772.$trModule
Rec {
-- RHS size: {terms: 10, types: 2, coercions: 0, joins: 0/0}
$wxs :: GHC.Prim.Int# -> ()
-[GblId, Arity=1, Caf=NoCafRefs, Str=<S,1*U>]
+[GblId, Arity=1, Caf=NoCafRefs, Str=<S,1*U>, Unf=OtherCon []]
$wxs
= \ (ww :: GHC.Prim.Int#) ->
case ww of ds1 {
@@ -61,7 +61,7 @@ end Rec }
-- RHS size: {terms: 10, types: 2, coercions: 0, joins: 0/0}
T3772.$wfoo [InlPrag=NOINLINE] :: GHC.Prim.Int# -> ()
-[GblId, Arity=1, Caf=NoCafRefs, Str=<S,U>]
+[GblId, Arity=1, Caf=NoCafRefs, Str=<S,U>, Unf=OtherCon []]
T3772.$wfoo
= \ (ww :: GHC.Prim.Int#) ->
case GHC.Prim.<# 0# ww of {
diff --git a/testsuite/tests/simplCore/should_compile/T4908.stderr b/testsuite/tests/simplCore/should_compile/T4908.stderr
index 2f805f074a..41b2d5d20d 100644
--- a/testsuite/tests/simplCore/should_compile/T4908.stderr
+++ b/testsuite/tests/simplCore/should_compile/T4908.stderr
@@ -50,7 +50,11 @@ 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, Caf=NoCafRefs, Str=<L,A><L,1*U><S,1*U>]
+[GblId,
+ Arity=3,
+ Caf=NoCafRefs,
+ Str=<L,A><L,1*U><S,1*U>,
+ Unf=OtherCon []]
T4908.f_$s$wf
= \ (sc :: Int) (sc1 :: Int#) (sc2 :: Int#) ->
case sc2 of ds {
diff --git a/testsuite/tests/simplCore/should_compile/T4930.stderr b/testsuite/tests/simplCore/should_compile/T4930.stderr
index 2e5416303a..2c63c279ba 100644
--- a/testsuite/tests/simplCore/should_compile/T4930.stderr
+++ b/testsuite/tests/simplCore/should_compile/T4930.stderr
@@ -51,7 +51,7 @@ Rec {
-- RHS size: {terms: 17, types: 3, coercions: 0, joins: 0/0}
T4930.$wfoo [InlPrag=NOUSERINLINE[0], Occ=LoopBreaker]
:: GHC.Prim.Int# -> GHC.Prim.Int#
-[GblId, Arity=1, Caf=NoCafRefs, Str=<S,U>]
+[GblId, Arity=1, Caf=NoCafRefs, Str=<S,U>, Unf=OtherCon []]
T4930.$wfoo
= \ (ww :: GHC.Prim.Int#) ->
case GHC.Prim.<# ww 5# of {
diff --git a/testsuite/tests/simplCore/should_compile/T7360.stderr b/testsuite/tests/simplCore/should_compile/T7360.stderr
index cf86246e45..8ae5953b43 100644
--- a/testsuite/tests/simplCore/should_compile/T7360.stderr
+++ b/testsuite/tests/simplCore/should_compile/T7360.stderr
@@ -121,7 +121,7 @@ T7360.$trModule
-- RHS size: {terms: 3, types: 1, coercions: 0, joins: 0/0}
$krep :: GHC.Types.KindRep
-[GblId, Caf=NoCafRefs, Str=m1]
+[GblId, Caf=NoCafRefs, Str=m1, Unf=OtherCon []]
$krep
= GHC.Types.KindRepTyConApp
GHC.Types.$tcInt (GHC.Types.[] @ GHC.Types.KindRep)
@@ -161,7 +161,7 @@ T7360.$tcFoo
-- RHS size: {terms: 3, types: 1, coercions: 0, joins: 0/0}
T7360.$tc'Foo4 [InlPrag=NOUSERINLINE[~]] :: GHC.Types.KindRep
-[GblId, Caf=NoCafRefs, Str=m1]
+[GblId, Caf=NoCafRefs, Str=m1, Unf=OtherCon []]
T7360.$tc'Foo4
= GHC.Types.KindRepTyConApp
T7360.$tcFoo (GHC.Types.[] @ GHC.Types.KindRep)
@@ -234,7 +234,7 @@ T7360.$tc'Foo2
-- RHS size: {terms: 3, types: 0, coercions: 0, joins: 0/0}
T7360.$tc'Foo9 [InlPrag=NOUSERINLINE[~]] :: GHC.Types.KindRep
-[GblId, Caf=NoCafRefs, Str=m4]
+[GblId, Caf=NoCafRefs, Str=m4, Unf=OtherCon []]
T7360.$tc'Foo9 = GHC.Types.KindRepFun $krep T7360.$tc'Foo4
-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
diff --git a/testsuite/tests/simplCore/should_compile/T9400.stderr b/testsuite/tests/simplCore/should_compile/T9400.stderr
index a8004dce8b..6ca59ca7c7 100644
--- a/testsuite/tests/simplCore/should_compile/T9400.stderr
+++ b/testsuite/tests/simplCore/should_compile/T9400.stderr
@@ -5,59 +5,59 @@ Result size of Tidy Core
-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
$trModule1 :: Addr#
-[GblId, Caf=NoCafRefs]
+[GblId, Caf=NoCafRefs, Unf=OtherCon []]
$trModule1 = "main"#
-- RHS size: {terms: 2, types: 0, coercions: 0, joins: 0/0}
$trModule2 :: TrName
-[GblId, Caf=NoCafRefs]
+[GblId, Caf=NoCafRefs, Unf=OtherCon []]
$trModule2 = GHC.Types.TrNameS $trModule1
-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
$trModule3 :: Addr#
-[GblId, Caf=NoCafRefs]
+[GblId, Caf=NoCafRefs, Unf=OtherCon []]
$trModule3 = "T9400"#
-- RHS size: {terms: 2, types: 0, coercions: 0, joins: 0/0}
$trModule4 :: TrName
-[GblId, Caf=NoCafRefs]
+[GblId, Caf=NoCafRefs, Unf=OtherCon []]
$trModule4 = GHC.Types.TrNameS $trModule3
-- RHS size: {terms: 3, types: 0, coercions: 0, joins: 0/0}
T9400.$trModule :: Module
-[GblId, Caf=NoCafRefs]
+[GblId, Caf=NoCafRefs, Unf=OtherCon []]
T9400.$trModule = GHC.Types.Module $trModule2 $trModule4
-- RHS size: {terms: 22, types: 15, coercions: 0, joins: 0/0}
main :: IO ()
[GblId]
-main =
- >>
- @ IO
- GHC.Base.$fMonadIO
- @ ()
- @ ()
- (putStrLn (unpackCString# "c"#))
- (>>
- @ IO
- GHC.Base.$fMonadIO
- @ ()
- @ ()
- (putStrLn (unpackCString# "x"#))
- (>>
- @ IO
- GHC.Base.$fMonadIO
- @ ()
- @ ()
- (putStrLn (unpackCString# "z"#))
- (>>
- @ IO
- GHC.Base.$fMonadIO
- @ ()
- @ ()
- (putStrLn (unpackCString# "efg"#))
- (Control.Exception.Base.patError
- @ 'LiftedRep @ (IO ()) "T9400.hs:(17,5)-(18,29)|case"#))))
+main
+ = >>
+ @ IO
+ GHC.Base.$fMonadIO
+ @ ()
+ @ ()
+ (putStrLn (unpackCString# "c"#))
+ (>>
+ @ IO
+ GHC.Base.$fMonadIO
+ @ ()
+ @ ()
+ (putStrLn (unpackCString# "x"#))
+ (>>
+ @ IO
+ GHC.Base.$fMonadIO
+ @ ()
+ @ ()
+ (putStrLn (unpackCString# "z"#))
+ (>>
+ @ IO
+ GHC.Base.$fMonadIO
+ @ ()
+ @ ()
+ (putStrLn (unpackCString# "efg"#))
+ (Control.Exception.Base.patError
+ @ 'LiftedRep @ (IO ()) "T9400.hs:(17,5)-(18,29)|case"#))))
diff --git a/testsuite/tests/simplCore/should_compile/spec-inline.stderr b/testsuite/tests/simplCore/should_compile/spec-inline.stderr
index 8caba3df72..13b1a9b1de 100644
--- a/testsuite/tests/simplCore/should_compile/spec-inline.stderr
+++ b/testsuite/tests/simplCore/should_compile/spec-inline.stderr
@@ -49,7 +49,7 @@ Roman.$trModule
-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
lvl :: GHC.Prim.Addr#
-[GblId, Caf=NoCafRefs]
+[GblId, Caf=NoCafRefs, Unf=OtherCon []]
lvl = "spec-inline.hs:(19,5)-(29,25)|function go"#
-- RHS size: {terms: 2, types: 2, coercions: 0, joins: 0/0}
@@ -62,7 +62,7 @@ Rec {
-- RHS size: {terms: 52, types: 6, coercions: 0, joins: 0/1}
Roman.foo_$s$wgo [Occ=LoopBreaker]
:: GHC.Prim.Int# -> GHC.Prim.Int# -> GHC.Prim.Int#
-[GblId, Arity=2, Caf=NoCafRefs, Str=<S,U><S,U>]
+[GblId, Arity=2, Caf=NoCafRefs, Str=<S,U><S,U>, Unf=OtherCon []]
Roman.foo_$s$wgo
= \ (sc :: GHC.Prim.Int#) (sc1 :: GHC.Prim.Int#) ->
let {
diff --git a/testsuite/tests/stranal/should_compile/T10694.stderr b/testsuite/tests/stranal/should_compile/T10694.stderr
index e021eb37df..90ab9475f2 100644
--- a/testsuite/tests/stranal/should_compile/T10694.stderr
+++ b/testsuite/tests/stranal/should_compile/T10694.stderr
@@ -1,75 +1,91 @@
==================== Tidy Core ====================
-Result size of Tidy Core = {terms: 70, types: 63, coercions: 0}
+Result size of Tidy Core = {terms: 74, types: 65, coercions: 0, joins: 0/4}
--- RHS size: {terms: 39, types: 25, coercions: 0}
+-- RHS size: {terms: 39, types: 25, coercions: 0, joins: 0/4}
T10694.$wpm [InlPrag=NOINLINE] :: Int -> Int -> (# Int, Int #)
-[GblId, Arity=2, Str=<L,U(U)><L,U(U)>]
-T10694.$wpm =
- \ (w_sVU :: Int) (w1_sVV :: Int) ->
- let {
- l_sUQ :: Int
- [LclId]
- l_sUQ = case w_sVU of { GHC.Types.I# x_aUi -> case w1_sVV of { GHC.Types.I# y_aUm -> GHC.Types.I# (GHC.Prim.+# x_aUi y_aUm) } } } in
- let {
- l1_sUS :: Int
- [LclId]
- l1_sUS = case w_sVU of { GHC.Types.I# x_aUs -> case w1_sVV of { GHC.Types.I# y_aUw -> GHC.Types.I# (GHC.Prim.-# x_aUs y_aUw) } } } in
- let {
- l2_sUR :: [Int]
- [LclId, Unf=OtherCon []]
- l2_sUR = GHC.Types.: @ Int l1_sUS (GHC.Types.[] @ Int) } in
- let {
- l3_sUH :: [Int]
- [LclId, Unf=OtherCon []]
- l3_sUH = GHC.Types.: @ Int l_sUQ l2_sUR } in
- (# GHC.List.$w!! @ Int l3_sUH 0#, GHC.List.$w!! @ Int l3_sUH 1# #)
+[GblId, Arity=2, Str=<L,U(U)><L,U(U)>, Unf=OtherCon []]
+T10694.$wpm
+ = \ (w_s1v7 :: Int) (w1_s1v8 :: Int) ->
+ let {
+ l_s1u8 :: Int
+ [LclId]
+ l_s1u8
+ = case w_s1v7 of { GHC.Types.I# x_a1ty -> case w1_s1v8 of { GHC.Types.I# y_a1tC -> GHC.Types.I# (GHC.Prim.+# x_a1ty y_a1tC) } } } in
+ let {
+ l1_s1u9 :: Int
+ [LclId]
+ l1_s1u9
+ = case w_s1v7 of { GHC.Types.I# x_a1tI -> case w1_s1v8 of { GHC.Types.I# y_a1tM -> GHC.Types.I# (GHC.Prim.-# x_a1tI y_a1tM) } } } in
+ let {
+ l2_s1ua :: [Int]
+ [LclId, Unf=OtherCon []]
+ l2_s1ua = GHC.Types.: @ Int l1_s1u9 (GHC.Types.[] @ Int) } in
+ let {
+ l3_s1tZ :: [Int]
+ [LclId, Unf=OtherCon []]
+ l3_s1tZ = GHC.Types.: @ Int l_s1u8 l2_s1ua } in
+ (# GHC.List.$w!! @ Int l3_s1tZ 0#, GHC.List.$w!! @ Int l3_s1tZ 1# #)
--- RHS size: {terms: 10, types: 11, coercions: 0}
-pm [InlPrag=INLINE[0]] :: Int -> Int -> (Int, Int)
+-- RHS size: {terms: 10, types: 11, coercions: 0, joins: 0/0}
+pm [InlPrag=NOUSERINLINE[0]] :: Int -> Int -> (Int, Int)
[GblId,
Arity=2,
Str=<L,U(U)><L,U(U)>m,
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_sVU [Occ=Once] :: Int) (w1_sVV [Occ=Once] :: Int) ->
- case T10694.$wpm w_sVU w1_sVV of { (# ww1_sW0 [Occ=Once], ww2_sW1 [Occ=Once] #) -> (ww1_sW0, ww2_sW1) }}]
-pm = \ (w_sVU :: Int) (w1_sVV :: Int) -> case T10694.$wpm w_sVU w1_sVV of { (# ww1_sW0, ww2_sW1 #) -> (ww1_sW0, ww2_sW1) }
+ Tmpl= \ (w_s1v7 [Occ=Once] :: Int) (w1_s1v8 [Occ=Once] :: Int) ->
+ case T10694.$wpm w_s1v7 w1_s1v8 of { (# ww1_s1vd [Occ=Once], ww2_s1ve [Occ=Once] #) -> (ww1_s1vd, ww2_s1ve) }}]
+pm = \ (w_s1v7 :: Int) (w1_s1v8 :: Int) -> case T10694.$wpm w_s1v7 w1_s1v8 of { (# ww1_s1vd, ww2_s1ve #) -> (ww1_s1vd, ww2_s1ve) }
--- RHS size: {terms: 8, types: 9, coercions: 0}
+-- RHS size: {terms: 8, types: 9, coercions: 0, joins: 0/0}
m :: Int -> Int -> Int
[GblId,
Arity=2,
Str=<L,U(U)><L,U(U)>,
Unf=Unf{Src=InlineStable, TopLvl=True, Value=True, ConLike=True, WorkFree=True, Expandable=True,
Guidance=ALWAYS_IF(arity=2,unsat_ok=True,boring_ok=False)
- Tmpl= \ (x_aCT [Occ=Once] :: Int) (y_aCU [Occ=Once] :: Int) ->
- case pm x_aCT y_aCU of { (_ [Occ=Dead], mr_aCW [Occ=Once]) -> mr_aCW }}]
-m = \ (x_aCT :: Int) (y_aCU :: Int) -> case T10694.$wpm x_aCT y_aCU of { (# ww1_sW0, ww2_sW1 #) -> ww2_sW1 }
+ Tmpl= \ (x_a12s [Occ=Once] :: Int) (y_a12t [Occ=Once] :: Int) ->
+ case pm x_a12s y_a12t of { (_ [Occ=Dead], mr_a12v [Occ=Once]) -> mr_a12v }}]
+m = \ (x_a12s :: Int) (y_a12t :: Int) -> case T10694.$wpm x_a12s y_a12t of { (# ww1_s1vd, ww2_s1ve #) -> ww2_s1ve }
--- RHS size: {terms: 2, types: 0, coercions: 0}
-T10694.$trModule2 :: GHC.Types.TrName
+-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
+T10694.$trModule4 :: GHC.Prim.Addr#
+[GblId,
+ Caf=NoCafRefs,
+ Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True, WorkFree=True, Expandable=True, Guidance=IF_ARGS [] 20 0}]
+T10694.$trModule4 = "main"#
+
+-- RHS size: {terms: 2, types: 0, coercions: 0, joins: 0/0}
+T10694.$trModule3 :: GHC.Types.TrName
[GblId,
Caf=NoCafRefs,
Str=m1,
- Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True, WorkFree=True, Expandable=True, Guidance=IF_ARGS [] 30 20}]
-T10694.$trModule2 = GHC.Types.TrNameS "main"#
+ Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True, WorkFree=True, Expandable=True, Guidance=IF_ARGS [] 10 20}]
+T10694.$trModule3 = GHC.Types.TrNameS T10694.$trModule4
+
+-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
+T10694.$trModule2 :: GHC.Prim.Addr#
+[GblId,
+ Caf=NoCafRefs,
+ Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True, WorkFree=True, Expandable=True, Guidance=IF_ARGS [] 30 0}]
+T10694.$trModule2 = "T10694"#
--- RHS size: {terms: 2, types: 0, coercions: 0}
+-- RHS size: {terms: 2, types: 0, coercions: 0, joins: 0/0}
T10694.$trModule1 :: GHC.Types.TrName
[GblId,
Caf=NoCafRefs,
Str=m1,
- Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True, WorkFree=True, Expandable=True, Guidance=IF_ARGS [] 40 20}]
-T10694.$trModule1 = GHC.Types.TrNameS "T10694"#
+ Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True, WorkFree=True, Expandable=True, Guidance=IF_ARGS [] 10 20}]
+T10694.$trModule1 = GHC.Types.TrNameS T10694.$trModule2
--- RHS size: {terms: 3, types: 0, coercions: 0}
+-- RHS size: {terms: 3, types: 0, coercions: 0, joins: 0/0}
T10694.$trModule :: GHC.Types.Module
[GblId,
Caf=NoCafRefs,
Str=m,
Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True, WorkFree=True, Expandable=True, Guidance=IF_ARGS [] 10 30}]
-T10694.$trModule = GHC.Types.Module T10694.$trModule2 T10694.$trModule1
+T10694.$trModule = GHC.Types.Module T10694.$trModule3 T10694.$trModule1