diff options
author | Sylvain Henry <sylvain@haskus.fr> | 2021-09-16 11:27:52 +0200 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2021-09-28 01:53:01 -0400 |
commit | 45a674aacf33dc47c48506b834752d59fffd7e2c (patch) | |
tree | 86288ea42f9735d58f623525795d797ccc689fa2 | |
parent | e38facf85200ea97ca107caefd1b17252639bc18 (diff) | |
download | haskell-45a674aacf33dc47c48506b834752d59fffd7e2c.tar.gz |
Add `-dsuppress-core-sizes` flag (#20342)
This flag is used to remove the output of core stats per binding in Core
dumps.
25 files changed, 201 insertions, 8 deletions
diff --git a/compiler/GHC/Core/Lint.hs b/compiler/GHC/Core/Lint.hs index 9fdccffc40..8854086d53 100644 --- a/compiler/GHC/Core/Lint.hs +++ b/compiler/GHC/Core/Lint.hs @@ -285,10 +285,11 @@ endPassIO :: HscEnv -> PrintUnqualified -> CoreToDo -> CoreProgram -> [CoreRule] -> IO () -- Used by the IO-is CorePrep too endPassIO hsc_env print_unqual pass binds rules - = do { dumpPassResult logger print_unqual mb_flag + = do { dumpPassResult logger dump_core_sizes print_unqual mb_flag (showSDoc dflags (ppr pass)) (pprPassDetails pass) binds rules ; lintPassResult hsc_env pass binds } where + dump_core_sizes = not (gopt Opt_SuppressCoreSizes dflags) logger = hsc_logger hsc_env dflags = hsc_dflags hsc_env mb_flag = case coreDumpFlag pass of @@ -297,6 +298,7 @@ endPassIO hsc_env print_unqual pass binds rules _ -> Nothing dumpPassResult :: Logger + -> Bool -- dump core sizes? -> PrintUnqualified -> Maybe DumpFlag -- Just df => show details in a file whose -- name is specified by df @@ -304,7 +306,7 @@ dumpPassResult :: Logger -> SDoc -- Extra info to appear after header -> CoreProgram -> [CoreRule] -> IO () -dumpPassResult logger unqual mb_flag hdr extra_info binds rules +dumpPassResult logger dump_core_sizes unqual mb_flag hdr extra_info binds rules = do { forM_ mb_flag $ \flag -> do logDumpFile logger (mkDumpStyle unqual) flag hdr FormatCore dump_doc @@ -320,7 +322,7 @@ dumpPassResult logger unqual mb_flag hdr extra_info binds rules dump_doc = vcat [ nest 2 extra_info , size_doc , blankLine - , if logHasDumpFlag logger Opt_D_dump_core_stats + , if dump_core_sizes then pprCoreBindingsWithSize binds else pprCoreBindings binds , ppUnless (null rules) pp_rules ] diff --git a/compiler/GHC/Core/Opt/Pipeline.hs b/compiler/GHC/Core/Opt/Pipeline.hs index 77a34a9619..ad7905ee27 100644 --- a/compiler/GHC/Core/Opt/Pipeline.hs +++ b/compiler/GHC/Core/Opt/Pipeline.hs @@ -763,7 +763,8 @@ simplifyPgmIO pass@(CoreDoSimplify max_iterations mode) let { binds2 = {-# SCC "ZapInd" #-} shortOutIndirections binds1 } ; -- Dump the result of this iteration - dump_end_iteration logger print_unqual iteration_no counts1 binds2 rules1 ; + let { dump_core_sizes = not (gopt Opt_SuppressCoreSizes dflags) } ; + dump_end_iteration logger dump_core_sizes print_unqual iteration_no counts1 binds2 rules1 ; lintPassResult hsc_env pass binds2 ; -- Loop @@ -781,10 +782,10 @@ simplifyPgmIO pass@(CoreDoSimplify max_iterations mode) simplifyPgmIO _ _ _ _ = panic "simplifyPgmIO" ------------------- -dump_end_iteration :: Logger -> PrintUnqualified -> Int +dump_end_iteration :: Logger -> Bool -> PrintUnqualified -> Int -> SimplCount -> CoreProgram -> [CoreRule] -> IO () -dump_end_iteration logger print_unqual iteration_no counts binds rules - = dumpPassResult logger print_unqual mb_flag hdr pp_counts binds rules +dump_end_iteration logger dump_core_sizes print_unqual iteration_no counts binds rules + = dumpPassResult logger dump_core_sizes print_unqual mb_flag hdr pp_counts binds rules where mb_flag | logHasDumpFlag logger Opt_D_dump_simpl_iterations = Just Opt_D_dump_simpl_iterations | otherwise = Nothing diff --git a/compiler/GHC/Driver/Flags.hs b/compiler/GHC/Driver/Flags.hs index a63935795e..e0ddaff52b 100644 --- a/compiler/GHC/Driver/Flags.hs +++ b/compiler/GHC/Driver/Flags.hs @@ -354,6 +354,7 @@ data GeneralFlag | Opt_SuppressStgExts | Opt_SuppressTicks -- Replaces Opt_PprShowTicks | Opt_SuppressTimestamps -- ^ Suppress timestamps in dumps + | Opt_SuppressCoreSizes -- ^ Suppress per binding Core size stats in dumps -- temporary flags | Opt_AutoLinkPackages diff --git a/compiler/GHC/Driver/Session.hs b/compiler/GHC/Driver/Session.hs index b12b448021..f69f2da243 100644 --- a/compiler/GHC/Driver/Session.hs +++ b/compiler/GHC/Driver/Session.hs @@ -2350,6 +2350,7 @@ dynamic_flags_deps = [ setGeneralFlag Opt_SuppressTicks setGeneralFlag Opt_SuppressStgExts setGeneralFlag Opt_SuppressTypeSignatures + setGeneralFlag Opt_SuppressCoreSizes setGeneralFlag Opt_SuppressTimestamps) ------ Debugging ---------------------------------------------------- @@ -3268,7 +3269,8 @@ dFlagsDeps = [ flagSpec "suppress-type-applications" Opt_SuppressTypeApplications, flagSpec "suppress-type-signatures" Opt_SuppressTypeSignatures, flagSpec "suppress-uniques" Opt_SuppressUniques, - flagSpec "suppress-var-kinds" Opt_SuppressVarKinds + flagSpec "suppress-var-kinds" Opt_SuppressVarKinds, + flagSpec "suppress-core-sizes" Opt_SuppressCoreSizes ] -- | These @-f\<blah\>@ flags can all be reversed with @-fno-\<blah\>@ diff --git a/docs/users_guide/debugging.rst b/docs/users_guide/debugging.rst index f9e6946b20..b9dcdb4a47 100644 --- a/docs/users_guide/debugging.rst +++ b/docs/users_guide/debugging.rst @@ -860,6 +860,14 @@ parts that you are not interested in. Suppress the printing of closure free variable lists in STG output +.. ghc-flag:: -dsuppress-core-sizes + :shortdesc: Suppress the printing of core size stats per binding (since 9.4) + :type: dynamic + + :since: 9.4.1 + + Suppress the printing of core size stats per binding + .. _checking-consistency: diff --git a/testsuite/tests/deSugar/should_compile/T16615.stderr b/testsuite/tests/deSugar/should_compile/T16615.stderr index 85d6ea2f5c..0a758bb046 100644 --- a/testsuite/tests/deSugar/should_compile/T16615.stderr +++ b/testsuite/tests/deSugar/should_compile/T16615.stderr @@ -3,6 +3,7 @@ Result size of Desugar (after optimization) = {terms: 36, types: 13, coercions: 0, joins: 0/0} +-- RHS size: {terms: 5, types: 0, coercions: 0, joins: 0/0} T16615.$trModule :: GHC.Types.Module [LclIdX, Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True, @@ -12,6 +13,7 @@ T16615.$trModule (GHC.Types.TrNameS "main"#) (GHC.Types.TrNameS "T16615"#) Rec { +-- RHS size: {terms: 14, types: 4, coercions: 0, joins: 0/0} g :: Int -> Bool [LclIdX, Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True, @@ -22,6 +24,7 @@ g = \ (i :: Int) -> True -> GHC.Types.False } +-- RHS size: {terms: 14, types: 4, coercions: 0, joins: 0/0} f [Occ=LoopBreaker] :: Int -> Bool [LclIdX, Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True, diff --git a/testsuite/tests/deSugar/should_compile/T19969.stderr b/testsuite/tests/deSugar/should_compile/T19969.stderr index 2a780e1a3b..5e23785472 100644 --- a/testsuite/tests/deSugar/should_compile/T19969.stderr +++ b/testsuite/tests/deSugar/should_compile/T19969.stderr @@ -4,11 +4,13 @@ Result size of Tidy Core = {terms: 12, types: 18, coercions: 0, joins: 0/0} Rec { +-- RHS size: {terms: 3, types: 2, coercions: 0, joins: 0/0} f [Occ=LoopBreaker] :: [Int] -> [Int] [GblId, Arity=1, Str=<B>b, Cpr=b, Unf=OtherCon []] f = \ (x :: [Int]) -> f x end Rec } +-- RHS size: {terms: 3, types: 2, coercions: 0, joins: 0/0} g [InlPrag=INLINE (sat-args=1)] :: [Int] -> [Int] [GblId, Arity=1, @@ -20,6 +22,7 @@ g [InlPrag=INLINE (sat-args=1)] :: [Int] -> [Int] Tmpl= \ (x [Occ=Once1] :: [Int]) -> f x}] g = \ (x :: [Int]) -> f x +-- RHS size: {terms: 3, types: 2, coercions: 0, joins: 0/0} h [InlPrag=INLINE (sat-args=1)] :: [Int] -> [Int] [GblId, Arity=1, diff --git a/testsuite/tests/deSugar/should_compile/T2431.stderr b/testsuite/tests/deSugar/should_compile/T2431.stderr index 81c85edb6b..8b3f8a53b6 100644 --- a/testsuite/tests/deSugar/should_compile/T2431.stderr +++ b/testsuite/tests/deSugar/should_compile/T2431.stderr @@ -3,6 +3,7 @@ Result size of Tidy Core = {terms: 63, types: 39, coercions: 1, joins: 0/0} +-- RHS size: {terms: 2, types: 3, coercions: 1, joins: 0/0} T2431.$WRefl [InlPrag=INLINE[final] CONLIKE] :: forall a. a :~: a [GblId[DataConWrapper], Caf=NoCafRefs, @@ -14,42 +15,52 @@ T2431.$WRefl [InlPrag=INLINE[final] CONLIKE] :: forall a. a :~: a T2431.$WRefl = \ (@a) -> T2431.Refl @a @a @~(<a>_N :: a GHC.Prim.~# a) +-- RHS size: {terms: 4, types: 7, coercions: 0, joins: 0/0} absurd :: forall a. (Int :~: Bool) -> a [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} $trModule1 :: GHC.Prim.Addr# [GblId, Unf=OtherCon []] $trModule1 = "main"# +-- RHS size: {terms: 2, types: 0, coercions: 0, joins: 0/0} $trModule2 :: GHC.Types.TrName [GblId, Unf=OtherCon []] $trModule2 = GHC.Types.TrNameS $trModule1 +-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0} $trModule3 :: GHC.Prim.Addr# [GblId, Unf=OtherCon []] $trModule3 = "T2431"# +-- RHS size: {terms: 2, types: 0, coercions: 0, joins: 0/0} $trModule4 :: GHC.Types.TrName [GblId, Unf=OtherCon []] $trModule4 = GHC.Types.TrNameS $trModule3 +-- RHS size: {terms: 3, types: 0, coercions: 0, joins: 0/0} T2431.$trModule :: GHC.Types.Module [GblId, 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, Unf=OtherCon []] $krep = GHC.Types.KindRepVar 0# +-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0} $tc:~:1 :: GHC.Prim.Addr# [GblId, Unf=OtherCon []] $tc:~:1 = ":~:"# +-- RHS size: {terms: 2, types: 0, coercions: 0, joins: 0/0} $tc:~:2 :: GHC.Types.TrName [GblId, 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, Unf=OtherCon []] T2431.$tc:~: @@ -61,28 +72,34 @@ T2431.$tc:~: 0# GHC.Types.krep$*->*->* +-- RHS size: {terms: 3, types: 2, coercions: 0, joins: 0/0} $krep1 :: [GHC.Types.KindRep] [GblId, 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, 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, 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, Unf=OtherCon []] $tc'Refl1 = "'Refl"# +-- RHS size: {terms: 2, types: 0, coercions: 0, joins: 0/0} $tc'Refl2 :: GHC.Types.TrName [GblId, 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, Unf=OtherCon []] T2431.$tc'Refl diff --git a/testsuite/tests/deriving/should_compile/T17339.stderr b/testsuite/tests/deriving/should_compile/T17339.stderr index 0a377e6ba9..496ec84d88 100644 --- a/testsuite/tests/deriving/should_compile/T17339.stderr +++ b/testsuite/tests/deriving/should_compile/T17339.stderr @@ -3,15 +3,19 @@ Result size of Tidy Core = {terms: 8, types: 20, coercions: 0, joins: 0/0} +-- RHS size: {terms: 1, types: 2, coercions: 0, joins: 0/0} T17339.$fClsA1B1 :: Cls A1 B1 T17339.$fClsA1B1 = T17339.C:Cls @A1 @B1 +-- RHS size: {terms: 1, types: 2, coercions: 0, joins: 0/0} T17339.$fClsA2B1 :: Cls A2 B1 T17339.$fClsA2B1 = T17339.C:Cls @A2 @B1 +-- RHS size: {terms: 1, types: 2, coercions: 0, joins: 0/0} T17339.$fClsA1B2 :: Cls A1 B2 T17339.$fClsA1B2 = T17339.C:Cls @A1 @B2 +-- RHS size: {terms: 1, types: 2, coercions: 0, joins: 0/0} T17339.$fClsA2B2 :: Cls A2 B2 T17339.$fClsA2B2 = T17339.C:Cls @A2 @B2 diff --git a/testsuite/tests/numeric/should_compile/T14170.stdout b/testsuite/tests/numeric/should_compile/T14170.stdout index 89e0f1b461..286d60bc0a 100644 --- a/testsuite/tests/numeric/should_compile/T14170.stdout +++ b/testsuite/tests/numeric/should_compile/T14170.stdout @@ -3,30 +3,35 @@ Result size of Tidy Core = {terms: 17, types: 6, coercions: 0, joins: 0/0} +-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0} NatVal.$trModule4 :: GHC.Prim.Addr# [GblId, Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True, WorkFree=True, Expandable=True, Guidance=IF_ARGS [] 20 0}] NatVal.$trModule4 = "main"# +-- RHS size: {terms: 2, types: 0, coercions: 0, joins: 0/0} NatVal.$trModule3 :: GHC.Types.TrName [GblId, Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True, WorkFree=True, Expandable=True, Guidance=IF_ARGS [] 10 10}] NatVal.$trModule3 = GHC.Types.TrNameS NatVal.$trModule4 +-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0} NatVal.$trModule2 :: GHC.Prim.Addr# [GblId, Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True, WorkFree=True, Expandable=True, Guidance=IF_ARGS [] 30 0}] NatVal.$trModule2 = "NatVal"# +-- RHS size: {terms: 2, types: 0, coercions: 0, joins: 0/0} NatVal.$trModule1 :: GHC.Types.TrName [GblId, Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True, WorkFree=True, Expandable=True, Guidance=IF_ARGS [] 10 10}] NatVal.$trModule1 = GHC.Types.TrNameS NatVal.$trModule2 +-- RHS size: {terms: 3, types: 0, coercions: 0, joins: 0/0} NatVal.$trModule :: GHC.Types.Module [GblId, Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True, @@ -34,6 +39,7 @@ NatVal.$trModule :: GHC.Types.Module NatVal.$trModule = GHC.Types.Module NatVal.$trModule3 NatVal.$trModule1 +-- RHS size: {terms: 2, types: 0, coercions: 0, joins: 0/0} foo :: Integer [GblId, Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True, diff --git a/testsuite/tests/numeric/should_compile/T14465.stdout b/testsuite/tests/numeric/should_compile/T14465.stdout index de0c34607d..c672fdf3e0 100644 --- a/testsuite/tests/numeric/should_compile/T14465.stdout +++ b/testsuite/tests/numeric/should_compile/T14465.stdout @@ -3,48 +3,56 @@ Result size of Tidy Core = {terms: 37, types: 14, coercions: 0, joins: 0/0} +-- RHS size: {terms: 2, types: 0, coercions: 0, joins: 0/0} ten :: Natural [GblId, Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True, WorkFree=True, Expandable=True, Guidance=IF_ARGS [] 10 10}] ten = GHC.Num.Natural.NS 10## +-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0} M.$trModule4 :: GHC.Prim.Addr# [GblId, Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True, WorkFree=True, Expandable=True, Guidance=IF_ARGS [] 20 0}] M.$trModule4 = "main"# +-- RHS size: {terms: 2, types: 0, coercions: 0, joins: 0/0} M.$trModule3 :: GHC.Types.TrName [GblId, Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True, WorkFree=True, Expandable=True, Guidance=IF_ARGS [] 10 10}] M.$trModule3 = GHC.Types.TrNameS M.$trModule4 +-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0} M.$trModule2 :: GHC.Prim.Addr# [GblId, Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True, WorkFree=True, Expandable=True, Guidance=IF_ARGS [] 20 0}] M.$trModule2 = "M"# +-- RHS size: {terms: 2, types: 0, coercions: 0, joins: 0/0} M.$trModule1 :: GHC.Types.TrName [GblId, Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True, WorkFree=True, Expandable=True, Guidance=IF_ARGS [] 10 10}] M.$trModule1 = GHC.Types.TrNameS M.$trModule2 +-- RHS size: {terms: 3, types: 0, coercions: 0, joins: 0/0} M.$trModule :: GHC.Types.Module [GblId, Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True, WorkFree=True, Expandable=True, Guidance=IF_ARGS [] 10 10}] M.$trModule = GHC.Types.Module M.$trModule3 M.$trModule1 +-- RHS size: {terms: 2, types: 0, coercions: 0, joins: 0/0} M.minusOne1 :: Natural [GblId, Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True, WorkFree=True, Expandable=True, Guidance=IF_ARGS [] 10 10}] M.minusOne1 = GHC.Num.Natural.NS 1## +-- RHS size: {terms: 6, types: 1, coercions: 0, joins: 0/0} minusOne :: Natural [GblId, Unf=Unf{Src=<vanilla>, TopLvl=True, Value=False, ConLike=False, @@ -55,12 +63,14 @@ minusOne GHC.Num.Natural.NS ww } +-- RHS size: {terms: 2, types: 0, coercions: 0, joins: 0/0} twoTimesTwo :: Natural [GblId, Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True, WorkFree=True, Expandable=True, Guidance=IF_ARGS [] 10 10}] twoTimesTwo = GHC.Num.Natural.NS 4## +-- RHS size: {terms: 4, types: 1, coercions: 0, joins: 0/0} plusOne :: Natural -> Natural [GblId, Arity=1, @@ -69,6 +79,7 @@ plusOne :: Natural -> Natural WorkFree=True, Expandable=True, Guidance=IF_ARGS [0] 30 0}] plusOne = \ (n :: Natural) -> naturalAdd n M.minusOne1 +-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0} one :: Natural [GblId, Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True, diff --git a/testsuite/tests/numeric/should_compile/T7116.stdout b/testsuite/tests/numeric/should_compile/T7116.stdout index 46303cf207..ad3878e35a 100644 --- a/testsuite/tests/numeric/should_compile/T7116.stdout +++ b/testsuite/tests/numeric/should_compile/T7116.stdout @@ -3,30 +3,35 @@ Result size of Tidy Core = {terms: 36, types: 19, coercions: 0, joins: 0/0} +-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0} T7116.$trModule4 :: GHC.Prim.Addr# [GblId, Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True, WorkFree=True, Expandable=True, Guidance=IF_ARGS [] 20 0}] T7116.$trModule4 = "main"# +-- RHS size: {terms: 2, types: 0, coercions: 0, joins: 0/0} T7116.$trModule3 :: GHC.Types.TrName [GblId, Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True, WorkFree=True, Expandable=True, Guidance=IF_ARGS [] 10 10}] T7116.$trModule3 = GHC.Types.TrNameS T7116.$trModule4 +-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0} T7116.$trModule2 :: GHC.Prim.Addr# [GblId, Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True, WorkFree=True, Expandable=True, Guidance=IF_ARGS [] 30 0}] T7116.$trModule2 = "T7116"# +-- RHS size: {terms: 2, types: 0, coercions: 0, joins: 0/0} T7116.$trModule1 :: GHC.Types.TrName [GblId, Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True, WorkFree=True, Expandable=True, Guidance=IF_ARGS [] 10 10}] T7116.$trModule1 = GHC.Types.TrNameS T7116.$trModule2 +-- RHS size: {terms: 3, types: 0, coercions: 0, joins: 0/0} T7116.$trModule :: GHC.Types.Module [GblId, Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True, @@ -34,6 +39,7 @@ T7116.$trModule :: GHC.Types.Module T7116.$trModule = GHC.Types.Module T7116.$trModule3 T7116.$trModule1 +-- RHS size: {terms: 8, types: 3, coercions: 0, joins: 0/0} dr :: Double -> Double [GblId, Arity=1, @@ -50,6 +56,7 @@ dr = \ (x :: Double) -> case x of { GHC.Types.D# x1 -> GHC.Types.D# (GHC.Prim.+## x1 x1) } +-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0} dl :: Double -> Double [GblId, Arity=1, @@ -60,6 +67,7 @@ dl :: Double -> Double Guidance=ALWAYS_IF(arity=0,unsat_ok=True,boring_ok=True)}] dl = dr +-- RHS size: {terms: 8, types: 3, coercions: 0, joins: 0/0} fr :: Float -> Float [GblId, Arity=1, @@ -78,6 +86,7 @@ fr GHC.Types.F# (GHC.Prim.plusFloat# x1 x1) } +-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0} fl :: Float -> Float [GblId, Arity=1, diff --git a/testsuite/tests/printer/T18052a.stderr b/testsuite/tests/printer/T18052a.stderr index 8ab68dc556..7b7ccfa571 100644 --- a/testsuite/tests/printer/T18052a.stderr +++ b/testsuite/tests/printer/T18052a.stderr @@ -12,14 +12,17 @@ Dependent packages: [base-4.16.0.0] Result size of Tidy Core = {terms: 24, types: 52, coercions: 0, joins: 0/0} +-- RHS size: {terms: 7, types: 6, coercions: 0, joins: 0/0} T18052a.$b:||: :: forall {a} {b}. a -> b -> (a, b) [GblId, Arity=2, Unf=OtherCon []] T18052a.$b:||: = \ (@a) (@b) (x :: a) (y :: b) -> (x, y) +-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0} (+++) :: forall {a}. [a] -> [a] -> [a] [GblId] (+++) = ++ +-- RHS size: {terms: 13, types: 18, coercions: 0, joins: 0/0} T18052a.$m:||: :: forall {rep :: GHC.Types.RuntimeRep} {r :: TYPE rep} {a} {b}. (a, b) -> (a -> b -> r) -> ((# #) -> r) -> r diff --git a/testsuite/tests/roles/should_compile/Roles13.stderr b/testsuite/tests/roles/should_compile/Roles13.stderr index 69326bd52d..1a5a04b37f 100644 --- a/testsuite/tests/roles/should_compile/Roles13.stderr +++ b/testsuite/tests/roles/should_compile/Roles13.stderr @@ -3,10 +3,12 @@ Result size of Tidy Core = {terms: 98, types: 38, coercions: 6, joins: 0/0} +-- RHS size: {terms: 2, types: 2, coercions: 0, joins: 0/0} convert1 :: Wrap Age -> Wrap Age [GblId, Arity=1, Unf=OtherCon []] convert1 = \ (ds :: Wrap Age) -> ds +-- RHS size: {terms: 1, types: 0, coercions: 6, joins: 0/0} convert :: Wrap Age -> Int [GblId, Arity=1, Unf=OtherCon []] convert @@ -15,44 +17,54 @@ convert %<'Many>_N ->_R Roles13.N:Wrap[0] (Roles13.N:Age[0]) :: (Wrap Age -> Wrap Age) ~R# (Wrap Age -> Int)) +-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0} $trModule1 :: GHC.Prim.Addr# [GblId, Unf=OtherCon []] $trModule1 = "main"# +-- RHS size: {terms: 2, types: 0, coercions: 0, joins: 0/0} $trModule2 :: GHC.Types.TrName [GblId, Unf=OtherCon []] $trModule2 = GHC.Types.TrNameS $trModule1 +-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0} $trModule3 :: GHC.Prim.Addr# [GblId, Unf=OtherCon []] $trModule3 = "Roles13"# +-- RHS size: {terms: 2, types: 0, coercions: 0, joins: 0/0} $trModule4 :: GHC.Types.TrName [GblId, Unf=OtherCon []] $trModule4 = GHC.Types.TrNameS $trModule3 +-- RHS size: {terms: 3, types: 0, coercions: 0, joins: 0/0} Roles13.$trModule :: GHC.Types.Module [GblId, 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, 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, Unf=OtherCon []] $krep1 = GHC.Types.KindRepVar 0# +-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0} $tcAge1 :: GHC.Prim.Addr# [GblId, Unf=OtherCon []] $tcAge1 = "Age"# +-- RHS size: {terms: 2, types: 0, coercions: 0, joins: 0/0} $tcAge2 :: GHC.Types.TrName [GblId, Unf=OtherCon []] $tcAge2 = GHC.Types.TrNameS $tcAge1 +-- RHS size: {terms: 7, types: 0, coercions: 0, joins: 0/0} Roles13.$tcAge :: GHC.Types.TyCon [GblId, Unf=OtherCon []] Roles13.$tcAge @@ -64,24 +76,29 @@ Roles13.$tcAge 0# GHC.Types.krep$* +-- RHS size: {terms: 3, types: 1, coercions: 0, joins: 0/0} $krep2 :: GHC.Types.KindRep [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, 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, Unf=OtherCon []] $tc'MkAge1 = "'MkAge"# +-- RHS size: {terms: 2, types: 0, coercions: 0, joins: 0/0} $tc'MkAge2 :: GHC.Types.TrName [GblId, 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, Unf=OtherCon []] Roles13.$tc'MkAge @@ -93,14 +110,17 @@ Roles13.$tc'MkAge 0# $krep3 +-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0} $tcWrap1 :: GHC.Prim.Addr# [GblId, Unf=OtherCon []] $tcWrap1 = "Wrap"# +-- RHS size: {terms: 2, types: 0, coercions: 0, joins: 0/0} $tcWrap2 :: GHC.Types.TrName [GblId, Unf=OtherCon []] $tcWrap2 = GHC.Types.TrNameS $tcWrap1 +-- RHS size: {terms: 7, types: 0, coercions: 0, joins: 0/0} Roles13.$tcWrap :: GHC.Types.TyCon [GblId, Unf=OtherCon []] Roles13.$tcWrap @@ -112,28 +132,34 @@ Roles13.$tcWrap 0# GHC.Types.krep$*Arr* +-- RHS size: {terms: 3, types: 2, coercions: 0, joins: 0/0} $krep4 :: [GHC.Types.KindRep] [GblId, 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, 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, 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, Unf=OtherCon []] $tc'MkWrap1 = "'MkWrap"# +-- RHS size: {terms: 2, types: 0, coercions: 0, joins: 0/0} $tc'MkWrap2 :: GHC.Types.TrName [GblId, 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, Unf=OtherCon []] Roles13.$tc'MkWrap diff --git a/testsuite/tests/simplCore/should_compile/T13143.stderr b/testsuite/tests/simplCore/should_compile/T13143.stderr index 590d9fafdb..c4c2db7462 100644 --- a/testsuite/tests/simplCore/should_compile/T13143.stderr +++ b/testsuite/tests/simplCore/should_compile/T13143.stderr @@ -4,12 +4,14 @@ Result size of Tidy Core = {terms: 71, types: 40, coercions: 0, joins: 0/0} Rec { +-- RHS size: {terms: 4, types: 3, coercions: 0, joins: 0/0} T13143.$wf [InlPrag=NOINLINE, Occ=LoopBreaker] :: forall {a}. (# #) -> a [GblId, Arity=1, Str=<B>b, Cpr=b, Unf=OtherCon []] T13143.$wf = \ (@a) _ [Occ=Dead] -> T13143.$wf @a GHC.Prim.(##) end Rec } +-- RHS size: {terms: 4, types: 3, coercions: 0, joins: 0/0} f [InlPrag=[final]] :: forall a. Int -> a [GblId, Arity=1, @@ -21,30 +23,35 @@ f [InlPrag=[final]] :: forall a. Int -> a Tmpl= \ (@a) _ [Occ=Dead] -> T13143.$wf @a GHC.Prim.(##)}] f = \ (@a) _ [Occ=Dead] -> T13143.$wf @a GHC.Prim.(##) +-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0} T13143.$trModule4 :: GHC.Prim.Addr# [GblId, Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True, WorkFree=True, Expandable=True, Guidance=IF_ARGS [] 20 0}] T13143.$trModule4 = "main"# +-- RHS size: {terms: 2, types: 0, coercions: 0, joins: 0/0} T13143.$trModule3 :: GHC.Types.TrName [GblId, Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True, WorkFree=True, Expandable=True, Guidance=IF_ARGS [] 10 10}] T13143.$trModule3 = GHC.Types.TrNameS T13143.$trModule4 +-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0} T13143.$trModule2 :: GHC.Prim.Addr# [GblId, Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True, WorkFree=True, Expandable=True, Guidance=IF_ARGS [] 30 0}] T13143.$trModule2 = "T13143"# +-- RHS size: {terms: 2, types: 0, coercions: 0, joins: 0/0} T13143.$trModule1 :: GHC.Types.TrName [GblId, Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True, WorkFree=True, Expandable=True, Guidance=IF_ARGS [] 10 10}] T13143.$trModule1 = GHC.Types.TrNameS T13143.$trModule2 +-- RHS size: {terms: 3, types: 0, coercions: 0, joins: 0/0} T13143.$trModule :: GHC.Types.Module [GblId, Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True, @@ -52,11 +59,13 @@ T13143.$trModule :: GHC.Types.Module T13143.$trModule = GHC.Types.Module T13143.$trModule3 T13143.$trModule1 +-- RHS size: {terms: 2, types: 1, coercions: 0, joins: 0/0} lvl :: Int [GblId, Str=b, Cpr=b] lvl = T13143.$wf @Int GHC.Prim.(##) 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=<1L><1L><L>, Unf=OtherCon []] @@ -76,6 +85,7 @@ T13143.$wg } end Rec } +-- RHS size: {terms: 14, types: 6, coercions: 0, joins: 0/0} g [InlPrag=[2]] :: Bool -> Bool -> Int -> Int [GblId, Arity=3, diff --git a/testsuite/tests/simplCore/should_compile/T18013.stderr b/testsuite/tests/simplCore/should_compile/T18013.stderr index ef460a3504..5fe7eec578 100644 --- a/testsuite/tests/simplCore/should_compile/T18013.stderr +++ b/testsuite/tests/simplCore/should_compile/T18013.stderr @@ -133,6 +133,7 @@ Rule fired: Class op fmap (BUILTIN) Result size of Tidy Core = {terms: 52, types: 102, coercions: 17, joins: 0/1} +-- RHS size: {terms: 37, types: 85, coercions: 17, joins: 0/1} mapMaybeRule [InlPrag=[2]] :: forall a b. Rule IO a b -> Rule IO (Maybe a) (Maybe b) [GblId, @@ -215,30 +216,35 @@ mapMaybeRule ~R# (s -> Maybe a -> IO (Result s (Maybe b)))) } +-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0} T18013.$trModule4 :: GHC.Prim.Addr# [GblId, Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True, WorkFree=True, Expandable=True, Guidance=IF_ARGS [] 20 0}] T18013.$trModule4 = "main"# +-- RHS size: {terms: 2, types: 0, coercions: 0, joins: 0/0} T18013.$trModule3 :: GHC.Types.TrName [GblId, Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True, WorkFree=True, Expandable=True, Guidance=IF_ARGS [] 10 10}] T18013.$trModule3 = GHC.Types.TrNameS T18013.$trModule4 +-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0} T18013.$trModule2 :: GHC.Prim.Addr# [GblId, Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True, WorkFree=True, Expandable=True, Guidance=IF_ARGS [] 30 0}] T18013.$trModule2 = "T18013"# +-- RHS size: {terms: 2, types: 0, coercions: 0, joins: 0/0} T18013.$trModule1 :: GHC.Types.TrName [GblId, Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True, WorkFree=True, Expandable=True, Guidance=IF_ARGS [] 10 10}] T18013.$trModule1 = GHC.Types.TrNameS T18013.$trModule2 +-- RHS size: {terms: 3, types: 0, coercions: 0, joins: 0/0} T18013.$trModule :: GHC.Types.Module [GblId, Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True, diff --git a/testsuite/tests/simplCore/should_compile/T3717.stderr b/testsuite/tests/simplCore/should_compile/T3717.stderr index 936c52f5cc..bd6417b729 100644 --- a/testsuite/tests/simplCore/should_compile/T3717.stderr +++ b/testsuite/tests/simplCore/should_compile/T3717.stderr @@ -3,30 +3,35 @@ Result size of Tidy Core = {terms: 36, types: 15, coercions: 0, joins: 0/0} +-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0} T3717.$trModule4 :: GHC.Prim.Addr# [GblId, Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True, WorkFree=True, Expandable=True, Guidance=IF_ARGS [] 20 0}] T3717.$trModule4 = "main"# +-- RHS size: {terms: 2, types: 0, coercions: 0, joins: 0/0} T3717.$trModule3 :: GHC.Types.TrName [GblId, Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True, WorkFree=True, Expandable=True, Guidance=IF_ARGS [] 10 10}] T3717.$trModule3 = GHC.Types.TrNameS T3717.$trModule4 +-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0} T3717.$trModule2 :: GHC.Prim.Addr# [GblId, Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True, WorkFree=True, Expandable=True, Guidance=IF_ARGS [] 30 0}] T3717.$trModule2 = "T3717"# +-- RHS size: {terms: 2, types: 0, coercions: 0, joins: 0/0} T3717.$trModule1 :: GHC.Types.TrName [GblId, Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True, WorkFree=True, Expandable=True, Guidance=IF_ARGS [] 10 10}] T3717.$trModule1 = GHC.Types.TrNameS T3717.$trModule2 +-- RHS size: {terms: 3, types: 0, coercions: 0, joins: 0/0} T3717.$trModule :: GHC.Types.Module [GblId, Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True, @@ -35,6 +40,7 @@ T3717.$trModule = GHC.Types.Module T3717.$trModule3 T3717.$trModule1 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=<1L>, Unf=OtherCon []] @@ -46,6 +52,7 @@ T3717.$wfoo } end Rec } +-- RHS size: {terms: 10, types: 4, coercions: 0, joins: 0/0} foo [InlPrag=[2]] :: Int -> Int [GblId, Arity=1, diff --git a/testsuite/tests/simplCore/should_compile/T3772.stdout b/testsuite/tests/simplCore/should_compile/T3772.stdout index 530c98b94d..abf4b8db14 100644 --- a/testsuite/tests/simplCore/should_compile/T3772.stdout +++ b/testsuite/tests/simplCore/should_compile/T3772.stdout @@ -3,30 +3,35 @@ Result size of Tidy Core = {terms: 43, types: 18, coercions: 0, joins: 0/0} +-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0} T3772.$trModule4 :: GHC.Prim.Addr# [GblId, Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True, WorkFree=True, Expandable=True, Guidance=IF_ARGS [] 20 0}] T3772.$trModule4 = "main"# +-- RHS size: {terms: 2, types: 0, coercions: 0, joins: 0/0} T3772.$trModule3 :: GHC.Types.TrName [GblId, Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True, WorkFree=True, Expandable=True, Guidance=IF_ARGS [] 10 10}] T3772.$trModule3 = GHC.Types.TrNameS T3772.$trModule4 +-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0} T3772.$trModule2 :: GHC.Prim.Addr# [GblId, Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True, WorkFree=True, Expandable=True, Guidance=IF_ARGS [] 30 0}] T3772.$trModule2 = "T3772"# +-- RHS size: {terms: 2, types: 0, coercions: 0, joins: 0/0} T3772.$trModule1 :: GHC.Types.TrName [GblId, Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True, WorkFree=True, Expandable=True, Guidance=IF_ARGS [] 10 10}] T3772.$trModule1 = GHC.Types.TrNameS T3772.$trModule2 +-- RHS size: {terms: 3, types: 0, coercions: 0, joins: 0/0} T3772.$trModule :: GHC.Types.Module [GblId, Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True, @@ -35,6 +40,7 @@ T3772.$trModule = GHC.Types.Module T3772.$trModule3 T3772.$trModule1 Rec { +-- RHS size: {terms: 10, types: 2, coercions: 0, joins: 0/0} $wxs :: GHC.Prim.Int# -> () [GblId, Arity=1, Str=<1L>, Unf=OtherCon []] $wxs @@ -45,6 +51,7 @@ $wxs } end Rec } +-- RHS size: {terms: 10, types: 2, coercions: 0, joins: 0/0} T3772.$wfoo [InlPrag=NOINLINE] :: GHC.Prim.Int# -> () [GblId, Arity=1, Str=<L>, Unf=OtherCon []] T3772.$wfoo @@ -54,6 +61,7 @@ T3772.$wfoo 1# -> $wxs ww } +-- RHS size: {terms: 6, types: 3, coercions: 0, joins: 0/0} foo [InlPrag=[final]] :: Int -> () [GblId, Arity=1, diff --git a/testsuite/tests/simplCore/should_compile/T4908.stderr b/testsuite/tests/simplCore/should_compile/T4908.stderr index b86b896417..afea396826 100644 --- a/testsuite/tests/simplCore/should_compile/T4908.stderr +++ b/testsuite/tests/simplCore/should_compile/T4908.stderr @@ -3,30 +3,35 @@ Result size of Tidy Core = {terms: 68, types: 43, coercions: 0, joins: 0/0} +-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0} T4908.$trModule4 :: Addr# [GblId, Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True, WorkFree=True, Expandable=True, Guidance=IF_ARGS [] 20 0}] T4908.$trModule4 = "main"# +-- RHS size: {terms: 2, types: 0, coercions: 0, joins: 0/0} T4908.$trModule3 :: TrName [GblId, Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True, WorkFree=True, Expandable=True, Guidance=IF_ARGS [] 10 10}] T4908.$trModule3 = GHC.Types.TrNameS T4908.$trModule4 +-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0} T4908.$trModule2 :: Addr# [GblId, Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True, WorkFree=True, Expandable=True, Guidance=IF_ARGS [] 30 0}] T4908.$trModule2 = "T4908"# +-- RHS size: {terms: 2, types: 0, coercions: 0, joins: 0/0} T4908.$trModule1 :: TrName [GblId, Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True, WorkFree=True, Expandable=True, Guidance=IF_ARGS [] 10 10}] T4908.$trModule1 = GHC.Types.TrNameS T4908.$trModule2 +-- RHS size: {terms: 3, types: 0, coercions: 0, joins: 0/0} T4908.$trModule :: Module [GblId, Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True, @@ -35,6 +40,7 @@ T4908.$trModule = GHC.Types.Module T4908.$trModule3 T4908.$trModule1 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><ML><1L>, Unf=OtherCon []] T4908.f_$s$wf @@ -49,6 +55,7 @@ T4908.f_$s$wf } end Rec } +-- RHS size: {terms: 24, types: 13, coercions: 0, joins: 0/0} T4908.$wf [InlPrag=[2]] :: Int# -> (Int, Int) -> Bool [GblId, Arity=2, @@ -70,6 +77,7 @@ T4908.$wf 0# -> GHC.Types.True } +-- RHS size: {terms: 8, types: 6, coercions: 0, joins: 0/0} f [InlPrag=[2]] :: Int -> (Int, Int) -> Bool [GblId, Arity=2, diff --git a/testsuite/tests/simplCore/should_compile/T4930.stderr b/testsuite/tests/simplCore/should_compile/T4930.stderr index c027659fa8..9da0009f84 100644 --- a/testsuite/tests/simplCore/should_compile/T4930.stderr +++ b/testsuite/tests/simplCore/should_compile/T4930.stderr @@ -3,30 +3,35 @@ Result size of Tidy Core = {terms: 43, types: 16, coercions: 0, joins: 0/0} +-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0} T4930.$trModule4 :: GHC.Prim.Addr# [GblId, Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True, WorkFree=True, Expandable=True, Guidance=IF_ARGS [] 20 0}] T4930.$trModule4 = "main"# +-- RHS size: {terms: 2, types: 0, coercions: 0, joins: 0/0} T4930.$trModule3 :: GHC.Types.TrName [GblId, Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True, WorkFree=True, Expandable=True, Guidance=IF_ARGS [] 10 10}] T4930.$trModule3 = GHC.Types.TrNameS T4930.$trModule4 +-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0} T4930.$trModule2 :: GHC.Prim.Addr# [GblId, Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True, WorkFree=True, Expandable=True, Guidance=IF_ARGS [] 30 0}] T4930.$trModule2 = "T4930"# +-- RHS size: {terms: 2, types: 0, coercions: 0, joins: 0/0} T4930.$trModule1 :: GHC.Types.TrName [GblId, Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True, WorkFree=True, Expandable=True, Guidance=IF_ARGS [] 10 10}] T4930.$trModule1 = GHC.Types.TrNameS T4930.$trModule2 +-- RHS size: {terms: 3, types: 0, coercions: 0, joins: 0/0} T4930.$trModule :: GHC.Types.Module [GblId, Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True, @@ -35,6 +40,7 @@ T4930.$trModule = GHC.Types.Module T4930.$trModule3 T4930.$trModule1 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=<L>, Unf=OtherCon []] @@ -46,6 +52,7 @@ T4930.$wfoo } end Rec } +-- RHS size: {terms: 10, types: 4, coercions: 0, joins: 0/0} foo [InlPrag=[2]] :: Int -> Int [GblId, Arity=1, diff --git a/testsuite/tests/simplCore/should_compile/T7360.stderr b/testsuite/tests/simplCore/should_compile/T7360.stderr index c4b114ece5..6b6438bf14 100644 --- a/testsuite/tests/simplCore/should_compile/T7360.stderr +++ b/testsuite/tests/simplCore/should_compile/T7360.stderr @@ -3,6 +3,7 @@ Result size of Tidy Core = {terms: 106, types: 45, coercions: 0, joins: 0/0} +-- RHS size: {terms: 6, types: 3, coercions: 0, joins: 0/0} T7360.$WFoo3 [InlPrag=INLINE[final] CONLIKE] :: Int %1 -> Foo [GblId[DataConWrapper], Arity=1, @@ -20,16 +21,19 @@ T7360.$WFoo3 = \ (conrep [Occ=Once1!] :: Int) -> case conrep of { GHC.Types.I# unbx [Occ=Once1] -> T7360.Foo3 unbx } +-- RHS size: {terms: 5, types: 2, coercions: 0, joins: 0/0} fun1 [InlPrag=NOINLINE] :: Foo -> () [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} T7360.fun4 :: () [GblId, Unf=Unf{Src=<vanilla>, TopLvl=True, Value=False, ConLike=False, WorkFree=False, Expandable=False, Guidance=IF_ARGS [] 20 0}] T7360.fun4 = fun1 T7360.Foo1 +-- RHS size: {terms: 11, types: 7, coercions: 0, joins: 0/0} fun2 :: forall {a}. [a] -> ((), Int) [GblId, Arity=1, @@ -52,30 +56,35 @@ fun2 GHC.Types.I# ww1 }) +-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0} T7360.$trModule4 :: GHC.Prim.Addr# [GblId, Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True, WorkFree=True, Expandable=True, Guidance=IF_ARGS [] 20 0}] T7360.$trModule4 = "main"# +-- RHS size: {terms: 2, types: 0, coercions: 0, joins: 0/0} T7360.$trModule3 :: GHC.Types.TrName [GblId, Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True, WorkFree=True, Expandable=True, Guidance=IF_ARGS [] 10 10}] T7360.$trModule3 = GHC.Types.TrNameS T7360.$trModule4 +-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0} T7360.$trModule2 :: GHC.Prim.Addr# [GblId, Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True, WorkFree=True, Expandable=True, Guidance=IF_ARGS [] 30 0}] T7360.$trModule2 = "T7360"# +-- RHS size: {terms: 2, types: 0, coercions: 0, joins: 0/0} T7360.$trModule1 :: GHC.Types.TrName [GblId, Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True, WorkFree=True, Expandable=True, Guidance=IF_ARGS [] 10 10}] T7360.$trModule1 = GHC.Types.TrNameS T7360.$trModule2 +-- RHS size: {terms: 3, types: 0, coercions: 0, joins: 0/0} T7360.$trModule :: GHC.Types.Module [GblId, Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True, @@ -83,24 +92,28 @@ T7360.$trModule :: GHC.Types.Module T7360.$trModule = GHC.Types.Module T7360.$trModule3 T7360.$trModule1 +-- RHS size: {terms: 3, types: 1, coercions: 0, joins: 0/0} $krep :: GHC.Types.KindRep [GblId, Unf=OtherCon []] $krep = GHC.Types.KindRepTyConApp GHC.Types.$tcInt (GHC.Types.[] @GHC.Types.KindRep) +-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0} T7360.$tcFoo2 :: GHC.Prim.Addr# [GblId, Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True, WorkFree=True, Expandable=True, Guidance=IF_ARGS [] 20 0}] T7360.$tcFoo2 = "Foo"# +-- RHS size: {terms: 2, types: 0, coercions: 0, joins: 0/0} T7360.$tcFoo1 :: GHC.Types.TrName [GblId, Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True, WorkFree=True, Expandable=True, Guidance=IF_ARGS [] 10 10}] T7360.$tcFoo1 = GHC.Types.TrNameS T7360.$tcFoo2 +-- RHS size: {terms: 7, types: 0, coercions: 0, joins: 0/0} T7360.$tcFoo :: GHC.Types.TyCon [GblId, Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True, @@ -114,24 +127,28 @@ T7360.$tcFoo 0# GHC.Types.krep$* +-- RHS size: {terms: 3, types: 1, coercions: 0, joins: 0/0} T7360.$tc'Foo4 [InlPrag=[~]] :: GHC.Types.KindRep [GblId, Unf=OtherCon []] T7360.$tc'Foo4 = GHC.Types.KindRepTyConApp T7360.$tcFoo (GHC.Types.[] @GHC.Types.KindRep) +-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0} T7360.$tc'Foo6 :: GHC.Prim.Addr# [GblId, Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True, WorkFree=True, Expandable=True, Guidance=IF_ARGS [] 30 0}] T7360.$tc'Foo6 = "'Foo1"# +-- RHS size: {terms: 2, types: 0, coercions: 0, joins: 0/0} T7360.$tc'Foo5 :: GHC.Types.TrName [GblId, Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True, WorkFree=True, Expandable=True, Guidance=IF_ARGS [] 10 10}] T7360.$tc'Foo5 = GHC.Types.TrNameS T7360.$tc'Foo6 +-- RHS size: {terms: 7, types: 0, coercions: 0, joins: 0/0} T7360.$tc'Foo1 :: GHC.Types.TyCon [GblId, Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True, @@ -145,18 +162,21 @@ T7360.$tc'Foo1 0# T7360.$tc'Foo4 +-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0} T7360.$tc'Foo8 :: GHC.Prim.Addr# [GblId, Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True, WorkFree=True, Expandable=True, Guidance=IF_ARGS [] 30 0}] T7360.$tc'Foo8 = "'Foo2"# +-- RHS size: {terms: 2, types: 0, coercions: 0, joins: 0/0} T7360.$tc'Foo7 :: GHC.Types.TrName [GblId, Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True, WorkFree=True, Expandable=True, Guidance=IF_ARGS [] 10 10}] T7360.$tc'Foo7 = GHC.Types.TrNameS T7360.$tc'Foo8 +-- RHS size: {terms: 7, types: 0, coercions: 0, joins: 0/0} T7360.$tc'Foo2 :: GHC.Types.TyCon [GblId, Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True, @@ -170,22 +190,26 @@ T7360.$tc'Foo2 0# T7360.$tc'Foo4 +-- RHS size: {terms: 3, types: 0, coercions: 0, joins: 0/0} T7360.$tc'Foo9 [InlPrag=[~]] :: GHC.Types.KindRep [GblId, Unf=OtherCon []] T7360.$tc'Foo9 = GHC.Types.KindRepFun $krep T7360.$tc'Foo4 +-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0} T7360.$tc'Foo11 :: GHC.Prim.Addr# [GblId, Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True, WorkFree=True, Expandable=True, Guidance=IF_ARGS [] 30 0}] T7360.$tc'Foo11 = "'Foo3"# +-- RHS size: {terms: 2, types: 0, coercions: 0, joins: 0/0} T7360.$tc'Foo10 :: GHC.Types.TrName [GblId, Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True, WorkFree=True, Expandable=True, Guidance=IF_ARGS [] 10 10}] T7360.$tc'Foo10 = GHC.Types.TrNameS T7360.$tc'Foo11 +-- RHS size: {terms: 7, types: 0, coercions: 0, joins: 0/0} T7360.$tc'Foo3 :: GHC.Types.TyCon [GblId, Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True, diff --git a/testsuite/tests/simplCore/should_compile/T9400.stderr b/testsuite/tests/simplCore/should_compile/T9400.stderr index 397f53f1a2..511a481d96 100644 --- a/testsuite/tests/simplCore/should_compile/T9400.stderr +++ b/testsuite/tests/simplCore/should_compile/T9400.stderr @@ -11,26 +11,32 @@ T9400.hs:18:9: warning: [-Woverlapping-patterns (in -Wdefault)] Result size of Tidy Core = {terms: 48, types: 28, coercions: 0, joins: 0/0} +-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0} $trModule1 :: Addr# [GblId, Unf=OtherCon []] $trModule1 = "main"# +-- RHS size: {terms: 2, types: 0, coercions: 0, joins: 0/0} $trModule2 :: TrName [GblId, Unf=OtherCon []] $trModule2 = GHC.Types.TrNameS $trModule1 +-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0} $trModule3 :: Addr# [GblId, Unf=OtherCon []] $trModule3 = "T9400"# +-- RHS size: {terms: 2, types: 0, coercions: 0, joins: 0/0} $trModule4 :: TrName [GblId, Unf=OtherCon []] $trModule4 = GHC.Types.TrNameS $trModule3 +-- RHS size: {terms: 3, types: 0, coercions: 0, joins: 0/0} T9400.$trModule :: Module [GblId, Unf=OtherCon []] T9400.$trModule = GHC.Types.Module $trModule2 $trModule4 +-- RHS size: {terms: 33, types: 21, coercions: 0, joins: 0/0} main :: IO () [GblId] main diff --git a/testsuite/tests/simplCore/should_compile/par01.stderr b/testsuite/tests/simplCore/should_compile/par01.stderr index e39ecce4d8..d70331f4a9 100644 --- a/testsuite/tests/simplCore/should_compile/par01.stderr +++ b/testsuite/tests/simplCore/should_compile/par01.stderr @@ -4,6 +4,7 @@ Result size of CorePrep = {terms: 22, types: 10, coercions: 0, joins: 0/0} 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=<L>, Unf=OtherCon []] Par01.depth @@ -13,22 +14,27 @@ Par01.depth } end Rec } +-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0} Par01.$trModule4 :: GHC.Prim.Addr# [GblId, Unf=OtherCon []] Par01.$trModule4 = "main"# +-- RHS size: {terms: 2, types: 0, coercions: 0, joins: 0/0} Par01.$trModule3 :: GHC.Types.TrName [GblId, Unf=OtherCon []] Par01.$trModule3 = GHC.Types.TrNameS Par01.$trModule4 +-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0} Par01.$trModule2 :: GHC.Prim.Addr# [GblId, Unf=OtherCon []] Par01.$trModule2 = "Par01"# +-- RHS size: {terms: 2, types: 0, coercions: 0, joins: 0/0} Par01.$trModule1 :: GHC.Types.TrName [GblId, Unf=OtherCon []] Par01.$trModule1 = GHC.Types.TrNameS Par01.$trModule2 +-- RHS size: {terms: 3, types: 0, coercions: 0, joins: 0/0} Par01.$trModule :: GHC.Types.Module [GblId, Unf=OtherCon []] Par01.$trModule diff --git a/testsuite/tests/simplCore/should_compile/spec-inline.stderr b/testsuite/tests/simplCore/should_compile/spec-inline.stderr index 2a58d06e57..2ba178e6bf 100644 --- a/testsuite/tests/simplCore/should_compile/spec-inline.stderr +++ b/testsuite/tests/simplCore/should_compile/spec-inline.stderr @@ -3,30 +3,35 @@ Result size of Tidy Core = {terms: 150, types: 60, coercions: 0, joins: 0/0} +-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0} Roman.$trModule4 :: GHC.Prim.Addr# [GblId, Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True, WorkFree=True, Expandable=True, Guidance=IF_ARGS [] 20 0}] Roman.$trModule4 = "main"# +-- RHS size: {terms: 2, types: 0, coercions: 0, joins: 0/0} Roman.$trModule3 :: GHC.Types.TrName [GblId, Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True, WorkFree=True, Expandable=True, Guidance=IF_ARGS [] 10 10}] Roman.$trModule3 = GHC.Types.TrNameS Roman.$trModule4 +-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0} Roman.$trModule2 :: GHC.Prim.Addr# [GblId, Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True, WorkFree=True, Expandable=True, Guidance=IF_ARGS [] 30 0}] Roman.$trModule2 = "Roman"# +-- RHS size: {terms: 2, types: 0, coercions: 0, joins: 0/0} Roman.$trModule1 :: GHC.Types.TrName [GblId, Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True, WorkFree=True, Expandable=True, Guidance=IF_ARGS [] 10 10}] Roman.$trModule1 = GHC.Types.TrNameS Roman.$trModule2 +-- RHS size: {terms: 3, types: 0, coercions: 0, joins: 0/0} Roman.$trModule :: GHC.Types.Module [GblId, Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True, @@ -34,16 +39,19 @@ Roman.$trModule :: GHC.Types.Module Roman.$trModule = GHC.Types.Module Roman.$trModule3 Roman.$trModule1 +-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0} lvl :: GHC.Prim.Addr# [GblId, Unf=OtherCon []] lvl = "spec-inline.hs:(19,5)-(29,25)|function go"# +-- RHS size: {terms: 2, types: 2, coercions: 0, joins: 0/0} Roman.foo3 :: () [GblId, Str=b, Cpr=b] Roman.foo3 = Control.Exception.Base.patError @GHC.Types.LiftedRep @() lvl 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><L>, Unf=OtherCon []] @@ -64,6 +72,7 @@ Roman.foo_$s$wgo } end Rec } +-- RHS size: {terms: 61, types: 18, coercions: 0, joins: 0/0} Roman.$wgo [InlPrag=[2]] :: Maybe Int -> Maybe Int -> GHC.Prim.Int# [GblId, Arity=2, @@ -98,6 +107,7 @@ Roman.$wgo } } +-- RHS size: {terms: 9, types: 5, coercions: 0, joins: 0/0} Roman.foo_go [InlPrag=[2]] :: Maybe Int -> Maybe Int -> Int [GblId, Arity=2, @@ -115,18 +125,21 @@ Roman.foo_go = \ (u :: Maybe Int) (ds :: Maybe Int) -> case Roman.$wgo u ds of ww { __DEFAULT -> GHC.Types.I# ww } +-- RHS size: {terms: 2, types: 0, coercions: 0, joins: 0/0} Roman.foo2 :: Int [GblId, Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True, WorkFree=True, Expandable=True, Guidance=IF_ARGS [] 10 10}] Roman.foo2 = GHC.Types.I# 6# +-- RHS size: {terms: 2, types: 1, coercions: 0, joins: 0/0} Roman.foo1 :: Maybe Int [GblId, Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True, WorkFree=True, Expandable=True, Guidance=IF_ARGS [] 10 10}] Roman.foo1 = GHC.Maybe.Just @Int Roman.foo2 +-- RHS size: {terms: 11, types: 4, coercions: 0, joins: 0/0} foo :: Int -> Int [GblId, Arity=1, diff --git a/testsuite/tests/typecheck/should_compile/T13032.stderr b/testsuite/tests/typecheck/should_compile/T13032.stderr index 63e0bacab2..3855f728c5 100644 --- a/testsuite/tests/typecheck/should_compile/T13032.stderr +++ b/testsuite/tests/typecheck/should_compile/T13032.stderr @@ -3,6 +3,7 @@ Result size of Desugar (after optimization) = {terms: 13, types: 18, coercions: 0, joins: 0/0} +-- RHS size: {terms: 6, types: 8, coercions: 0, joins: 0/0} f :: forall a b. (a ~ b) => a -> b -> Bool [LclIdX, Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True, @@ -11,6 +12,7 @@ f :: forall a b. (a ~ b) => a -> b -> Bool f = \ (@a) (@b) _ [Occ=Dead] _ [Occ=Dead] _ [Occ=Dead] -> GHC.Types.True +-- RHS size: {terms: 5, types: 0, coercions: 0, joins: 0/0} T13032.$trModule :: GHC.Types.Module [LclIdX, Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True, |