summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Klebinger <klebinger.andreas@gmx.at>2019-04-02 23:42:04 +0200
committerAndreas Klebinger <klebinger.andreas@gmx.at>2020-12-01 18:29:11 +0100
commit3b703f72322783457239e18894418eeb46678cbf (patch)
treeb0e5d6e58da0ae1fbd22a163da830c36fd3d6a52
parentfc644b1a643128041cfec25db84e417851e28bab (diff)
downloadhaskell-3b703f72322783457239e18894418eeb46678cbf.tar.gz
Tag inferrence work.
This does two major things: * Enforce the invariant that all strict fields must contain tagged pointers. * Try to predict the tag on bindings in order to omit tag checks. The former is "simply" achieved by wrapping any constructor allocations with a case which will evaluate the respective strict bindings. The later is done by a new data flow analysis based on the STG representation of a program. This also helps us to avoid generating redudant cases for the above invariant. Other minor changes: * Refactoring: FV Pass parametrized by input/output pass * Add StgUtil module containing a few functions needed by, but not specific to the tag analysis. * Add a way to force the STG AST. * Add a strictness value for absentError. * Add singleton check for UFM.
-rw-r--r--compiler/GHC/Cmm/CLabel.hs3
-rw-r--r--compiler/GHC/Cmm/Info.dump-ds3616
-rw-r--r--compiler/GHC/Cmm/Info.dump-ds-preopt4746
-rw-r--r--compiler/GHC/Cmm/Info.hs2
-rw-r--r--compiler/GHC/Cmm/Utils.dump-ds3978
-rw-r--r--compiler/GHC/Cmm/Utils.dump-ds-preopt4760
-rw-r--r--compiler/GHC/Cmm/Utils.hs6
-rw-r--r--compiler/GHC/Core/DataCon.hs32
-rw-r--r--compiler/GHC/Core/Make.hs28
-rw-r--r--compiler/GHC/Core/Opt/Arity.hs1
-rw-r--r--compiler/GHC/Core/Opt/DmdAnal.hs44
-rw-r--r--compiler/GHC/Core/Opt/Simplify.hs7
-rw-r--r--compiler/GHC/Core/Opt/WorkWrap/Utils.hs3
-rw-r--r--compiler/GHC/Core/Utils.hs12
-rw-r--r--compiler/GHC/CoreToStg.hs70
-rw-r--r--compiler/GHC/Data/EnumSet.hs4
-rw-r--r--compiler/GHC/Data/TrieMap.hs28
-rw-r--r--compiler/GHC/Driver/Flags.hs4
-rw-r--r--compiler/GHC/Driver/Main.hs19
-rw-r--r--compiler/GHC/Driver/Session.hs4
-rw-r--r--compiler/GHC/Stg/CSE.hs24
-rw-r--r--compiler/GHC/Stg/DepAnal.hs7
-rw-r--r--compiler/GHC/Stg/FVs.hs56
-rw-r--r--compiler/GHC/Stg/InferTags.hs3121
-rw-r--r--compiler/GHC/Stg/Lift.hs15
-rw-r--r--compiler/GHC/Stg/Lift/Analysis.hs17
-rw-r--r--compiler/GHC/Stg/Lift/Monad.hs4
-rw-r--r--compiler/GHC/Stg/Lint.hs11
-rw-r--r--compiler/GHC/Stg/Stats.hs6
-rw-r--r--compiler/GHC/Stg/Syntax.hs192
-rw-r--r--compiler/GHC/Stg/Unarise.hs26
-rw-r--r--compiler/GHC/Stg/Utils.hs148
-rw-r--r--compiler/GHC/StgToCmm.hs2
-rw-r--r--compiler/GHC/StgToCmm/Bind.hs11
-rw-r--r--compiler/GHC/StgToCmm/Closure.hs60
-rw-r--r--compiler/GHC/StgToCmm/Env.hs17
-rw-r--r--compiler/GHC/StgToCmm/Expr.hs132
-rw-r--r--compiler/GHC/StgToCmm/Ticky.hs18
-rw-r--r--compiler/GHC/StgToCmm/Utils.hs6
-rw-r--r--compiler/GHC/Types/Demand.hs28
-rw-r--r--compiler/GHC/Types/Id/Make.hs2
-rw-r--r--compiler/GHC/Types/Unique/FM.hs9
-rw-r--r--compiler/GHC/Utils/Misc.hs24
-rw-r--r--compiler/ghc.cabal.in2
-rw-r--r--includes/stg/Ticky.h7
-rw-r--r--libraries/base/Control/Exception/Base.hs7
-rw-r--r--libraries/ghc-prim/GHC/Magic.hs3
-rw-r--r--libraries/ghc-prim/GHC/Prim/Panic.hs1
-rw-r--r--rts/RtsSymbols.c6
-rw-r--r--rts/Ticky.c15
-rw-r--r--testsuite/tests/simplStg/should_run/all.T4
-rw-r--r--testsuite/tests/simplStg/should_run/inferTags001.hs7
-rw-r--r--testsuite/tests/simplStg/should_run/inferTags001_a.hs9
-rw-r--r--testsuite/tests/simplStg/should_run/inferTags001_b.hs9
54 files changed, 21126 insertions, 247 deletions
diff --git a/compiler/GHC/Cmm/CLabel.hs b/compiler/GHC/Cmm/CLabel.hs
index 75559edd2e..b92a4b5e07 100644
--- a/compiler/GHC/Cmm/CLabel.hs
+++ b/compiler/GHC/Cmm/CLabel.hs
@@ -1245,6 +1245,9 @@ pprCLabel platform sty lbl =
tempLabelPrefixOrUnderscore :: Platform -> SDoc
tempLabelPrefixOrUnderscore platform = case sty of
+ AsmStyle -> empty
+ CStyle -> char '_'
+ tempLabelPrefixOrUnderscore platform = case sty of
AsmStyle -> ptext (asmTempLabelPrefix platform)
CStyle -> char '_'
diff --git a/compiler/GHC/Cmm/Info.dump-ds b/compiler/GHC/Cmm/Info.dump-ds
new file mode 100644
index 0000000000..313b89e999
--- /dev/null
+++ b/compiler/GHC/Cmm/Info.dump-ds
@@ -0,0 +1,3616 @@
+
+==================== Desugar (after optimization) ====================
+2020-11-24 12:41:53.5381808 UTC
+
+Result size of Desugar (after optimization)
+ = {terms: 1,342, types: 1,611, coercions: 23, joins: 1/41}
+
+-- RHS size: {terms: 5, types: 4, coercions: 0, joins: 0/0}
+po_align_check :: PtrOpts -> Bool
+[LclIdX[[RecSel]],
+ Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
+ WorkFree=True, Expandable=True,
+ Guidance=ALWAYS_IF(arity=1,unsat_ok=True,boring_ok=True)}]
+po_align_check
+ = \ (ds_d19ZZ :: PtrOpts) ->
+ case ds_d19ZZ of { PtrOpts _ [Occ=Dead] ds_d1a01 -> ds_d1a01 }
+
+-- RHS size: {terms: 5, types: 4, coercions: 0, joins: 0/0}
+po_profile :: PtrOpts -> Profile
+[LclIdX[[RecSel]],
+ Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
+ WorkFree=True, Expandable=True,
+ Guidance=ALWAYS_IF(arity=1,unsat_ok=True,boring_ok=True)}]
+po_profile
+ = \ (ds_d19ZW :: PtrOpts) ->
+ case ds_d19ZW of { PtrOpts ds_d19ZX _ [Occ=Dead] -> ds_d19ZX }
+
+-- RHS size: {terms: 8, types: 6, coercions: 0, joins: 0/0}
+mkEmptyContInfoTable :: CLabel -> CmmInfoTable
+[LclIdX,
+ Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
+ WorkFree=True, Expandable=True, Guidance=IF_ARGS [0] 30 60}]
+mkEmptyContInfoTable
+ = \ (info_lbl_a19tf :: CLabel) ->
+ GHC.Cmm.CmmInfoTable
+ info_lbl_a19tf
+ (mkStackRep (ghc-prim-0.6.1:GHC.Types.[] @ Bool))
+ GHC.Cmm.NoProfilingInfo
+ (GHC.Maybe.Nothing @ CLabel)
+ (GHC.Maybe.Nothing
+ @ (GHC.Types.Var.Id, GHC.Types.CostCentre.CostCentreStack))
+
+-- RHS size: {terms: 28, types: 8, coercions: 0, joins: 0/0}
+makeRelativeRefTo :: Platform -> CLabel -> CmmLit -> CmmLit
+[LclIdX,
+ Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
+ WorkFree=True, Expandable=True, Guidance=IF_ARGS [0 0 70] 140 100}]
+makeRelativeRefTo
+ = \ (platform_a19v0 :: Platform)
+ (info_lbl_a19v1 :: CLabel)
+ (lit_a19v2 :: CmmLit) ->
+ case platformTablesNextToCode platform_a19v0 of {
+ False -> lit_a19v2;
+ True ->
+ case lit_a19v2 of {
+ __DEFAULT -> lit_a19v2;
+ CmmLabel lbl_a19v3 ->
+ GHC.Cmm.Expr.CmmLabelDiffOff
+ lbl_a19v3
+ info_lbl_a19v1
+ (ghc-prim-0.6.1:GHC.Types.I# 0#)
+ (wordWidth platform_a19v0);
+ CmmLabelOff lbl_a19v4 off_a19v5 ->
+ GHC.Cmm.Expr.CmmLabelDiffOff
+ lbl_a19v4 info_lbl_a19v1 off_a19v5 (wordWidth platform_a19v0)
+ }
+ }
+
+-- RHS size: {terms: 25, types: 11, coercions: 0, joins: 0/1}
+wordAligned :: PtrOpts -> CmmExpr -> CmmExpr
+[LclIdX,
+ Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
+ WorkFree=True, Expandable=True, Guidance=IF_ARGS [0 0] 200 30}]
+wordAligned
+ = \ (opts_a19vA :: PtrOpts) (e_a19vB :: CmmExpr) ->
+ let {
+ platform_a19vC :: Platform
+ [LclId,
+ Unf=Unf{Src=<vanilla>, TopLvl=False, Value=False, ConLike=False,
+ WorkFree=False, Expandable=True, Guidance=IF_ARGS [] 40 0}]
+ platform_a19vC = profilePlatform (po_profile opts_a19vA) } in
+ case po_align_check opts_a19vA of {
+ False -> e_a19vB;
+ True ->
+ GHC.Cmm.Expr.CmmMachOp
+ (GHC.Cmm.MachOp.MO_AlignmentCheck
+ (platformWordSizeInBytes platform_a19vC)
+ (wordWidth platform_a19vC))
+ (GHC.Base.build
+ @ CmmExpr
+ (\ (@ a_d19Pn)
+ (c_d19Po :: CmmExpr -> a_d19Pn -> a_d19Pn)
+ (n_d19Pp :: a_d19Pn) ->
+ c_d19Po e_a19vB n_d19Pp))
+ }
+
+-- RHS size: {terms: 10, types: 2, coercions: 0, joins: 0/0}
+closureInfoPtr :: PtrOpts -> CmmExpr -> CmmExpr
+[LclIdX,
+ Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
+ WorkFree=True, Expandable=True, Guidance=IF_ARGS [0 0] 120 0}]
+closureInfoPtr
+ = \ (opts_a19vD :: PtrOpts) (e_a19vE :: CmmExpr) ->
+ GHC.Cmm.Expr.$WCmmLoad
+ (wordAligned opts_a19vD e_a19vE)
+ (bWord (profilePlatform (po_profile opts_a19vD)))
+
+-- RHS size: {terms: 12, types: 3, coercions: 0, joins: 0/0}
+entryCode :: Platform -> CmmExpr -> CmmExpr
+[LclIdX,
+ Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
+ WorkFree=True, Expandable=True, Guidance=IF_ARGS [0 0] 90 0}]
+entryCode
+ = \ (platform_a19vF :: Platform) (e_a19vG :: CmmExpr) ->
+ case platformTablesNextToCode platform_a19vF of {
+ False -> GHC.Cmm.Expr.$WCmmLoad e_a19vG (bWord platform_a19vF);
+ True -> e_a19vG
+ }
+
+-- RHS size: {terms: 2, types: 0, coercions: 0, joins: 0/0}
+fixedInfoTableSizeW :: WordOff
+[LclIdX,
+ Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
+ WorkFree=True, Expandable=True, Guidance=IF_ARGS [] 10 20}]
+fixedInfoTableSizeW = ghc-prim-0.6.1:GHC.Types.I# 2#
+
+-- RHS size: {terms: 2, types: 0, coercions: 0, joins: 0/0}
+profInfoTableSizeW :: WordOff
+[LclIdX,
+ Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
+ WorkFree=True, Expandable=True, Guidance=IF_ARGS [] 10 20}]
+profInfoTableSizeW = ghc-prim-0.6.1:GHC.Types.I# 2#
+
+-- RHS size: {terms: 5, types: 0, coercions: 0, joins: 0/0}
+GHC.Cmm.Info.$trModule :: ghc-prim-0.6.1:GHC.Types.Module
+[LclIdX,
+ Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
+ WorkFree=True, Expandable=True, Guidance=IF_ARGS [] 90 30}]
+GHC.Cmm.Info.$trModule
+ = ghc-prim-0.6.1:GHC.Types.Module
+ (ghc-prim-0.6.1:GHC.Types.TrNameS "ghc"#)
+ (ghc-prim-0.6.1:GHC.Types.TrNameS "GHC.Cmm.Info"#)
+
+-- RHS size: {terms: 3, types: 1, coercions: 0, joins: 0/0}
+$krep_a19OQ [InlPrag=NOUSERINLINE[~]]
+ :: ghc-prim-0.6.1:GHC.Types.KindRep
+[LclId,
+ Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
+ WorkFree=True, Expandable=True, Guidance=IF_ARGS [] 10 30}]
+$krep_a19OQ
+ = ghc-prim-0.6.1:GHC.Types.KindRepTyConApp
+ ghc-prim-0.6.1:GHC.Types.$tcBool
+ (ghc-prim-0.6.1:GHC.Types.[] @ ghc-prim-0.6.1:GHC.Types.KindRep)
+
+-- RHS size: {terms: 3, types: 1, coercions: 0, joins: 0/0}
+$krep_a19OO [InlPrag=NOUSERINLINE[~]]
+ :: ghc-prim-0.6.1:GHC.Types.KindRep
+[LclId,
+ Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
+ WorkFree=True, Expandable=True, Guidance=IF_ARGS [] 10 30}]
+$krep_a19OO
+ = ghc-prim-0.6.1:GHC.Types.KindRepTyConApp
+ GHC.Platform.Profile.$tcProfile
+ (ghc-prim-0.6.1:GHC.Types.[] @ ghc-prim-0.6.1:GHC.Types.KindRep)
+
+-- RHS size: {terms: 8, types: 0, coercions: 0, joins: 0/0}
+GHC.Cmm.Info.$tcPtrOpts :: ghc-prim-0.6.1:GHC.Types.TyCon
+[LclIdX,
+ Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
+ WorkFree=True, Expandable=True, Guidance=IF_ARGS [] 50 70}]
+GHC.Cmm.Info.$tcPtrOpts
+ = ghc-prim-0.6.1:GHC.Types.TyCon
+ 10783844252980521413##
+ 13019815378033756893##
+ GHC.Cmm.Info.$trModule
+ (ghc-prim-0.6.1:GHC.Types.TrNameS "PtrOpts"#)
+ 0#
+ ghc-prim-0.6.1:GHC.Types.krep$*
+
+-- RHS size: {terms: 3, types: 1, coercions: 0, joins: 0/0}
+$krep_a19OR [InlPrag=NOUSERINLINE[~]]
+ :: ghc-prim-0.6.1:GHC.Types.KindRep
+[LclId,
+ Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
+ WorkFree=True, Expandable=True, Guidance=IF_ARGS [] 10 30}]
+$krep_a19OR
+ = ghc-prim-0.6.1:GHC.Types.KindRepTyConApp
+ GHC.Cmm.Info.$tcPtrOpts
+ (ghc-prim-0.6.1:GHC.Types.[] @ ghc-prim-0.6.1:GHC.Types.KindRep)
+
+-- RHS size: {terms: 3, types: 0, coercions: 0, joins: 0/0}
+$krep_a19OP [InlPrag=NOUSERINLINE[~]]
+ :: ghc-prim-0.6.1:GHC.Types.KindRep
+[LclId,
+ Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
+ WorkFree=True, Expandable=True, Guidance=IF_ARGS [] 10 30}]
+$krep_a19OP
+ = ghc-prim-0.6.1:GHC.Types.KindRepFun $krep_a19OQ $krep_a19OR
+
+-- RHS size: {terms: 3, types: 0, coercions: 0, joins: 0/0}
+$krep_a19ON [InlPrag=NOUSERINLINE[~]]
+ :: ghc-prim-0.6.1:GHC.Types.KindRep
+[LclId,
+ Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
+ WorkFree=True, Expandable=True, Guidance=IF_ARGS [] 10 30}]
+$krep_a19ON
+ = ghc-prim-0.6.1:GHC.Types.KindRepFun $krep_a19OO $krep_a19OP
+
+-- RHS size: {terms: 8, types: 0, coercions: 0, joins: 0/0}
+GHC.Cmm.Info.$tc'PtrOpts :: ghc-prim-0.6.1:GHC.Types.TyCon
+[LclIdX,
+ Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
+ WorkFree=True, Expandable=True, Guidance=IF_ARGS [] 50 70}]
+GHC.Cmm.Info.$tc'PtrOpts
+ = ghc-prim-0.6.1:GHC.Types.TyCon
+ 11086577099826734001##
+ 4931096801432934088##
+ GHC.Cmm.Info.$trModule
+ (ghc-prim-0.6.1:GHC.Types.TrNameS "'PtrOpts"#)
+ 0#
+ $krep_a19ON
+
+-- RHS size: {terms: 20, types: 3, coercions: 11, joins: 0/0}
+$dIP_a19J3 :: HasCallStack
+[LclId,
+ Unf=Unf{Src=<vanilla>, TopLvl=True, Value=False, ConLike=False,
+ WorkFree=False, Expandable=False, Guidance=IF_ARGS [] 390 0}]
+$dIP_a19J3
+ = (GHC.Stack.Types.pushCallStack
+ (ghc-prim-0.6.1:GHC.CString.unpackCString# "pprPanic"#,
+ GHC.Stack.Types.SrcLoc
+ (ghc-prim-0.6.1:GHC.CString.unpackCString# "ghc"#)
+ (ghc-prim-0.6.1:GHC.CString.unpackCString# "GHC.Cmm.Info"#)
+ (ghc-prim-0.6.1:GHC.CString.unpackCString#
+ "E:\\\\ghc_inferTags\\\\compiler\\\\GHC\\\\Cmm\\\\Info.hs"#)
+ (ghc-prim-0.6.1:GHC.Types.I# 264#)
+ (ghc-prim-0.6.1:GHC.Types.I# 25#)
+ (ghc-prim-0.6.1:GHC.Types.I# 264#)
+ (ghc-prim-0.6.1:GHC.Types.I# 57#))
+ ((GHC.Stack.Types.emptyCallStack
+ `cast` (Sym (ghc-prim-0.6.1:GHC.Classes.N:IP[0]
+ <"callStack">_N <GHC.Stack.Types.CallStack>_N)
+ :: GHC.Stack.Types.CallStack
+ ~R# (?callStack::GHC.Stack.Types.CallStack)))
+ `cast` (ghc-prim-0.6.1:GHC.Classes.N:IP[0]
+ <"callStack">_N <GHC.Stack.Types.CallStack>_N
+ :: (?callStack::GHC.Stack.Types.CallStack)
+ ~R# GHC.Stack.Types.CallStack)))
+ `cast` (Sym (ghc-prim-0.6.1:GHC.Classes.N:IP[0]
+ <"callStack">_N <GHC.Stack.Types.CallStack>_N)
+ :: GHC.Stack.Types.CallStack
+ ~R# (?callStack::GHC.Stack.Types.CallStack))
+
+-- RHS size: {terms: 9, types: 2, coercions: 0, joins: 0/0}
+inlineSRT :: Platform -> Bool
+[LclIdX,
+ Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
+ WorkFree=True, Expandable=True, Guidance=IF_ARGS [0] 110 0}]
+inlineSRT
+ = \ (platform_a19uZ :: Platform) ->
+ &&
+ (==
+ @ Arch
+ GHC.Platform.ArchOS.$fEqArch
+ (platformArch platform_a19uZ)
+ GHC.Platform.ArchOS.ArchX86_64)
+ (platformTablesNextToCode platform_a19uZ)
+
+-- RHS size: {terms: 40, types: 26, coercions: 0, joins: 0/0}
+mkSRTLit
+ :: Platform -> CLabel -> Maybe CLabel -> ([CmmLit], CmmLit)
+[LclIdX,
+ Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
+ WorkFree=True, Expandable=True, Guidance=IF_ARGS [0 0 190] 490 90}]
+mkSRTLit
+ = \ (platform_a19uT :: Platform)
+ (info_lbl_a19uU :: CLabel)
+ (ds_d19Rv :: Maybe CLabel) ->
+ case ds_d19Rv of {
+ Nothing ->
+ (ghc-prim-0.6.1:GHC.Types.[] @ CmmLit,
+ GHC.Cmm.Expr.$WCmmInt 0 (halfWordWidth platform_a19uT));
+ Just lbl_a19uV ->
+ case inlineSRT platform_a19uT of {
+ False ->
+ (GHC.Base.build
+ @ CmmLit
+ (\ (@ a_d19RC)
+ (c_d19RD :: CmmLit -> a_d19RC -> a_d19RC)
+ (n_d19RE :: a_d19RC) ->
+ c_d19RD (GHC.Cmm.Expr.CmmLabel lbl_a19uV) n_d19RE),
+ GHC.Cmm.Expr.$WCmmInt 1 (halfWordWidth platform_a19uT));
+ True ->
+ (ghc-prim-0.6.1:GHC.Types.[] @ CmmLit,
+ GHC.Cmm.Expr.CmmLabelDiffOff
+ lbl_a19uV
+ info_lbl_a19uU
+ (ghc-prim-0.6.1:GHC.Types.I# 0#)
+ (halfWordWidth platform_a19uT))
+ }
+ }
+
+-- RHS size: {terms: 14, types: 26, coercions: 0, joins: 0/0}
+newStringLit
+ :: forall info stmt.
+ ByteString -> UniqSM (CmmLit, GenCmmDecl RawCmmStatics info stmt)
+[LclIdX,
+ Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
+ WorkFree=True, Expandable=True, Guidance=IF_ARGS [0] 150 0}]
+newStringLit
+ = \ (@ info_a19En) (@ stmt_a19Eo) (bytes_a19vx :: ByteString) ->
+ >>=
+ @ UniqSM
+ GHC.Types.Unique.Supply.$fMonadUniqSM
+ @ GHC.Types.Unique.Unique
+ @ (CmmLit, GenCmmDecl RawCmmStatics info_a19En stmt_a19Eo)
+ (getUniqueM @ UniqSM GHC.Types.Unique.Supply.$fMonadUniqueUniqSM)
+ (\ (uniq_a19vy :: GHC.Types.Unique.Unique) ->
+ return
+ @ UniqSM
+ GHC.Types.Unique.Supply.$fMonadUniqSM
+ @ (CmmLit, GenCmmDecl (GenCmmStatics 'True) info_a19En stmt_a19Eo)
+ (mkByteStringCLit
+ @ 'True
+ @ info_a19En
+ @ stmt_a19Eo
+ (mkStringLitLabel uniq_a19vy)
+ bytes_a19vx))
+
+-- RHS size: {terms: 46, types: 131, coercions: 0, joins: 0/0}
+mkProfLits
+ :: Platform
+ -> ProfilingInfo -> UniqSM ((CmmLit, CmmLit), [RawCmmDecl])
+[LclIdX,
+ Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
+ WorkFree=True, Expandable=True, Guidance=IF_ARGS [0 120] 400 0}]
+mkProfLits
+ = \ (platform_a19vq :: Platform) (ds_d19PE :: ProfilingInfo) ->
+ case ds_d19PE of {
+ NoProfilingInfo ->
+ return
+ @ UniqSM
+ GHC.Types.Unique.Supply.$fMonadUniqSM
+ @ ((CmmLit, CmmLit), [RawCmmDecl])
+ ((zeroCLit platform_a19vq, zeroCLit platform_a19vq),
+ ghc-prim-0.6.1:GHC.Types.[] @ RawCmmDecl);
+ ProfilingInfo td_a19vr cd_a19vs ->
+ >>=
+ @ UniqSM
+ GHC.Types.Unique.Supply.$fMonadUniqSM
+ @ (CmmLit,
+ GenCmmDecl
+ RawCmmStatics
+ (GHC.Cmm.Dataflow.Label.LabelMap RawCmmStatics)
+ CmmGraph)
+ @ ((CmmLit, CmmLit), [RawCmmDecl])
+ (newStringLit
+ @ (GHC.Cmm.Dataflow.Label.LabelMap RawCmmStatics)
+ @ CmmGraph
+ td_a19vr)
+ (\ (ds_d19PR
+ :: (CmmLit,
+ GenCmmDecl
+ RawCmmStatics
+ (GHC.Cmm.Dataflow.Label.LabelMap RawCmmStatics)
+ CmmGraph)) ->
+ case ds_d19PR of { (td_lit_a19vt, td_decl_a19vu) ->
+ >>=
+ @ UniqSM
+ GHC.Types.Unique.Supply.$fMonadUniqSM
+ @ (CmmLit,
+ GenCmmDecl
+ RawCmmStatics
+ (GHC.Cmm.Dataflow.Label.LabelMap RawCmmStatics)
+ CmmGraph)
+ @ ((CmmLit, CmmLit), [RawCmmDecl])
+ (newStringLit
+ @ (GHC.Cmm.Dataflow.Label.LabelMap RawCmmStatics)
+ @ CmmGraph
+ cd_a19vs)
+ (\ (ds_d19PM
+ :: (CmmLit,
+ GenCmmDecl
+ RawCmmStatics
+ (GHC.Cmm.Dataflow.Label.LabelMap RawCmmStatics)
+ CmmGraph)) ->
+ case ds_d19PM of { (cd_lit_a19vv, cd_decl_a19vw) ->
+ return
+ @ UniqSM
+ GHC.Types.Unique.Supply.$fMonadUniqSM
+ @ ((CmmLit, CmmLit),
+ [GenCmmDecl
+ RawCmmStatics
+ (GHC.Cmm.Dataflow.Label.LabelMap RawCmmStatics)
+ CmmGraph])
+ ((td_lit_a19vt, cd_lit_a19vv),
+ GHC.Base.build
+ @ (GenCmmDecl
+ RawCmmStatics
+ (GHC.Cmm.Dataflow.Label.LabelMap RawCmmStatics)
+ CmmGraph)
+ (\ (@ a_d19PJ)
+ (c_d19PK
+ :: GenCmmDecl
+ RawCmmStatics
+ (GHC.Cmm.Dataflow.Label.LabelMap RawCmmStatics)
+ CmmGraph
+ -> a_d19PJ -> a_d19PJ)
+ (n_d19PL :: a_d19PJ) ->
+ c_d19PK td_decl_a19vu (c_d19PK cd_decl_a19vw n_d19PL)))
+ })
+ })
+ }
+
+-- RHS size: {terms: 6, types: 2, coercions: 0, joins: 0/0}
+srtEscape :: Platform -> StgHalfWord
+[LclIdX,
+ Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
+ WorkFree=True, Expandable=True, Guidance=IF_ARGS [0] 160 0}]
+srtEscape
+ = \ (platform_a19vz :: Platform) ->
+ toStgHalfWord
+ platform_a19vz (negate @ Integer GHC.Num.$fNumInteger 1)
+
+-- RHS size: {terms: 44, types: 32, coercions: 0, joins: 0/1}
+mkStdInfoTable
+ :: DynFlags
+ -> (CmmLit, CmmLit) -> Int -> CmmLit -> CmmLit -> [CmmLit]
+[LclIdX,
+ Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
+ WorkFree=True, Expandable=True,
+ Guidance=IF_ARGS [0 20 0 0 0] 390 0}]
+mkStdInfoTable
+ = \ (dflags_a19vh :: DynFlags)
+ (ds_d19Q2 :: (CmmLit, CmmLit))
+ (cl_type_a19vk :: Int)
+ (srt_a19vl :: CmmLit)
+ (layout_lit_a19vm :: CmmLit) ->
+ case ds_d19Q2 of { (type_descr_a19vi, closure_descr_a19vj) ->
+ let {
+ tag_a19vp :: CmmLit
+ [LclId,
+ Unf=Unf{Src=<vanilla>, TopLvl=False, Value=False, ConLike=False,
+ WorkFree=False, Expandable=False, Guidance=IF_ARGS [] 110 0}]
+ tag_a19vp
+ = GHC.Cmm.Expr.$WCmmInt
+ (fromIntegral
+ @ Int
+ @ Integer
+ GHC.Real.$fIntegralInt
+ GHC.Num.$fNumInteger
+ cl_type_a19vk)
+ (halfWordWidth (targetPlatform dflags_a19vh)) } in
+ ++
+ @ CmmLit
+ (case sccProfilingEnabled dflags_a19vh of {
+ False -> ghc-prim-0.6.1:GHC.Types.[] @ CmmLit;
+ True ->
+ GHC.Base.build
+ @ CmmLit
+ (\ (@ a_d19Qc)
+ (c_d19Qd :: CmmLit -> a_d19Qc -> a_d19Qc)
+ (n_d19Qe :: a_d19Qc) ->
+ c_d19Qd type_descr_a19vi (c_d19Qd closure_descr_a19vj n_d19Qe))
+ })
+ (GHC.Base.build
+ @ CmmLit
+ (\ (@ a_d19Q5)
+ (c_d19Q6 :: CmmLit -> a_d19Q5 -> a_d19Q5)
+ (n_d19Q7 :: a_d19Q5) ->
+ c_d19Q6
+ layout_lit_a19vm (c_d19Q6 tag_a19vp (c_d19Q6 srt_a19vl n_d19Q7))))
+ }
+
+-- RHS size: {terms: 89, types: 85, coercions: 0, joins: 0/5}
+mkLivenessBits
+ :: DynFlags -> Liveness -> UniqSM (CmmLit, [RawCmmDecl])
+[LclIdX,
+ Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
+ WorkFree=True, Expandable=True, Guidance=NEVER}]
+mkLivenessBits
+ = \ (dflags_a19v6 :: DynFlags) (liveness_a19v7 :: Liveness) ->
+ let {
+ n_bits_a19v9 :: Int
+ [LclId,
+ Unf=Unf{Src=<vanilla>, TopLvl=False, Value=False, ConLike=False,
+ WorkFree=False, Expandable=False, Guidance=IF_ARGS [] 30 0}]
+ n_bits_a19v9
+ = length @ [] Data.Foldable.$fFoldable[] @ Bool liveness_a19v7 } in
+ let {
+ platform_a19v8 :: Platform
+ [LclId,
+ Unf=Unf{Src=<vanilla>, TopLvl=False, Value=False, ConLike=False,
+ WorkFree=False, Expandable=True, Guidance=IF_ARGS [] 20 0}]
+ platform_a19v8 = targetPlatform dflags_a19v6 } in
+ let {
+ bitmap_a19va :: Bitmap
+ [LclId,
+ Unf=Unf{Src=<vanilla>, TopLvl=False, Value=False, ConLike=False,
+ WorkFree=False, Expandable=False, Guidance=IF_ARGS [] 30 0}]
+ bitmap_a19va = mkBitmap platform_a19v8 liveness_a19v7 } in
+ let {
+ lits_a19vd :: [CmmLit]
+ [LclId,
+ Unf=Unf{Src=<vanilla>, TopLvl=False, Value=True, ConLike=True,
+ WorkFree=False, Expandable=False, Guidance=IF_ARGS [] 130 30}]
+ lits_a19vd
+ = ghc-prim-0.6.1:GHC.Types.:
+ @ CmmLit
+ (mkWordCLit
+ platform_a19v8
+ (fromIntegral
+ @ Int
+ @ Integer
+ GHC.Real.$fIntegralInt
+ GHC.Num.$fNumInteger
+ n_bits_a19v9))
+ (map
+ @ StgWord
+ @ CmmLit
+ (mkStgWordCLit platform_a19v8)
+ bitmap_a19va) } in
+ case > @ Int
+ ghc-prim-0.6.1:GHC.Classes.$fOrdInt
+ n_bits_a19v9
+ (mAX_SMALL_BITMAP_SIZE platform_a19v8)
+ of {
+ False ->
+ return
+ @ UniqSM
+ GHC.Types.Unique.Supply.$fMonadUniqSM
+ @ (CmmLit, [RawCmmDecl])
+ (mkStgWordCLit
+ platform_a19v8
+ (.|.
+ @ StgWord
+ GHC.Runtime.Heap.Layout.$fBitsStgWord
+ (toStgWord
+ platform_a19v8
+ (fromIntegral
+ @ Int
+ @ Integer
+ GHC.Real.$fIntegralInt
+ GHC.Num.$fNumInteger
+ n_bits_a19v9))
+ (shiftL
+ @ StgWord
+ GHC.Runtime.Heap.Layout.$fBitsStgWord
+ (case bitmap_a19va of {
+ [] -> toStgWord platform_a19v8 0;
+ : b_a19ve ds_d19QT ->
+ case ds_d19QT of {
+ __DEFAULT ->
+ panic
+ @ StgWord
+ (ghc-prim-0.6.1:GHC.CString.unpackCString# "mkLiveness"#);
+ [] -> b_a19ve
+ }
+ })
+ (pc_BITMAP_BITS_SHIFT (platformConstants platform_a19v8)))),
+ ghc-prim-0.6.1:GHC.Types.[] @ RawCmmDecl);
+ True ->
+ >>=
+ @ UniqSM
+ GHC.Types.Unique.Supply.$fMonadUniqSM
+ @ GHC.Types.Unique.Unique
+ @ (CmmLit, [RawCmmDecl])
+ (getUniqueM @ UniqSM GHC.Types.Unique.Supply.$fMonadUniqueUniqSM)
+ (\ (uniq_a19vf :: GHC.Types.Unique.Unique) ->
+ let {
+ bitmap_lbl_a19vg :: CLabel
+ [LclId,
+ Unf=Unf{Src=<vanilla>, TopLvl=False, Value=False, ConLike=False,
+ WorkFree=False, Expandable=False, Guidance=IF_ARGS [] 20 0}]
+ bitmap_lbl_a19vg = mkBitmapLabel uniq_a19vf } in
+ return
+ @ UniqSM
+ GHC.Types.Unique.Supply.$fMonadUniqSM
+ @ (CmmLit,
+ [GenCmmDecl
+ (GenCmmStatics 'True)
+ (GHC.Cmm.Dataflow.Label.LabelMap RawCmmStatics)
+ CmmGraph])
+ (GHC.Cmm.Expr.CmmLabel bitmap_lbl_a19vg,
+ GHC.Base.build
+ @ (GenCmmDecl
+ (GenCmmStatics 'True)
+ (GHC.Cmm.Dataflow.Label.LabelMap RawCmmStatics)
+ CmmGraph)
+ (\ (@ a_d19Qn)
+ (c_d19Qo
+ :: GenCmmDecl
+ (GenCmmStatics 'True)
+ (GHC.Cmm.Dataflow.Label.LabelMap RawCmmStatics)
+ CmmGraph
+ -> a_d19Qn -> a_d19Qn)
+ (n_d19Qp :: a_d19Qn) ->
+ c_d19Qo
+ (mkRODataLits
+ @ 'True
+ @ (GHC.Cmm.Dataflow.Label.LabelMap RawCmmStatics)
+ @ CmmGraph
+ bitmap_lbl_a19vg
+ lits_a19vd)
+ n_d19Qp)))
+ }
+
+-- RHS size: {terms: 17, types: 7, coercions: 0, joins: 0/0}
+packIntsCLit :: Platform -> Int -> Int -> CmmLit
+[LclIdX,
+ Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
+ WorkFree=True, Expandable=True, Guidance=IF_ARGS [0 0 0] 180 0}]
+packIntsCLit
+ = \ (platform_a19uQ :: Platform)
+ (a_a19uR :: Int)
+ (b_a19uS :: Int) ->
+ packHalfWordsCLit
+ platform_a19uQ
+ (toStgHalfWord
+ platform_a19uQ
+ (fromIntegral
+ @ Int
+ @ Integer
+ GHC.Real.$fIntegralInt
+ GHC.Num.$fNumInteger
+ a_a19uR))
+ (toStgHalfWord
+ platform_a19uQ
+ (fromIntegral
+ @ Int
+ @ Integer
+ GHC.Real.$fIntegralInt
+ GHC.Num.$fNumInteger
+ b_a19uS))
+
+Rec {
+-- RHS size: {terms: 338, types: 541, coercions: 0, joins: 1/12}
+mkInfoTableContents [Occ=LoopBreaker]
+ :: DynFlags
+ -> CmmInfoTable
+ -> Maybe Int
+ -> UniqSM ([RawCmmDecl], InfoTableContents)
+[LclIdX,
+ Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
+ WorkFree=True, Expandable=True, Guidance=NEVER}]
+mkInfoTableContents
+ = \ (dflags_a19tU :: DynFlags)
+ (info_a19tV :: CmmInfoTable)
+ (mb_rts_tag_a19u0 :: Maybe Int) ->
+ case info_a19tV of wild_00
+ { CmmInfoTable ds_d19Wv ds_d19Ww ds_d19Wx ds_d19Wy _ [Occ=Dead] ->
+ let {
+ platform_a19u1 :: Platform
+ [LclId,
+ Unf=Unf{Src=<vanilla>, TopLvl=False, Value=False, ConLike=False,
+ WorkFree=False, Expandable=True, Guidance=IF_ARGS [] 20 0}]
+ platform_a19u1 = targetPlatform dflags_a19tU } in
+ let {
+ mk_pieces_a19u2
+ :: ClosureTypeInfo
+ -> [CmmLit]
+ -> UniqSM (Maybe CmmLit, Maybe CmmLit, [CmmLit], [RawCmmDecl])
+ [LclId,
+ Unf=Unf{Src=<vanilla>, TopLvl=False, Value=True, ConLike=True,
+ WorkFree=True, Expandable=True, Guidance=NEVER}]
+ mk_pieces_a19u2
+ = \ (ds_d19WG :: ClosureTypeInfo) (_no_srt_a19u5 :: [CmmLit]) ->
+ join {
+ fail_d19XP
+ :: ghc-prim-0.6.1:GHC.Prim.Void#
+ -> UniqSM (Maybe CmmLit, Maybe CmmLit, [CmmLit], [RawCmmDecl])
+ [LclId[JoinId(1)],
+ Str=<L,U>,
+ Unf=Unf{Src=<vanilla>, TopLvl=False, Value=True, ConLike=True,
+ WorkFree=True, Expandable=True, Guidance=IF_ARGS [0] 130 0}]
+ fail_d19XP _ [Occ=Dead, OS=OneShot]
+ = pprPanic
+ @ (UniqSM (Maybe CmmLit, Maybe CmmLit, [CmmLit], [RawCmmDecl]))
+ $dIP_a19J3
+ (ghc-prim-0.6.1:GHC.CString.unpackCString# "mk_pieces"#)
+ (ppr
+ @ ClosureTypeInfo
+ GHC.Runtime.Heap.Layout.$fOutputableClosureTypeInfo
+ ds_d19WG) } in
+ case ds_d19WG of {
+ __DEFAULT -> jump fail_d19XP ghc-prim-0.6.1:GHC.Prim.void#;
+ Constr con_tag_a19u3 con_descr_a19u4 ->
+ >>=
+ @ UniqSM
+ GHC.Types.Unique.Supply.$fMonadUniqSM
+ @ (CmmLit,
+ GenCmmDecl
+ RawCmmStatics
+ (GHC.Cmm.Dataflow.Label.LabelMap RawCmmStatics)
+ CmmGraph)
+ @ (Maybe CmmLit, Maybe CmmLit, [CmmLit], [RawCmmDecl])
+ (newStringLit
+ @ (GHC.Cmm.Dataflow.Label.LabelMap RawCmmStatics)
+ @ CmmGraph
+ con_descr_a19u4)
+ (\ (ds_d19WP
+ :: (CmmLit,
+ GenCmmDecl
+ RawCmmStatics
+ (GHC.Cmm.Dataflow.Label.LabelMap RawCmmStatics)
+ CmmGraph)) ->
+ case ds_d19WP of { (descr_lit_a19u6, decl_a19u7) ->
+ return
+ @ UniqSM
+ GHC.Types.Unique.Supply.$fMonadUniqSM
+ @ (Maybe CmmLit, Maybe CmmLit, [CmmLit],
+ [GenCmmDecl
+ RawCmmStatics
+ (GHC.Cmm.Dataflow.Label.LabelMap RawCmmStatics)
+ CmmGraph])
+ (GHC.Maybe.Just
+ @ CmmLit
+ (GHC.Cmm.Expr.$WCmmInt
+ (fromIntegral
+ @ GHC.Types.Basic.ConTagZ
+ @ Integer
+ GHC.Real.$fIntegralInt
+ GHC.Num.$fNumInteger
+ con_tag_a19u3)
+ (halfWordWidth platform_a19u1)),
+ GHC.Maybe.Nothing @ CmmLit,
+ GHC.Base.build
+ @ CmmLit
+ (\ (@ a_d19WM)
+ (c_d19WN :: CmmLit -> a_d19WM -> a_d19WM)
+ (n_d19WO :: a_d19WM) ->
+ c_d19WN descr_lit_a19u6 n_d19WO),
+ GHC.Base.build
+ @ (GenCmmDecl
+ RawCmmStatics
+ (GHC.Cmm.Dataflow.Label.LabelMap RawCmmStatics)
+ CmmGraph)
+ (\ (@ a_d19WJ)
+ (c_d19WK
+ :: GenCmmDecl
+ RawCmmStatics
+ (GHC.Cmm.Dataflow.Label.LabelMap RawCmmStatics)
+ CmmGraph
+ -> a_d19WJ -> a_d19WJ)
+ (n_d19WL :: a_d19WJ) ->
+ c_d19WK decl_a19u7 n_d19WL))
+ });
+ Fun arity_a19ub ds_d19XO ->
+ case ds_d19XO of {
+ __DEFAULT -> jump fail_d19XP ghc-prim-0.6.1:GHC.Prim.void#;
+ ArgSpec fun_type_a19uc ->
+ return
+ @ UniqSM
+ GHC.Types.Unique.Supply.$fMonadUniqSM
+ @ (Maybe CmmLit, Maybe CmmLit, [CmmLit], [RawCmmDecl])
+ (GHC.Maybe.Nothing @ CmmLit, GHC.Maybe.Nothing @ CmmLit,
+ ghc-prim-0.6.1:GHC.Types.:
+ @ CmmLit
+ (packIntsCLit platform_a19u1 fun_type_a19uc arity_a19ub)
+ _no_srt_a19u5,
+ ghc-prim-0.6.1:GHC.Types.[] @ RawCmmDecl);
+ ArgGen arg_bits_a19ug ->
+ let {
+ srt_lit_a19uj :: CmmLit
+ [LclId,
+ Unf=Unf{Src=<vanilla>, TopLvl=False, Value=False, ConLike=False,
+ WorkFree=False, Expandable=False, Guidance=IF_ARGS [] 350 0}]
+ srt_lit_a19uj
+ = case _no_srt_a19u5 of {
+ [] -> mkIntCLit platform_a19u1 (ghc-prim-0.6.1:GHC.Types.I# 0#);
+ : lit_a19uk _rest_a19ul ->
+ case &&
+ debugIsOn
+ (not
+ (null
+ @ [] Data.Foldable.$fFoldable[] @ CmmLit _rest_a19ul))
+ of {
+ False -> lit_a19uk;
+ True ->
+ assertPanic
+ @ CmmLit
+ (ghc-prim-0.6.1:GHC.CString.unpackCString#
+ "E:\\\\ghc_inferTags\\\\compiler\\\\GHC\\\\Cmm\\\\Info.hs"#)
+ (ghc-prim-0.6.1:GHC.Types.I# 262#)
+ }
+ } } in
+ let {
+ slow_entry_a19ui :: CmmLit
+ [LclId,
+ Unf=Unf{Src=<vanilla>, TopLvl=False, Value=True, ConLike=True,
+ WorkFree=False, Expandable=False, Guidance=IF_ARGS [] 40 20}]
+ slow_entry_a19ui
+ = GHC.Cmm.Expr.CmmLabel
+ (toSlowEntryLbl platform_a19u1 ds_d19Wv) } in
+ >>=
+ @ UniqSM
+ GHC.Types.Unique.Supply.$fMonadUniqSM
+ @ (CmmLit, [RawCmmDecl])
+ @ (Maybe CmmLit, Maybe CmmLit, [CmmLit], [RawCmmDecl])
+ (mkLivenessBits dflags_a19tU arg_bits_a19ug)
+ (\ (ds_d19Xp :: (CmmLit, [RawCmmDecl])) ->
+ case ds_d19Xp of { (liveness_lit_a19um, liveness_data_a19un) ->
+ let {
+ fun_type_a19uo :: Int
+ [LclId,
+ Unf=Unf{Src=<vanilla>, TopLvl=False, Value=False, ConLike=False,
+ WorkFree=False, Expandable=False, Guidance=IF_ARGS [] 50 0}]
+ fun_type_a19uo
+ = case null
+ @ []
+ Data.Foldable.$fFoldable[]
+ @ RawCmmDecl
+ liveness_data_a19un
+ of {
+ False -> aRG_GEN_BIG;
+ True -> aRG_GEN
+ } } in
+ return
+ @ UniqSM
+ GHC.Types.Unique.Supply.$fMonadUniqSM
+ @ (Maybe CmmLit, Maybe CmmLit, [CmmLit], [RawCmmDecl])
+ (GHC.Maybe.Nothing @ CmmLit, GHC.Maybe.Nothing @ CmmLit,
+ ++
+ @ CmmLit
+ (GHC.Base.build
+ @ CmmLit
+ (\ (@ a_d19X8)
+ (c_d19X9 :: CmmLit -> a_d19X8 -> a_d19X8)
+ (n_d19Xa :: a_d19X8) ->
+ c_d19X9
+ (packIntsCLit platform_a19u1 fun_type_a19uo arity_a19ub)
+ n_d19Xa))
+ (++
+ @ CmmLit
+ (case inlineSRT platform_a19u1 of {
+ False ->
+ GHC.Base.build
+ @ CmmLit
+ (\ (@ a_d19Xb)
+ (c_d19Xc :: CmmLit -> a_d19Xb -> a_d19Xb)
+ (n_d19Xd :: a_d19Xb) ->
+ c_d19Xc srt_lit_a19uj n_d19Xd);
+ True -> ghc-prim-0.6.1:GHC.Types.[] @ CmmLit
+ })
+ (GHC.Base.build
+ @ CmmLit
+ (\ (@ a_d19Xe)
+ (c_d19Xf :: CmmLit -> a_d19Xe -> a_d19Xe)
+ (n_d19Xg :: a_d19Xe) ->
+ c_d19Xf
+ liveness_lit_a19um (c_d19Xf slow_entry_a19ui n_d19Xg)))),
+ liveness_data_a19un)
+ })
+ };
+ Thunk ->
+ return
+ @ UniqSM
+ GHC.Types.Unique.Supply.$fMonadUniqSM
+ @ (Maybe CmmLit, Maybe CmmLit, [CmmLit], [RawCmmDecl])
+ (GHC.Maybe.Nothing @ CmmLit, GHC.Maybe.Nothing @ CmmLit,
+ _no_srt_a19u5, ghc-prim-0.6.1:GHC.Types.[] @ RawCmmDecl);
+ ThunkSelector offset_a19u9 ->
+ return
+ @ UniqSM
+ GHC.Types.Unique.Supply.$fMonadUniqSM
+ @ (Maybe CmmLit, Maybe CmmLit, [CmmLit], [RawCmmDecl])
+ (GHC.Maybe.Just
+ @ CmmLit (GHC.Cmm.Expr.$WCmmInt 0 (halfWordWidth platform_a19u1)),
+ GHC.Maybe.Just
+ @ CmmLit
+ (mkWordCLit
+ platform_a19u1
+ (fromIntegral
+ @ GHC.Runtime.Heap.Layout.SelectorOffset
+ @ Integer
+ GHC.Real.$fIntegralInt
+ GHC.Num.$fNumInteger
+ offset_a19u9)),
+ ghc-prim-0.6.1:GHC.Types.[] @ CmmLit,
+ ghc-prim-0.6.1:GHC.Types.[] @ RawCmmDecl)
+ } } in
+ case ds_d19Ww of {
+ __DEFAULT ->
+ case ds_d19Ww of {
+ __DEFAULT ->
+ case ds_d19Ww of {
+ __DEFAULT ->
+ panic
+ @ (UniqSM ([RawCmmDecl], InfoTableContents))
+ (ghc-prim-0.6.1:GHC.CString.unpackCString# "mkInfoTableContents"#);
+ HeapRep _ [Occ=Dead] ptrs_a19uD nonptrs_a19uE closure_type_a19uF ->
+ let {
+ layout_a19uG :: CmmLit
+ [LclId,
+ Unf=Unf{Src=<vanilla>, TopLvl=False, Value=False, ConLike=False,
+ WorkFree=False, Expandable=False, Guidance=IF_ARGS [] 40 0}]
+ layout_a19uG
+ = packIntsCLit platform_a19u1 ptrs_a19uD nonptrs_a19uE } in
+ >>=
+ @ UniqSM
+ GHC.Types.Unique.Supply.$fMonadUniqSM
+ @ ((CmmLit, CmmLit), [RawCmmDecl])
+ @ ([RawCmmDecl], InfoTableContents)
+ (mkProfLits platform_a19u1 ds_d19Wx)
+ (\ (ds_d19UR :: ((CmmLit, CmmLit), [RawCmmDecl])) ->
+ case ds_d19UR of { (prof_lits_a19uH, prof_data_a19uI) ->
+ let {
+ ds_d19UI :: ([CmmLit], CmmLit)
+ [LclId,
+ Unf=Unf{Src=<vanilla>, TopLvl=False, Value=False, ConLike=False,
+ WorkFree=False, Expandable=False, Guidance=IF_ARGS [] 40 0}]
+ ds_d19UI = mkSRTLit platform_a19u1 ds_d19Wv ds_d19Wy } in
+ let {
+ srt_bitmap_a19uK :: CmmLit
+ [LclId,
+ Unf=Unf{Src=<vanilla>, TopLvl=False, Value=False, ConLike=False,
+ WorkFree=True, Expandable=False, Guidance=IF_ARGS [] 10 0}]
+ srt_bitmap_a19uK
+ = case ds_d19UI of { (_ [Occ=Dead], srt_bitmap_a19uK) ->
+ srt_bitmap_a19uK
+ } } in
+ >>=
+ @ UniqSM
+ GHC.Types.Unique.Supply.$fMonadUniqSM
+ @ (Maybe CmmLit, Maybe CmmLit, [CmmLit], [RawCmmDecl])
+ @ ([RawCmmDecl], InfoTableContents)
+ (mk_pieces_a19u2
+ closure_type_a19uF
+ (case ds_d19UI of { (srt_label_a19uJ, _ [Occ=Dead]) ->
+ srt_label_a19uJ
+ }))
+ (\ (ds_d19UD
+ :: (Maybe CmmLit, Maybe CmmLit, [CmmLit], [RawCmmDecl])) ->
+ case ds_d19UD of
+ { (mb_srt_field_a19uL, mb_layout_a19uM, extra_bits_a19uN,
+ ct_data_a19uO) ->
+ return
+ @ UniqSM
+ GHC.Types.Unique.Supply.$fMonadUniqSM
+ @ ([RawCmmDecl], ([CmmLit], [CmmLit]))
+ (++ @ RawCmmDecl prof_data_a19uI ct_data_a19uO,
+ (mkStdInfoTable
+ dflags_a19tU
+ prof_lits_a19uH
+ (orElse @ Int mb_rts_tag_a19u0 (rtsClosureType ds_d19Ww))
+ (orElse @ CmmLit mb_srt_field_a19uL srt_bitmap_a19uK)
+ (orElse @ CmmLit mb_layout_a19uM layout_a19uG),
+ extra_bits_a19uN))
+ })
+ })
+ };
+ StackRep frame_a19ut ->
+ >>=
+ @ UniqSM
+ GHC.Types.Unique.Supply.$fMonadUniqSM
+ @ ((CmmLit, CmmLit), [RawCmmDecl])
+ @ ([RawCmmDecl], InfoTableContents)
+ (mkProfLits platform_a19u1 ds_d19Wx)
+ (\ (ds_d19TE :: ((CmmLit, CmmLit), [RawCmmDecl])) ->
+ case ds_d19TE of { (prof_lits_a19uu, prof_data_a19uv) ->
+ let {
+ ds_d19Tv :: ([CmmLit], CmmLit)
+ [LclId,
+ Unf=Unf{Src=<vanilla>, TopLvl=False, Value=False, ConLike=False,
+ WorkFree=False, Expandable=False, Guidance=IF_ARGS [] 40 0}]
+ ds_d19Tv = mkSRTLit platform_a19u1 ds_d19Wv ds_d19Wy } in
+ let {
+ srt_label_a19uw :: [CmmLit]
+ [LclId,
+ Unf=Unf{Src=<vanilla>, TopLvl=False, Value=False, ConLike=False,
+ WorkFree=True, Expandable=False, Guidance=IF_ARGS [] 10 0}]
+ srt_label_a19uw
+ = case ds_d19Tv of { (srt_label_a19uw, _ [Occ=Dead]) ->
+ srt_label_a19uw
+ } } in
+ let {
+ srt_bitmap_a19ux :: CmmLit
+ [LclId,
+ Unf=Unf{Src=<vanilla>, TopLvl=False, Value=False, ConLike=False,
+ WorkFree=True, Expandable=False, Guidance=IF_ARGS [] 10 0}]
+ srt_bitmap_a19ux
+ = case ds_d19Tv of { (_ [Occ=Dead], srt_bitmap_a19ux) ->
+ srt_bitmap_a19ux
+ } } in
+ >>=
+ @ UniqSM
+ GHC.Types.Unique.Supply.$fMonadUniqSM
+ @ (CmmLit, [RawCmmDecl])
+ @ ([RawCmmDecl], InfoTableContents)
+ (mkLivenessBits dflags_a19tU frame_a19ut)
+ (\ (ds_d19Tq :: (CmmLit, [RawCmmDecl])) ->
+ case ds_d19Tq of { (liveness_lit_a19uy, liveness_data_a19uz) ->
+ return
+ @ UniqSM
+ GHC.Types.Unique.Supply.$fMonadUniqSM
+ @ ([RawCmmDecl], ([CmmLit], [CmmLit]))
+ (++ @ RawCmmDecl prof_data_a19uv liveness_data_a19uz,
+ (mkStdInfoTable
+ dflags_a19tU
+ prof_lits_a19uu
+ (case mb_rts_tag_a19u0 of {
+ __DEFAULT ->
+ case null
+ @ []
+ Data.Foldable.$fFoldable[]
+ @ RawCmmDecl
+ liveness_data_a19uz
+ of {
+ False -> rET_BIG;
+ True -> rET_SMALL
+ };
+ Just tag_a19uC -> tag_a19uC
+ })
+ srt_bitmap_a19ux
+ liveness_lit_a19uy,
+ srt_label_a19uw))
+ })
+ })
+ };
+ RTSRep rts_tag_a19ur rep_a19us ->
+ mkInfoTableContents
+ dflags_a19tU
+ (case wild_00 of
+ { CmmInfoTable ds_d19RZ _ [Occ=Dead] ds_d19S1 ds_d19S2 ds_d19S3 ->
+ GHC.Cmm.CmmInfoTable ds_d19RZ rep_a19us ds_d19S1 ds_d19S2 ds_d19S3
+ })
+ (GHC.Maybe.Just @ Int rts_tag_a19ur)
+ }
+ }
+end Rec }
+
+-- RHS size: {terms: 178, types: 329, coercions: 12, joins: 0/4}
+mkInfoTable :: DynFlags -> CmmDeclSRTs -> UniqSM [RawCmmDecl]
+[LclIdX,
+ Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
+ WorkFree=True, Expandable=True, Guidance=NEVER}]
+mkInfoTable
+ = \ (ds_d19Y2 :: DynFlags)
+ (ds_d19Y3 :: GenCmmDecl RawCmmStatics CmmTopInfo CmmGraph) ->
+ case ds_d19Y3 of {
+ CmmProc infos_a19tx entry_lbl_a19ty live_a19tz blocks_a19tA ->
+ let {
+ platform_a19tB :: Platform
+ [LclId,
+ Unf=Unf{Src=<vanilla>, TopLvl=False, Value=False, ConLike=False,
+ WorkFree=False, Expandable=True, Guidance=IF_ARGS [] 20 0}]
+ platform_a19tB = targetPlatform ds_d19Y2 } in
+ case not (platformTablesNextToCode (targetPlatform ds_d19Y2)) of {
+ False ->
+ >>=
+ @ UniqSM
+ GHC.Types.Unique.Supply.$fMonadUniqSM
+ @ ([[RawCmmDecl]],
+ [(GHC.Cmm.Dataflow.Label.Label, GenCmmStatics 'True)])
+ @ [RawCmmDecl]
+ (fmap
+ @ UniqSM
+ GHC.Types.Unique.Supply.$fFunctorUniqSM
+ @ [([RawCmmDecl],
+ (GHC.Cmm.Dataflow.Label.Label, GenCmmStatics 'True))]
+ @ ([[RawCmmDecl]],
+ [(GHC.Cmm.Dataflow.Label.Label, GenCmmStatics 'True)])
+ (unzip
+ @ [RawCmmDecl]
+ @ (GHC.Cmm.Dataflow.Label.Label, GenCmmStatics 'True))
+ (mapM
+ @ []
+ Data.Traversable.$fTraversable[]
+ @ UniqSM
+ @ (GHC.Cmm.Dataflow.Label.Label, CmmInfoTable)
+ @ ([RawCmmDecl],
+ (GHC.Cmm.Dataflow.Label.Label, GenCmmStatics 'True))
+ GHC.Types.Unique.Supply.$fMonadUniqSM
+ (\ (ds_d19Zm :: (GHC.Cmm.Dataflow.Label.Label, CmmInfoTable)) ->
+ case ds_d19Zm of { (lbl_a19tD, itbl_a19tE) ->
+ >>=
+ @ UniqSM
+ GHC.Types.Unique.Supply.$fMonadUniqSM
+ @ ([RawCmmDecl], InfoTableContents)
+ @ ([RawCmmDecl],
+ (GHC.Cmm.Dataflow.Label.Label, GenCmmStatics 'True))
+ (mkInfoTableContents ds_d19Y2 itbl_a19tE (GHC.Maybe.Nothing @ Int))
+ (\ (ds_d19Zp :: ([RawCmmDecl], InfoTableContents)) ->
+ case ds_d19Zp of { (top_decls_a19tF, ds_d19Zz) ->
+ case ds_d19Zz of { (std_info_a19tG, extra_bits_a19tH) ->
+ let {
+ info_lbl_a19tI :: CLabel
+ [LclId,
+ Unf=Unf{Src=<vanilla>, TopLvl=False, Value=False, ConLike=False,
+ WorkFree=False, Expandable=True, Guidance=IF_ARGS [] 20 0}]
+ info_lbl_a19tI = cit_lbl itbl_a19tE } in
+ return
+ @ UniqSM
+ GHC.Types.Unique.Supply.$fMonadUniqSM
+ @ ([RawCmmDecl],
+ (GHC.Cmm.Dataflow.Label.Label, GenCmmStatics 'True))
+ (top_decls_a19tF,
+ (lbl_a19tD,
+ $ @ 'ghc-prim-0.6.1:GHC.Types.LiftedRep
+ @ [CmmStatic]
+ @ (GenCmmStatics 'True)
+ (GHC.Cmm.CmmStaticsRaw @ 'True info_lbl_a19tI)
+ ($ @ 'ghc-prim-0.6.1:GHC.Types.LiftedRep
+ @ [CmmLit]
+ @ [CmmStatic]
+ (map @ CmmLit @ CmmStatic GHC.Cmm.CmmStaticLit)
+ (++
+ @ CmmLit
+ (reverse
+ @ CmmLit
+ (map
+ @ CmmLit
+ @ CmmLit
+ (makeRelativeRefTo platform_a19tB info_lbl_a19tI)
+ extra_bits_a19tH))
+ (map
+ @ CmmLit
+ @ CmmLit
+ (makeRelativeRefTo platform_a19tB info_lbl_a19tI)
+ std_info_a19tG)))))
+ }
+ })
+ })
+ ((mapToList
+ @ GHC.Cmm.Dataflow.Label.LabelMap
+ GHC.Cmm.Dataflow.Label.$fIsMapLabelMap
+ @ CmmInfoTable
+ (info_tbls infos_a19tx))
+ `cast` (([((,)
+ (Sub (GHC.Cmm.Dataflow.Label.D:R:KeyOfLabelMap[0]))
+ <CmmInfoTable>_R)_R])_R
+ :: [(KeyOf GHC.Cmm.Dataflow.Label.LabelMap, CmmInfoTable)]
+ ~R# [(GHC.Cmm.Dataflow.Label.Label, CmmInfoTable)]))))
+ (\ (ds_d19Z1
+ :: ([[RawCmmDecl]],
+ [(GHC.Cmm.Dataflow.Label.Label, GenCmmStatics 'True)])) ->
+ case ds_d19Z1 of { (top_declss_a19tS, raw_infos_a19tT) ->
+ return
+ @ UniqSM
+ GHC.Types.Unique.Supply.$fMonadUniqSM
+ @ [RawCmmDecl]
+ (++
+ @ RawCmmDecl
+ (concat
+ @ [] @ RawCmmDecl Data.Foldable.$fFoldable[] top_declss_a19tS)
+ (GHC.Base.build
+ @ RawCmmDecl
+ (\ (@ a_d19YY)
+ (c_d19YZ :: RawCmmDecl -> a_d19YY -> a_d19YY)
+ (n_d19Z0 :: a_d19YY) ->
+ c_d19YZ
+ (GHC.Cmm.CmmProc
+ @ RawCmmStatics
+ @ (GHC.Cmm.Dataflow.Label.LabelMap (GenCmmStatics 'True))
+ @ CmmGraph
+ (mapFromList
+ @ GHC.Cmm.Dataflow.Label.LabelMap
+ GHC.Cmm.Dataflow.Label.$fIsMapLabelMap
+ @ (GenCmmStatics 'True)
+ (raw_infos_a19tT
+ `cast` (([((,)
+ (Sub (Sym (GHC.Cmm.Dataflow.Label.D:R:KeyOfLabelMap[0])))
+ <GenCmmStatics 'True>_R)_R])_R
+ :: [(GHC.Cmm.Dataflow.Label.Label,
+ GenCmmStatics 'True)]
+ ~R# [(KeyOf GHC.Cmm.Dataflow.Label.LabelMap,
+ GenCmmStatics 'True)])))
+ entry_lbl_a19ty
+ live_a19tz
+ blocks_a19tA)
+ n_d19Z0)))
+ });
+ True ->
+ case topInfoTable @ RawCmmStatics @ CmmNode ds_d19Y3 of {
+ Nothing ->
+ return
+ @ UniqSM
+ GHC.Types.Unique.Supply.$fMonadUniqSM
+ @ [GenCmmDecl
+ RawCmmStatics
+ (GHC.Cmm.Dataflow.Label.LabelMap RawCmmStatics)
+ CmmGraph]
+ (GHC.Base.build
+ @ (GenCmmDecl
+ RawCmmStatics
+ (GHC.Cmm.Dataflow.Label.LabelMap RawCmmStatics)
+ CmmGraph)
+ (\ (@ a_d19Yf)
+ (c_d19Yg
+ :: GenCmmDecl
+ RawCmmStatics
+ (GHC.Cmm.Dataflow.Label.LabelMap RawCmmStatics)
+ CmmGraph
+ -> a_d19Yf -> a_d19Yf)
+ (n_d19Yh :: a_d19Yf) ->
+ c_d19Yg
+ (GHC.Cmm.CmmProc
+ @ RawCmmStatics
+ @ (GHC.Cmm.Dataflow.Label.LabelMap RawCmmStatics)
+ @ CmmGraph
+ (mapEmpty
+ @ GHC.Cmm.Dataflow.Label.LabelMap
+ GHC.Cmm.Dataflow.Label.$fIsMapLabelMap
+ @ RawCmmStatics)
+ entry_lbl_a19ty
+ live_a19tz
+ blocks_a19tA)
+ n_d19Yh));
+ Just info_a19tL ->
+ case info_a19tL of wild_XD
+ { CmmInfoTable ds_d19YT _ [Occ=Dead] _ [Occ=Dead] _ [Occ=Dead]
+ _ [Occ=Dead] ->
+ >>=
+ @ UniqSM
+ GHC.Types.Unique.Supply.$fMonadUniqSM
+ @ ([RawCmmDecl], InfoTableContents)
+ @ [RawCmmDecl]
+ (mkInfoTableContents ds_d19Y2 wild_XD (GHC.Maybe.Nothing @ Int))
+ (\ (ds_d19Yu :: ([RawCmmDecl], InfoTableContents)) ->
+ case ds_d19Yu of { (top_decls_a19tN, ds_d19YE) ->
+ case ds_d19YE of { (std_info_a19tO, extra_bits_a19tP) ->
+ let {
+ rel_extra_bits_a19tR :: [CmmLit]
+ [LclId,
+ Unf=Unf{Src=<vanilla>, TopLvl=False, Value=False, ConLike=False,
+ WorkFree=False, Expandable=False, Guidance=IF_ARGS [] 60 0}]
+ rel_extra_bits_a19tR
+ = map
+ @ CmmLit
+ @ CmmLit
+ (makeRelativeRefTo platform_a19tB ds_d19YT)
+ extra_bits_a19tP } in
+ let {
+ rel_std_info_a19tQ :: [CmmLit]
+ [LclId,
+ Unf=Unf{Src=<vanilla>, TopLvl=False, Value=False, ConLike=False,
+ WorkFree=False, Expandable=False, Guidance=IF_ARGS [] 60 0}]
+ rel_std_info_a19tQ
+ = map
+ @ CmmLit
+ @ CmmLit
+ (makeRelativeRefTo platform_a19tB ds_d19YT)
+ std_info_a19tO } in
+ return
+ @ UniqSM
+ GHC.Types.Unique.Supply.$fMonadUniqSM
+ @ [RawCmmDecl]
+ (++
+ @ RawCmmDecl
+ top_decls_a19tN
+ (GHC.Base.build
+ @ RawCmmDecl
+ (\ (@ a_d19Yr)
+ (c_d19Ys :: RawCmmDecl -> a_d19Yr -> a_d19Yr)
+ (n_d19Yt :: a_d19Yr) ->
+ c_d19Ys
+ (GHC.Cmm.CmmProc
+ @ RawCmmStatics
+ @ (GHC.Cmm.Dataflow.Label.LabelMap RawCmmStatics)
+ @ CmmGraph
+ (mapEmpty
+ @ GHC.Cmm.Dataflow.Label.LabelMap
+ GHC.Cmm.Dataflow.Label.$fIsMapLabelMap
+ @ RawCmmStatics)
+ entry_lbl_a19ty
+ live_a19tz
+ blocks_a19tA)
+ (c_d19Ys
+ (mkRODataLits
+ @ 'True
+ @ (GHC.Cmm.Dataflow.Label.LabelMap RawCmmStatics)
+ @ CmmGraph
+ ds_d19YT
+ (ghc-prim-0.6.1:GHC.Types.:
+ @ CmmLit
+ (GHC.Cmm.Expr.CmmLabel entry_lbl_a19ty)
+ (++ @ CmmLit rel_std_info_a19tQ rel_extra_bits_a19tR)))
+ n_d19Yt))))
+ }
+ })
+ }
+ }
+ };
+ CmmData sec_a19tt dat_a19tu ->
+ return
+ @ UniqSM
+ GHC.Types.Unique.Supply.$fMonadUniqSM
+ @ [GenCmmDecl
+ RawCmmStatics
+ (GHC.Cmm.Dataflow.Label.LabelMap RawCmmStatics)
+ CmmGraph]
+ (GHC.Base.build
+ @ (GenCmmDecl
+ RawCmmStatics
+ (GHC.Cmm.Dataflow.Label.LabelMap RawCmmStatics)
+ CmmGraph)
+ (\ (@ a_d19Y6)
+ (c_d19Y7
+ :: GenCmmDecl
+ RawCmmStatics
+ (GHC.Cmm.Dataflow.Label.LabelMap RawCmmStatics)
+ CmmGraph
+ -> a_d19Y6 -> a_d19Y6)
+ (n_d19Y8 :: a_d19Y6) ->
+ c_d19Y7
+ (GHC.Cmm.CmmData
+ @ RawCmmStatics
+ @ (GHC.Cmm.Dataflow.Label.LabelMap RawCmmStatics)
+ @ CmmGraph
+ sec_a19tt
+ dat_a19tu)
+ n_d19Y8))
+ }
+
+-- RHS size: {terms: 69, types: 138, coercions: 0, joins: 0/2}
+cmmToRawCmm
+ :: forall a.
+ DynFlags
+ -> Stream IO CmmGroupSRTs a -> IO (Stream IO RawCmmGroup a)
+[LclIdX,
+ Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
+ WorkFree=False, Expandable=False, Guidance=IF_ARGS [] 750 60}]
+cmmToRawCmm
+ = \ (@ a_a19N4) ->
+ let {
+ $dFunctor_a19Oo :: Functor (Stream IO [RawCmmDecl])
+ [LclId,
+ Unf=Unf{Src=<vanilla>, TopLvl=False, Value=False, ConLike=False,
+ WorkFree=False, Expandable=True, Guidance=IF_ARGS [] 20 0}]
+ $dFunctor_a19Oo
+ = GHC.Data.Stream.$fFunctorStream
+ @ IO @ [RawCmmDecl] GHC.Base.$fMonadIO } in
+ \ (dflags_a19tg :: DynFlags)
+ (cmms_a19th :: Stream IO CmmGroupSRTs a_a19N4) ->
+ let {
+ forceRes_a19ti
+ :: forall (t :: * -> *) a a. Foldable t => (a, t a) -> ()
+ [LclId,
+ Unf=Unf{Src=<vanilla>, TopLvl=False, Value=True, ConLike=True,
+ WorkFree=True, Expandable=True, Guidance=IF_ARGS [30 20] 100 0}]
+ forceRes_a19ti
+ = \ (@ (t_a19Ng :: * -> *))
+ (@ a_a19Ne)
+ (@ a_a19Nl)
+ ($dFoldable_a19Nr :: Foldable t_a19Ng)
+ (ds_d19ZP :: (a_a19Ne, t_a19Ng a_a19Nl)) ->
+ case ds_d19ZP of { (uniqs_a19tj, rawcmms_a19tk) ->
+ case uniqs_a19tj of { __DEFAULT ->
+ foldr
+ @ t_a19Ng
+ $dFoldable_a19Nr
+ @ a_a19Nl
+ @ ()
+ (\ (decl_a19tl :: a_a19Nl) (r_a19tm :: ()) ->
+ case decl_a19tl of { __DEFAULT -> r_a19tm })
+ ghc-prim-0.6.1:GHC.Tuple.()
+ rawcmms_a19tk
+ }
+ } } in
+ >>=
+ @ IO
+ GHC.Base.$fMonadIO
+ @ UniqSupply
+ @ (Stream IO RawCmmGroup a_a19N4)
+ (mkSplitUniqSupply (ghc-prim-0.6.1:GHC.Types.C# 'i'#))
+ (\ (uniqs_a19tn :: UniqSupply) ->
+ return
+ @ IO
+ GHC.Base.$fMonadIO
+ @ (Stream IO [RawCmmDecl] a_a19N4)
+ (<$>
+ @ (Stream IO [RawCmmDecl])
+ @ (UniqSupply, a_a19N4)
+ @ a_a19N4
+ $dFunctor_a19Oo
+ (snd @ UniqSupply @ a_a19N4)
+ (Stream.mapAccumL_
+ @ IO
+ @ UniqSupply
+ @ [CmmDeclSRTs]
+ @ [RawCmmDecl]
+ @ a_a19N4
+ GHC.Base.$fMonadIO
+ (\ (uniqs_a19tp :: UniqSupply) (cmm_a19tq :: [CmmDeclSRTs]) ->
+ $ @ 'ghc-prim-0.6.1:GHC.Types.LiftedRep
+ @ (IO (UniqSupply, [RawCmmDecl]))
+ @ (IO (UniqSupply, [RawCmmDecl]))
+ (withTimingSilent
+ @ IO
+ @ (UniqSupply, [RawCmmDecl])
+ Control.Monad.IO.Class.$fMonadIOIO
+ dflags_a19tg
+ (text
+ (ghc-prim-0.6.1:GHC.CString.unpackCString# "Cmm -> Raw Cmm"#))
+ (forceRes_a19ti
+ @ [] @ UniqSupply @ RawCmmDecl Data.Foldable.$fFoldable[]))
+ (case $ @ 'ghc-prim-0.6.1:GHC.Types.LiftedRep
+ @ (UniqSM [RawCmmDecl])
+ @ ([RawCmmDecl], UniqSupply)
+ (initUs @ [RawCmmDecl] uniqs_a19tp)
+ (concatMapM
+ @ UniqSM
+ @ CmmDeclSRTs
+ @ RawCmmDecl
+ GHC.Types.Unique.Supply.$fMonadUniqSM
+ (mkInfoTable dflags_a19tg)
+ cmm_a19tq)
+ of
+ { (b_a19tr, uniqs'_a19ts) ->
+ return
+ @ IO
+ GHC.Base.$fMonadIO
+ @ (UniqSupply, [RawCmmDecl])
+ (uniqs'_a19ts, b_a19tr)
+ }))
+ uniqs_a19tn
+ cmms_a19th)))
+
+-- RHS size: {terms: 8, types: 2, coercions: 0, joins: 0/0}
+maxStdInfoTableSizeW :: WordOff
+[LclIdX,
+ Unf=Unf{Src=<vanilla>, TopLvl=True, Value=False, ConLike=False,
+ WorkFree=False, Expandable=False, Guidance=IF_ARGS [] 90 0}]
+maxStdInfoTableSizeW
+ = + @ WordOff
+ GHC.Num.$fNumInt
+ (+ @ WordOff
+ GHC.Num.$fNumInt
+ (ghc-prim-0.6.1:GHC.Types.I# 1#)
+ fixedInfoTableSizeW)
+ profInfoTableSizeW
+
+-- RHS size: {terms: 5, types: 1, coercions: 0, joins: 0/0}
+maxRetInfoTableSizeW :: WordOff
+[LclIdX,
+ Unf=Unf{Src=<vanilla>, TopLvl=True, Value=False, ConLike=False,
+ WorkFree=False, Expandable=False, Guidance=IF_ARGS [] 50 0}]
+maxRetInfoTableSizeW
+ = + @ WordOff
+ GHC.Num.$fNumInt
+ maxStdInfoTableSizeW
+ (ghc-prim-0.6.1:GHC.Types.I# 1#)
+
+-- RHS size: {terms: 12, types: 3, coercions: 0, joins: 0/0}
+stdInfoTableSizeW :: Profile -> WordOff
+[LclIdX,
+ Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
+ WorkFree=True, Expandable=True, Guidance=IF_ARGS [0] 90 0}]
+stdInfoTableSizeW
+ = \ (profile_a19wi :: Profile) ->
+ + @ WordOff
+ GHC.Num.$fNumInt
+ fixedInfoTableSizeW
+ (case profileIsProfiling profile_a19wi of {
+ False -> ghc-prim-0.6.1:GHC.Types.I# 0#;
+ True -> profInfoTableSizeW
+ })
+
+-- RHS size: {terms: 7, types: 2, coercions: 0, joins: 0/0}
+stdInfoTableSizeB :: Profile -> ByteOff
+[LclIdX,
+ Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
+ WorkFree=True, Expandable=True, Guidance=IF_ARGS [0] 80 0}]
+stdInfoTableSizeB
+ = \ (profile_a19wj :: Profile) ->
+ * @ WordOff
+ GHC.Num.$fNumInt
+ (stdInfoTableSizeW profile_a19wj)
+ (profileWordSizeInBytes profile_a19wj)
+
+-- RHS size: {terms: 8, types: 2, coercions: 0, joins: 0/0}
+stdSrtBitmapOffset :: Profile -> ByteOff
+[LclIdX,
+ Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
+ WorkFree=True, Expandable=True, Guidance=IF_ARGS [0] 100 0}]
+stdSrtBitmapOffset
+ = \ (profile_a19wk :: Profile) ->
+ - @ ByteOff
+ GHC.Num.$fNumInt
+ (stdInfoTableSizeB profile_a19wk)
+ (halfWordSize (profilePlatform profile_a19wk))
+
+-- RHS size: {terms: 13, types: 3, coercions: 0, joins: 0/1}
+infoTableSrtBitmap :: Profile -> CmmExpr -> CmmExpr
+[LclIdX,
+ Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
+ WorkFree=True, Expandable=True, Guidance=IF_ARGS [0 0] 140 0}]
+infoTableSrtBitmap
+ = \ (profile_a19vU :: Profile) (info_tbl_a19vV :: CmmExpr) ->
+ let {
+ platform_a19vW :: Platform
+ [LclId,
+ Unf=Unf{Src=<vanilla>, TopLvl=False, Value=False, ConLike=False,
+ WorkFree=False, Expandable=True, Guidance=IF_ARGS [] 20 0}]
+ platform_a19vW = profilePlatform profile_a19vU } in
+ GHC.Cmm.Expr.$WCmmLoad
+ (cmmOffsetB
+ platform_a19vW info_tbl_a19vV (stdSrtBitmapOffset profile_a19vU))
+ (bHalfWord platform_a19vW)
+
+-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
+infoTableConstrTag :: Profile -> CmmExpr -> CmmExpr
+[LclIdX,
+ Unf=Unf{Src=<vanilla>, TopLvl=True, Value=False, ConLike=False,
+ WorkFree=True, Expandable=True,
+ Guidance=ALWAYS_IF(arity=0,unsat_ok=True,boring_ok=True)}]
+infoTableConstrTag = infoTableSrtBitmap
+
+-- RHS size: {terms: 7, types: 2, coercions: 0, joins: 0/0}
+stdClosureTypeOffset :: Profile -> ByteOff
+[LclIdX,
+ Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
+ WorkFree=True, Expandable=True, Guidance=IF_ARGS [0] 80 0}]
+stdClosureTypeOffset
+ = \ (profile_a19wl :: Profile) ->
+ - @ ByteOff
+ GHC.Num.$fNumInt
+ (stdInfoTableSizeB profile_a19wl)
+ (profileWordSizeInBytes profile_a19wl)
+
+-- RHS size: {terms: 13, types: 3, coercions: 0, joins: 0/1}
+infoTableClosureType :: Profile -> CmmExpr -> CmmExpr
+[LclIdX,
+ Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
+ WorkFree=True, Expandable=True, Guidance=IF_ARGS [0 0] 140 0}]
+infoTableClosureType
+ = \ (profile_a19vX :: Profile) (info_tbl_a19vY :: CmmExpr) ->
+ let {
+ platform_a19vZ :: Platform
+ [LclId,
+ Unf=Unf{Src=<vanilla>, TopLvl=False, Value=False, ConLike=False,
+ WorkFree=False, Expandable=True, Guidance=IF_ARGS [] 20 0}]
+ platform_a19vZ = profilePlatform profile_a19vX } in
+ GHC.Cmm.Expr.$WCmmLoad
+ (cmmOffsetB
+ platform_a19vZ info_tbl_a19vY (stdClosureTypeOffset profile_a19vX))
+ (bHalfWord platform_a19vZ)
+
+-- RHS size: {terms: 11, types: 3, coercions: 0, joins: 0/0}
+stdPtrsOffset :: Profile -> ByteOff
+[LclIdX,
+ Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
+ WorkFree=True, Expandable=True, Guidance=IF_ARGS [0] 130 0}]
+stdPtrsOffset
+ = \ (profile_a19wm :: Profile) ->
+ - @ ByteOff
+ GHC.Num.$fNumInt
+ (stdInfoTableSizeB profile_a19wm)
+ (* @ Int
+ GHC.Num.$fNumInt
+ (ghc-prim-0.6.1:GHC.Types.I# 2#)
+ (profileWordSizeInBytes profile_a19wm))
+
+-- RHS size: {terms: 13, types: 3, coercions: 0, joins: 0/1}
+infoTablePtrs :: Profile -> CmmExpr -> CmmExpr
+[LclIdX,
+ Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
+ WorkFree=True, Expandable=True, Guidance=IF_ARGS [0 0] 140 0}]
+infoTablePtrs
+ = \ (profile_a19w0 :: Profile) (info_tbl_a19w1 :: CmmExpr) ->
+ let {
+ platform_a19w2 :: Platform
+ [LclId,
+ Unf=Unf{Src=<vanilla>, TopLvl=False, Value=False, ConLike=False,
+ WorkFree=False, Expandable=True, Guidance=IF_ARGS [] 20 0}]
+ platform_a19w2 = profilePlatform profile_a19w0 } in
+ GHC.Cmm.Expr.$WCmmLoad
+ (cmmOffsetB
+ platform_a19w2 info_tbl_a19w1 (stdPtrsOffset profile_a19w0))
+ (bHalfWord platform_a19w2)
+
+-- RHS size: {terms: 16, types: 4, coercions: 0, joins: 0/0}
+stdNonPtrsOffset :: Profile -> ByteOff
+[LclIdX,
+ Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
+ WorkFree=True, Expandable=True, Guidance=IF_ARGS [0] 210 0}]
+stdNonPtrsOffset
+ = \ (profile_a19wn :: Profile) ->
+ + @ ByteOff
+ GHC.Num.$fNumInt
+ (- @ ByteOff
+ GHC.Num.$fNumInt
+ (stdInfoTableSizeB profile_a19wn)
+ (* @ Int
+ GHC.Num.$fNumInt
+ (ghc-prim-0.6.1:GHC.Types.I# 2#)
+ (profileWordSizeInBytes profile_a19wn)))
+ (halfWordSize (profilePlatform profile_a19wn))
+
+-- RHS size: {terms: 13, types: 3, coercions: 0, joins: 0/1}
+infoTableNonPtrs :: Profile -> CmmExpr -> CmmExpr
+[LclIdX,
+ Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
+ WorkFree=True, Expandable=True, Guidance=IF_ARGS [0 0] 140 0}]
+infoTableNonPtrs
+ = \ (profile_a19w3 :: Profile) (info_tbl_a19w4 :: CmmExpr) ->
+ let {
+ platform_a19w5 :: Platform
+ [LclId,
+ Unf=Unf{Src=<vanilla>, TopLvl=False, Value=False, ConLike=False,
+ WorkFree=False, Expandable=True, Guidance=IF_ARGS [] 20 0}]
+ platform_a19w5 = profilePlatform profile_a19w3 } in
+ GHC.Cmm.Expr.$WCmmLoad
+ (cmmOffsetB
+ platform_a19w5 info_tbl_a19w4 (stdNonPtrsOffset profile_a19w3))
+ (bHalfWord platform_a19w5)
+
+-- RHS size: {terms: 7, types: 2, coercions: 0, joins: 0/0}
+conInfoTableSizeB :: Profile -> Int
+[LclIdX,
+ Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
+ WorkFree=True, Expandable=True, Guidance=IF_ARGS [0] 80 0}]
+conInfoTableSizeB
+ = \ (profile_a19wo :: Profile) ->
+ + @ ByteOff
+ GHC.Num.$fNumInt
+ (stdInfoTableSizeB profile_a19wo)
+ (profileWordSizeInBytes profile_a19wo)
+
+-- RHS size: {terms: 31, types: 7, coercions: 0, joins: 0/1}
+funInfoTable :: Profile -> CmmExpr -> CmmExpr
+[LclIdX,
+ Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
+ WorkFree=True, Expandable=True, Guidance=IF_ARGS [0 0] 350 0}]
+funInfoTable
+ = \ (profile_a19w6 :: Profile) (info_ptr_a19w7 :: CmmExpr) ->
+ let {
+ platform_a19w8 :: Platform
+ [LclId,
+ Unf=Unf{Src=<vanilla>, TopLvl=False, Value=False, ConLike=False,
+ WorkFree=False, Expandable=True, Guidance=IF_ARGS [] 20 0}]
+ platform_a19w8 = profilePlatform profile_a19w6 } in
+ case platformTablesNextToCode platform_a19w8 of {
+ False ->
+ cmmOffsetW
+ platform_a19w8
+ info_ptr_a19w7
+ (+ @ WordOff
+ GHC.Num.$fNumInt
+ (ghc-prim-0.6.1:GHC.Types.I# 1#)
+ (stdInfoTableSizeW profile_a19w6));
+ True ->
+ cmmOffsetB
+ platform_a19w8
+ info_ptr_a19w7
+ (- @ ByteOff
+ GHC.Num.$fNumInt
+ (negate
+ @ ByteOff GHC.Num.$fNumInt (stdInfoTableSizeB profile_a19w6))
+ (pc_SIZEOF_StgFunInfoExtraRev (platformConstants platform_a19w8)))
+ }
+
+-- RHS size: {terms: 46, types: 24, coercions: 0, joins: 0/4}
+funInfoArity :: Profile -> CmmExpr -> CmmExpr
+[LclIdX,
+ Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
+ WorkFree=True, Expandable=True, Guidance=IF_ARGS [0 0] 430 0}]
+funInfoArity
+ = \ (profile_a19w9 :: Profile) (iptr_a19wa :: CmmExpr) ->
+ let {
+ platform_a19wb :: Platform
+ [LclId,
+ Unf=Unf{Src=<vanilla>, TopLvl=False, Value=False, ConLike=False,
+ WorkFree=False, Expandable=True, Guidance=IF_ARGS [] 20 0}]
+ platform_a19wb = profilePlatform profile_a19w9 } in
+ let {
+ pc_a19wh :: PlatformConstants
+ [LclId,
+ Unf=Unf{Src=<vanilla>, TopLvl=False, Value=False, ConLike=False,
+ WorkFree=False, Expandable=True, Guidance=IF_ARGS [] 20 0}]
+ pc_a19wh = platformConstants platform_a19wb } in
+ let {
+ ds_d19P6 :: (Int, Int)
+ [LclId,
+ Unf=Unf{Src=<vanilla>, TopLvl=False, Value=False, ConLike=False,
+ WorkFree=False, Expandable=False, Guidance=IF_ARGS [] 140 60}]
+ ds_d19P6
+ = case platformTablesNextToCode platform_a19wb of {
+ False ->
+ (pc_REP_StgFunInfoExtraFwd_arity pc_a19wh,
+ pc_OFFSET_StgFunInfoExtraFwd_arity pc_a19wh);
+ True ->
+ (pc_REP_StgFunInfoExtraRev_arity pc_a19wh,
+ pc_OFFSET_StgFunInfoExtraRev_arity pc_a19wh)
+ } } in
+ let {
+ rep_bytes_a19wf :: Int
+ [LclId,
+ Unf=Unf{Src=<vanilla>, TopLvl=False, Value=False, ConLike=False,
+ WorkFree=True, Expandable=False, Guidance=IF_ARGS [] 10 0}]
+ rep_bytes_a19wf
+ = case ds_d19P6 of { (rep_bytes_a19wf, _ [Occ=Dead]) ->
+ rep_bytes_a19wf
+ } } in
+ cmmToWord
+ platform_a19wb
+ (cmmLoadIndex
+ platform_a19wb
+ (cmmBits (widthFromBytes rep_bytes_a19wf))
+ (funInfoTable profile_a19w9 iptr_a19wa)
+ (div
+ @ Int
+ GHC.Real.$fIntegralInt
+ (case ds_d19P6 of { (_ [Occ=Dead], offset_a19wg) -> offset_a19wg })
+ rep_bytes_a19wf))
+
+-- RHS size: {terms: 22, types: 5, coercions: 0, joins: 0/1}
+infoTable :: Profile -> CmmExpr -> CmmExpr
+[LclIdX,
+ Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
+ WorkFree=True, Expandable=True, Guidance=IF_ARGS [0 0] 210 0}]
+infoTable
+ = \ (profile_a19vR :: Profile) (info_ptr_a19vS :: CmmExpr) ->
+ let {
+ platform_a19vT :: Platform
+ [LclId,
+ Unf=Unf{Src=<vanilla>, TopLvl=False, Value=False, ConLike=False,
+ WorkFree=False, Expandable=True, Guidance=IF_ARGS [] 20 0}]
+ platform_a19vT = profilePlatform profile_a19vR } in
+ case platformTablesNextToCode platform_a19vT of {
+ False ->
+ cmmOffsetW
+ platform_a19vT info_ptr_a19vS (ghc-prim-0.6.1:GHC.Types.I# 1#);
+ True ->
+ cmmOffsetB
+ platform_a19vT
+ info_ptr_a19vS
+ (negate
+ @ ByteOff GHC.Num.$fNumInt (stdInfoTableSizeB profile_a19vR))
+ }
+
+-- RHS size: {terms: 29, types: 12, coercions: 0, joins: 0/3}
+getConstrTag :: PtrOpts -> CmmExpr -> CmmExpr
+[LclIdX,
+ Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
+ WorkFree=True, Expandable=True, Guidance=IF_ARGS [0 0] 270 30}]
+getConstrTag
+ = \ (opts_a19vH :: PtrOpts) (closure_ptr_a19vI :: CmmExpr) ->
+ let {
+ profile_a19vL :: Profile
+ [LclId,
+ Unf=Unf{Src=<vanilla>, TopLvl=False, Value=False, ConLike=False,
+ WorkFree=False, Expandable=True, Guidance=IF_ARGS [] 20 0}]
+ profile_a19vL = po_profile opts_a19vH } in
+ let {
+ platform_a19vK :: Platform
+ [LclId,
+ Unf=Unf{Src=<vanilla>, TopLvl=False, Value=False, ConLike=False,
+ WorkFree=False, Expandable=True, Guidance=IF_ARGS [] 20 0}]
+ platform_a19vK = profilePlatform profile_a19vL } in
+ let {
+ info_table_a19vJ :: CmmExpr
+ [LclId,
+ Unf=Unf{Src=<vanilla>, TopLvl=False, Value=False, ConLike=False,
+ WorkFree=False, Expandable=False, Guidance=IF_ARGS [] 60 0}]
+ info_table_a19vJ
+ = infoTable
+ profile_a19vL (closureInfoPtr opts_a19vH closure_ptr_a19vI) } in
+ GHC.Cmm.Expr.CmmMachOp
+ (GHC.Cmm.MachOp.MO_UU_Conv
+ (halfWordWidth platform_a19vK) (wordWidth platform_a19vK))
+ (GHC.Base.build
+ @ CmmExpr
+ (\ (@ a_d19Py)
+ (c_d19Pz :: CmmExpr -> a_d19Py -> a_d19Py)
+ (n_d19PA :: a_d19Py) ->
+ c_d19Pz
+ (infoTableConstrTag profile_a19vL info_table_a19vJ) n_d19PA))
+
+-- RHS size: {terms: 29, types: 12, coercions: 0, joins: 0/3}
+cmmGetClosureType :: PtrOpts -> CmmExpr -> CmmExpr
+[LclIdX,
+ Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
+ WorkFree=True, Expandable=True, Guidance=IF_ARGS [0 0] 270 30}]
+cmmGetClosureType
+ = \ (opts_a19vM :: PtrOpts) (closure_ptr_a19vN :: CmmExpr) ->
+ let {
+ profile_a19vQ :: Profile
+ [LclId,
+ Unf=Unf{Src=<vanilla>, TopLvl=False, Value=False, ConLike=False,
+ WorkFree=False, Expandable=True, Guidance=IF_ARGS [] 20 0}]
+ profile_a19vQ = po_profile opts_a19vM } in
+ let {
+ platform_a19vP :: Platform
+ [LclId,
+ Unf=Unf{Src=<vanilla>, TopLvl=False, Value=False, ConLike=False,
+ WorkFree=False, Expandable=True, Guidance=IF_ARGS [] 20 0}]
+ platform_a19vP = profilePlatform profile_a19vQ } in
+ let {
+ info_table_a19vO :: CmmExpr
+ [LclId,
+ Unf=Unf{Src=<vanilla>, TopLvl=False, Value=False, ConLike=False,
+ WorkFree=False, Expandable=False, Guidance=IF_ARGS [] 60 0}]
+ info_table_a19vO
+ = infoTable
+ profile_a19vQ (closureInfoPtr opts_a19vM closure_ptr_a19vN) } in
+ GHC.Cmm.Expr.CmmMachOp
+ (GHC.Cmm.MachOp.MO_UU_Conv
+ (halfWordWidth platform_a19vP) (wordWidth platform_a19vP))
+ (GHC.Base.build
+ @ CmmExpr
+ (\ (@ a_d19PB)
+ (c_d19PC :: CmmExpr -> a_d19PB -> a_d19PB)
+ (n_d19PD :: a_d19PB) ->
+ c_d19PC
+ (infoTableClosureType profile_a19vQ info_table_a19vO) n_d19PD))
+
+
+
+==================== Desugar (after optimization) ====================
+2020-11-24 12:44:28.6838104 UTC
+
+Result size of Desugar (after optimization)
+ = {terms: 1,342, types: 1,611, coercions: 23, joins: 1/41}
+
+-- RHS size: {terms: 5, types: 4, coercions: 0, joins: 0/0}
+po_align_check :: PtrOpts -> Bool
+[LclIdX[[RecSel]],
+ Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
+ WorkFree=True, Expandable=True,
+ Guidance=ALWAYS_IF(arity=1,unsat_ok=True,boring_ok=True)}]
+po_align_check
+ = \ (ds_d5kbX :: PtrOpts) ->
+ case ds_d5kbX of { PtrOpts _ [Occ=Dead] ds_d5kbZ -> ds_d5kbZ }
+
+-- RHS size: {terms: 5, types: 4, coercions: 0, joins: 0/0}
+po_profile :: PtrOpts -> Profile
+[LclIdX[[RecSel]],
+ Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
+ WorkFree=True, Expandable=True,
+ Guidance=ALWAYS_IF(arity=1,unsat_ok=True,boring_ok=True)}]
+po_profile
+ = \ (ds_d5kbU :: PtrOpts) ->
+ case ds_d5kbU of { PtrOpts ds_d5kbV _ [Occ=Dead] -> ds_d5kbV }
+
+-- RHS size: {terms: 8, types: 6, coercions: 0, joins: 0/0}
+mkEmptyContInfoTable :: CLabel -> CmmInfoTable
+[LclIdX,
+ Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
+ WorkFree=True, Expandable=True, Guidance=IF_ARGS [0] 30 60}]
+mkEmptyContInfoTable
+ = \ (info_lbl_a5jFo :: CLabel) ->
+ GHC.Cmm.CmmInfoTable
+ info_lbl_a5jFo
+ (mkStackRep (ghc-prim-0.6.1:GHC.Types.[] @ Bool))
+ GHC.Cmm.NoProfilingInfo
+ (GHC.Maybe.Nothing @ CLabel)
+ (GHC.Maybe.Nothing
+ @ (GHC.Types.Var.Id, GHC.Types.CostCentre.CostCentreStack))
+
+-- RHS size: {terms: 28, types: 8, coercions: 0, joins: 0/0}
+makeRelativeRefTo :: Platform -> CLabel -> CmmLit -> CmmLit
+[LclIdX,
+ Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
+ WorkFree=True, Expandable=True, Guidance=IF_ARGS [0 0 70] 140 100}]
+makeRelativeRefTo
+ = \ (platform_a5jH9 :: Platform)
+ (info_lbl_a5jHa :: CLabel)
+ (lit_a5jHb :: CmmLit) ->
+ case platformTablesNextToCode platform_a5jH9 of {
+ False -> lit_a5jHb;
+ True ->
+ case lit_a5jHb of {
+ __DEFAULT -> lit_a5jHb;
+ CmmLabel lbl_a5jHc ->
+ GHC.Cmm.Expr.CmmLabelDiffOff
+ lbl_a5jHc
+ info_lbl_a5jHa
+ (ghc-prim-0.6.1:GHC.Types.I# 0#)
+ (wordWidth platform_a5jH9);
+ CmmLabelOff lbl_a5jHd off_a5jHe ->
+ GHC.Cmm.Expr.CmmLabelDiffOff
+ lbl_a5jHd info_lbl_a5jHa off_a5jHe (wordWidth platform_a5jH9)
+ }
+ }
+
+-- RHS size: {terms: 25, types: 11, coercions: 0, joins: 0/1}
+wordAligned :: PtrOpts -> CmmExpr -> CmmExpr
+[LclIdX,
+ Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
+ WorkFree=True, Expandable=True, Guidance=IF_ARGS [0 0] 200 30}]
+wordAligned
+ = \ (opts_a5jHJ :: PtrOpts) (e_a5jHK :: CmmExpr) ->
+ let {
+ platform_a5jHL :: Platform
+ [LclId,
+ Unf=Unf{Src=<vanilla>, TopLvl=False, Value=False, ConLike=False,
+ WorkFree=False, Expandable=True, Guidance=IF_ARGS [] 40 0}]
+ platform_a5jHL = profilePlatform (po_profile opts_a5jHJ) } in
+ case po_align_check opts_a5jHJ of {
+ False -> e_a5jHK;
+ True ->
+ GHC.Cmm.Expr.CmmMachOp
+ (GHC.Cmm.MachOp.MO_AlignmentCheck
+ (platformWordSizeInBytes platform_a5jHL)
+ (wordWidth platform_a5jHL))
+ (GHC.Base.build
+ @ CmmExpr
+ (\ (@ a_d5k1l)
+ (c_d5k1m :: CmmExpr -> a_d5k1l -> a_d5k1l)
+ (n_d5k1n :: a_d5k1l) ->
+ c_d5k1m e_a5jHK n_d5k1n))
+ }
+
+-- RHS size: {terms: 10, types: 2, coercions: 0, joins: 0/0}
+closureInfoPtr :: PtrOpts -> CmmExpr -> CmmExpr
+[LclIdX,
+ Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
+ WorkFree=True, Expandable=True, Guidance=IF_ARGS [0 0] 120 0}]
+closureInfoPtr
+ = \ (opts_a5jHM :: PtrOpts) (e_a5jHN :: CmmExpr) ->
+ GHC.Cmm.Expr.$WCmmLoad
+ (wordAligned opts_a5jHM e_a5jHN)
+ (bWord (profilePlatform (po_profile opts_a5jHM)))
+
+-- RHS size: {terms: 12, types: 3, coercions: 0, joins: 0/0}
+entryCode :: Platform -> CmmExpr -> CmmExpr
+[LclIdX,
+ Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
+ WorkFree=True, Expandable=True, Guidance=IF_ARGS [0 0] 90 0}]
+entryCode
+ = \ (platform_a5jHO :: Platform) (e_a5jHP :: CmmExpr) ->
+ case platformTablesNextToCode platform_a5jHO of {
+ False -> GHC.Cmm.Expr.$WCmmLoad e_a5jHP (bWord platform_a5jHO);
+ True -> e_a5jHP
+ }
+
+-- RHS size: {terms: 2, types: 0, coercions: 0, joins: 0/0}
+fixedInfoTableSizeW :: WordOff
+[LclIdX,
+ Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
+ WorkFree=True, Expandable=True, Guidance=IF_ARGS [] 10 20}]
+fixedInfoTableSizeW = ghc-prim-0.6.1:GHC.Types.I# 2#
+
+-- RHS size: {terms: 2, types: 0, coercions: 0, joins: 0/0}
+profInfoTableSizeW :: WordOff
+[LclIdX,
+ Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
+ WorkFree=True, Expandable=True, Guidance=IF_ARGS [] 10 20}]
+profInfoTableSizeW = ghc-prim-0.6.1:GHC.Types.I# 2#
+
+-- RHS size: {terms: 5, types: 0, coercions: 0, joins: 0/0}
+GHC.Cmm.Info.$trModule :: ghc-prim-0.6.1:GHC.Types.Module
+[LclIdX,
+ Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
+ WorkFree=True, Expandable=True, Guidance=IF_ARGS [] 90 30}]
+GHC.Cmm.Info.$trModule
+ = ghc-prim-0.6.1:GHC.Types.Module
+ (ghc-prim-0.6.1:GHC.Types.TrNameS "ghc"#)
+ (ghc-prim-0.6.1:GHC.Types.TrNameS "GHC.Cmm.Info"#)
+
+-- RHS size: {terms: 3, types: 1, coercions: 0, joins: 0/0}
+$krep_a5k0O [InlPrag=NOUSERINLINE[~]]
+ :: ghc-prim-0.6.1:GHC.Types.KindRep
+[LclId,
+ Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
+ WorkFree=True, Expandable=True, Guidance=IF_ARGS [] 10 30}]
+$krep_a5k0O
+ = ghc-prim-0.6.1:GHC.Types.KindRepTyConApp
+ ghc-prim-0.6.1:GHC.Types.$tcBool
+ (ghc-prim-0.6.1:GHC.Types.[] @ ghc-prim-0.6.1:GHC.Types.KindRep)
+
+-- RHS size: {terms: 3, types: 1, coercions: 0, joins: 0/0}
+$krep_a5k0M [InlPrag=NOUSERINLINE[~]]
+ :: ghc-prim-0.6.1:GHC.Types.KindRep
+[LclId,
+ Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
+ WorkFree=True, Expandable=True, Guidance=IF_ARGS [] 10 30}]
+$krep_a5k0M
+ = ghc-prim-0.6.1:GHC.Types.KindRepTyConApp
+ GHC.Platform.Profile.$tcProfile
+ (ghc-prim-0.6.1:GHC.Types.[] @ ghc-prim-0.6.1:GHC.Types.KindRep)
+
+-- RHS size: {terms: 8, types: 0, coercions: 0, joins: 0/0}
+GHC.Cmm.Info.$tcPtrOpts :: ghc-prim-0.6.1:GHC.Types.TyCon
+[LclIdX,
+ Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
+ WorkFree=True, Expandable=True, Guidance=IF_ARGS [] 50 70}]
+GHC.Cmm.Info.$tcPtrOpts
+ = ghc-prim-0.6.1:GHC.Types.TyCon
+ 10783844252980521413##
+ 13019815378033756893##
+ GHC.Cmm.Info.$trModule
+ (ghc-prim-0.6.1:GHC.Types.TrNameS "PtrOpts"#)
+ 0#
+ ghc-prim-0.6.1:GHC.Types.krep$*
+
+-- RHS size: {terms: 3, types: 1, coercions: 0, joins: 0/0}
+$krep_a5k0P [InlPrag=NOUSERINLINE[~]]
+ :: ghc-prim-0.6.1:GHC.Types.KindRep
+[LclId,
+ Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
+ WorkFree=True, Expandable=True, Guidance=IF_ARGS [] 10 30}]
+$krep_a5k0P
+ = ghc-prim-0.6.1:GHC.Types.KindRepTyConApp
+ GHC.Cmm.Info.$tcPtrOpts
+ (ghc-prim-0.6.1:GHC.Types.[] @ ghc-prim-0.6.1:GHC.Types.KindRep)
+
+-- RHS size: {terms: 3, types: 0, coercions: 0, joins: 0/0}
+$krep_a5k0N [InlPrag=NOUSERINLINE[~]]
+ :: ghc-prim-0.6.1:GHC.Types.KindRep
+[LclId,
+ Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
+ WorkFree=True, Expandable=True, Guidance=IF_ARGS [] 10 30}]
+$krep_a5k0N
+ = ghc-prim-0.6.1:GHC.Types.KindRepFun $krep_a5k0O $krep_a5k0P
+
+-- RHS size: {terms: 3, types: 0, coercions: 0, joins: 0/0}
+$krep_a5k0L [InlPrag=NOUSERINLINE[~]]
+ :: ghc-prim-0.6.1:GHC.Types.KindRep
+[LclId,
+ Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
+ WorkFree=True, Expandable=True, Guidance=IF_ARGS [] 10 30}]
+$krep_a5k0L
+ = ghc-prim-0.6.1:GHC.Types.KindRepFun $krep_a5k0M $krep_a5k0N
+
+-- RHS size: {terms: 8, types: 0, coercions: 0, joins: 0/0}
+GHC.Cmm.Info.$tc'PtrOpts :: ghc-prim-0.6.1:GHC.Types.TyCon
+[LclIdX,
+ Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
+ WorkFree=True, Expandable=True, Guidance=IF_ARGS [] 50 70}]
+GHC.Cmm.Info.$tc'PtrOpts
+ = ghc-prim-0.6.1:GHC.Types.TyCon
+ 11086577099826734001##
+ 4931096801432934088##
+ GHC.Cmm.Info.$trModule
+ (ghc-prim-0.6.1:GHC.Types.TrNameS "'PtrOpts"#)
+ 0#
+ $krep_a5k0L
+
+-- RHS size: {terms: 20, types: 3, coercions: 11, joins: 0/0}
+$dIP_a5jV3 :: HasCallStack
+[LclId,
+ Unf=Unf{Src=<vanilla>, TopLvl=True, Value=False, ConLike=False,
+ WorkFree=False, Expandable=False, Guidance=IF_ARGS [] 390 0}]
+$dIP_a5jV3
+ = (GHC.Stack.Types.pushCallStack
+ (ghc-prim-0.6.1:GHC.CString.unpackCString# "pprPanic"#,
+ GHC.Stack.Types.SrcLoc
+ (ghc-prim-0.6.1:GHC.CString.unpackCString# "ghc"#)
+ (ghc-prim-0.6.1:GHC.CString.unpackCString# "GHC.Cmm.Info"#)
+ (ghc-prim-0.6.1:GHC.CString.unpackCString#
+ "E:\\\\ghc_inferTags\\\\compiler\\\\GHC\\\\Cmm\\\\Info.hs"#)
+ (ghc-prim-0.6.1:GHC.Types.I# 264#)
+ (ghc-prim-0.6.1:GHC.Types.I# 25#)
+ (ghc-prim-0.6.1:GHC.Types.I# 264#)
+ (ghc-prim-0.6.1:GHC.Types.I# 57#))
+ ((GHC.Stack.Types.emptyCallStack
+ `cast` (Sym (ghc-prim-0.6.1:GHC.Classes.N:IP[0]
+ <"callStack">_N <GHC.Stack.Types.CallStack>_N)
+ :: GHC.Stack.Types.CallStack
+ ~R# (?callStack::GHC.Stack.Types.CallStack)))
+ `cast` (ghc-prim-0.6.1:GHC.Classes.N:IP[0]
+ <"callStack">_N <GHC.Stack.Types.CallStack>_N
+ :: (?callStack::GHC.Stack.Types.CallStack)
+ ~R# GHC.Stack.Types.CallStack)))
+ `cast` (Sym (ghc-prim-0.6.1:GHC.Classes.N:IP[0]
+ <"callStack">_N <GHC.Stack.Types.CallStack>_N)
+ :: GHC.Stack.Types.CallStack
+ ~R# (?callStack::GHC.Stack.Types.CallStack))
+
+-- RHS size: {terms: 9, types: 2, coercions: 0, joins: 0/0}
+inlineSRT :: Platform -> Bool
+[LclIdX,
+ Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
+ WorkFree=True, Expandable=True, Guidance=IF_ARGS [0] 110 0}]
+inlineSRT
+ = \ (platform_a5jH8 :: Platform) ->
+ &&
+ (==
+ @ Arch
+ GHC.Platform.ArchOS.$fEqArch
+ (platformArch platform_a5jH8)
+ GHC.Platform.ArchOS.ArchX86_64)
+ (platformTablesNextToCode platform_a5jH8)
+
+-- RHS size: {terms: 40, types: 26, coercions: 0, joins: 0/0}
+mkSRTLit
+ :: Platform -> CLabel -> Maybe CLabel -> ([CmmLit], CmmLit)
+[LclIdX,
+ Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
+ WorkFree=True, Expandable=True, Guidance=IF_ARGS [0 0 190] 490 90}]
+mkSRTLit
+ = \ (platform_a5jH2 :: Platform)
+ (info_lbl_a5jH3 :: CLabel)
+ (ds_d5k3t :: Maybe CLabel) ->
+ case ds_d5k3t of {
+ Nothing ->
+ (ghc-prim-0.6.1:GHC.Types.[] @ CmmLit,
+ GHC.Cmm.Expr.$WCmmInt 0 (halfWordWidth platform_a5jH2));
+ Just lbl_a5jH4 ->
+ case inlineSRT platform_a5jH2 of {
+ False ->
+ (GHC.Base.build
+ @ CmmLit
+ (\ (@ a_d5k3A)
+ (c_d5k3B :: CmmLit -> a_d5k3A -> a_d5k3A)
+ (n_d5k3C :: a_d5k3A) ->
+ c_d5k3B (GHC.Cmm.Expr.CmmLabel lbl_a5jH4) n_d5k3C),
+ GHC.Cmm.Expr.$WCmmInt 1 (halfWordWidth platform_a5jH2));
+ True ->
+ (ghc-prim-0.6.1:GHC.Types.[] @ CmmLit,
+ GHC.Cmm.Expr.CmmLabelDiffOff
+ lbl_a5jH4
+ info_lbl_a5jH3
+ (ghc-prim-0.6.1:GHC.Types.I# 0#)
+ (halfWordWidth platform_a5jH2))
+ }
+ }
+
+-- RHS size: {terms: 14, types: 26, coercions: 0, joins: 0/0}
+newStringLit
+ :: forall info stmt.
+ ByteString -> UniqSM (CmmLit, GenCmmDecl RawCmmStatics info stmt)
+[LclIdX,
+ Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
+ WorkFree=True, Expandable=True, Guidance=IF_ARGS [0] 150 0}]
+newStringLit
+ = \ (@ info_a5jQm) (@ stmt_a5jQn) (bytes_a5jHG :: ByteString) ->
+ >>=
+ @ UniqSM
+ GHC.Types.Unique.Supply.$fMonadUniqSM
+ @ GHC.Types.Unique.Unique
+ @ (CmmLit, GenCmmDecl RawCmmStatics info_a5jQm stmt_a5jQn)
+ (getUniqueM @ UniqSM GHC.Types.Unique.Supply.$fMonadUniqueUniqSM)
+ (\ (uniq_a5jHH :: GHC.Types.Unique.Unique) ->
+ return
+ @ UniqSM
+ GHC.Types.Unique.Supply.$fMonadUniqSM
+ @ (CmmLit, GenCmmDecl (GenCmmStatics 'True) info_a5jQm stmt_a5jQn)
+ (mkByteStringCLit
+ @ 'True
+ @ info_a5jQm
+ @ stmt_a5jQn
+ (mkStringLitLabel uniq_a5jHH)
+ bytes_a5jHG))
+
+-- RHS size: {terms: 46, types: 131, coercions: 0, joins: 0/0}
+mkProfLits
+ :: Platform
+ -> ProfilingInfo -> UniqSM ((CmmLit, CmmLit), [RawCmmDecl])
+[LclIdX,
+ Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
+ WorkFree=True, Expandable=True, Guidance=IF_ARGS [0 120] 400 0}]
+mkProfLits
+ = \ (platform_a5jHz :: Platform) (ds_d5k1C :: ProfilingInfo) ->
+ case ds_d5k1C of {
+ NoProfilingInfo ->
+ return
+ @ UniqSM
+ GHC.Types.Unique.Supply.$fMonadUniqSM
+ @ ((CmmLit, CmmLit), [RawCmmDecl])
+ ((zeroCLit platform_a5jHz, zeroCLit platform_a5jHz),
+ ghc-prim-0.6.1:GHC.Types.[] @ RawCmmDecl);
+ ProfilingInfo td_a5jHA cd_a5jHB ->
+ >>=
+ @ UniqSM
+ GHC.Types.Unique.Supply.$fMonadUniqSM
+ @ (CmmLit,
+ GenCmmDecl
+ RawCmmStatics
+ (GHC.Cmm.Dataflow.Label.LabelMap RawCmmStatics)
+ CmmGraph)
+ @ ((CmmLit, CmmLit), [RawCmmDecl])
+ (newStringLit
+ @ (GHC.Cmm.Dataflow.Label.LabelMap RawCmmStatics)
+ @ CmmGraph
+ td_a5jHA)
+ (\ (ds_d5k1P
+ :: (CmmLit,
+ GenCmmDecl
+ RawCmmStatics
+ (GHC.Cmm.Dataflow.Label.LabelMap RawCmmStatics)
+ CmmGraph)) ->
+ case ds_d5k1P of { (td_lit_a5jHC, td_decl_a5jHD) ->
+ >>=
+ @ UniqSM
+ GHC.Types.Unique.Supply.$fMonadUniqSM
+ @ (CmmLit,
+ GenCmmDecl
+ RawCmmStatics
+ (GHC.Cmm.Dataflow.Label.LabelMap RawCmmStatics)
+ CmmGraph)
+ @ ((CmmLit, CmmLit), [RawCmmDecl])
+ (newStringLit
+ @ (GHC.Cmm.Dataflow.Label.LabelMap RawCmmStatics)
+ @ CmmGraph
+ cd_a5jHB)
+ (\ (ds_d5k1K
+ :: (CmmLit,
+ GenCmmDecl
+ RawCmmStatics
+ (GHC.Cmm.Dataflow.Label.LabelMap RawCmmStatics)
+ CmmGraph)) ->
+ case ds_d5k1K of { (cd_lit_a5jHE, cd_decl_a5jHF) ->
+ return
+ @ UniqSM
+ GHC.Types.Unique.Supply.$fMonadUniqSM
+ @ ((CmmLit, CmmLit),
+ [GenCmmDecl
+ RawCmmStatics
+ (GHC.Cmm.Dataflow.Label.LabelMap RawCmmStatics)
+ CmmGraph])
+ ((td_lit_a5jHC, cd_lit_a5jHE),
+ GHC.Base.build
+ @ (GenCmmDecl
+ RawCmmStatics
+ (GHC.Cmm.Dataflow.Label.LabelMap RawCmmStatics)
+ CmmGraph)
+ (\ (@ a_d5k1H)
+ (c_d5k1I
+ :: GenCmmDecl
+ RawCmmStatics
+ (GHC.Cmm.Dataflow.Label.LabelMap RawCmmStatics)
+ CmmGraph
+ -> a_d5k1H -> a_d5k1H)
+ (n_d5k1J :: a_d5k1H) ->
+ c_d5k1I td_decl_a5jHD (c_d5k1I cd_decl_a5jHF n_d5k1J)))
+ })
+ })
+ }
+
+-- RHS size: {terms: 6, types: 2, coercions: 0, joins: 0/0}
+srtEscape :: Platform -> StgHalfWord
+[LclIdX,
+ Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
+ WorkFree=True, Expandable=True, Guidance=IF_ARGS [0] 160 0}]
+srtEscape
+ = \ (platform_a5jHI :: Platform) ->
+ toStgHalfWord
+ platform_a5jHI (negate @ Integer GHC.Num.$fNumInteger 1)
+
+-- RHS size: {terms: 44, types: 32, coercions: 0, joins: 0/1}
+mkStdInfoTable
+ :: DynFlags
+ -> (CmmLit, CmmLit) -> Int -> CmmLit -> CmmLit -> [CmmLit]
+[LclIdX,
+ Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
+ WorkFree=True, Expandable=True,
+ Guidance=IF_ARGS [0 20 0 0 0] 390 0}]
+mkStdInfoTable
+ = \ (dflags_a5jHq :: DynFlags)
+ (ds_d5k20 :: (CmmLit, CmmLit))
+ (cl_type_a5jHt :: Int)
+ (srt_a5jHu :: CmmLit)
+ (layout_lit_a5jHv :: CmmLit) ->
+ case ds_d5k20 of { (type_descr_a5jHr, closure_descr_a5jHs) ->
+ let {
+ tag_a5jHy :: CmmLit
+ [LclId,
+ Unf=Unf{Src=<vanilla>, TopLvl=False, Value=False, ConLike=False,
+ WorkFree=False, Expandable=False, Guidance=IF_ARGS [] 110 0}]
+ tag_a5jHy
+ = GHC.Cmm.Expr.$WCmmInt
+ (fromIntegral
+ @ Int
+ @ Integer
+ GHC.Real.$fIntegralInt
+ GHC.Num.$fNumInteger
+ cl_type_a5jHt)
+ (halfWordWidth (targetPlatform dflags_a5jHq)) } in
+ ++
+ @ CmmLit
+ (case sccProfilingEnabled dflags_a5jHq of {
+ False -> ghc-prim-0.6.1:GHC.Types.[] @ CmmLit;
+ True ->
+ GHC.Base.build
+ @ CmmLit
+ (\ (@ a_d5k2a)
+ (c_d5k2b :: CmmLit -> a_d5k2a -> a_d5k2a)
+ (n_d5k2c :: a_d5k2a) ->
+ c_d5k2b type_descr_a5jHr (c_d5k2b closure_descr_a5jHs n_d5k2c))
+ })
+ (GHC.Base.build
+ @ CmmLit
+ (\ (@ a_d5k23)
+ (c_d5k24 :: CmmLit -> a_d5k23 -> a_d5k23)
+ (n_d5k25 :: a_d5k23) ->
+ c_d5k24
+ layout_lit_a5jHv (c_d5k24 tag_a5jHy (c_d5k24 srt_a5jHu n_d5k25))))
+ }
+
+-- RHS size: {terms: 89, types: 85, coercions: 0, joins: 0/5}
+mkLivenessBits
+ :: DynFlags -> Liveness -> UniqSM (CmmLit, [RawCmmDecl])
+[LclIdX,
+ Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
+ WorkFree=True, Expandable=True, Guidance=NEVER}]
+mkLivenessBits
+ = \ (dflags_a5jHf :: DynFlags) (liveness_a5jHg :: Liveness) ->
+ let {
+ n_bits_a5jHi :: Int
+ [LclId,
+ Unf=Unf{Src=<vanilla>, TopLvl=False, Value=False, ConLike=False,
+ WorkFree=False, Expandable=False, Guidance=IF_ARGS [] 30 0}]
+ n_bits_a5jHi
+ = length @ [] Data.Foldable.$fFoldable[] @ Bool liveness_a5jHg } in
+ let {
+ platform_a5jHh :: Platform
+ [LclId,
+ Unf=Unf{Src=<vanilla>, TopLvl=False, Value=False, ConLike=False,
+ WorkFree=False, Expandable=True, Guidance=IF_ARGS [] 20 0}]
+ platform_a5jHh = targetPlatform dflags_a5jHf } in
+ let {
+ bitmap_a5jHj :: Bitmap
+ [LclId,
+ Unf=Unf{Src=<vanilla>, TopLvl=False, Value=False, ConLike=False,
+ WorkFree=False, Expandable=False, Guidance=IF_ARGS [] 30 0}]
+ bitmap_a5jHj = mkBitmap platform_a5jHh liveness_a5jHg } in
+ let {
+ lits_a5jHm :: [CmmLit]
+ [LclId,
+ Unf=Unf{Src=<vanilla>, TopLvl=False, Value=True, ConLike=True,
+ WorkFree=False, Expandable=False, Guidance=IF_ARGS [] 130 30}]
+ lits_a5jHm
+ = ghc-prim-0.6.1:GHC.Types.:
+ @ CmmLit
+ (mkWordCLit
+ platform_a5jHh
+ (fromIntegral
+ @ Int
+ @ Integer
+ GHC.Real.$fIntegralInt
+ GHC.Num.$fNumInteger
+ n_bits_a5jHi))
+ (map
+ @ StgWord
+ @ CmmLit
+ (mkStgWordCLit platform_a5jHh)
+ bitmap_a5jHj) } in
+ case > @ Int
+ ghc-prim-0.6.1:GHC.Classes.$fOrdInt
+ n_bits_a5jHi
+ (mAX_SMALL_BITMAP_SIZE platform_a5jHh)
+ of {
+ False ->
+ return
+ @ UniqSM
+ GHC.Types.Unique.Supply.$fMonadUniqSM
+ @ (CmmLit, [RawCmmDecl])
+ (mkStgWordCLit
+ platform_a5jHh
+ (.|.
+ @ StgWord
+ GHC.Runtime.Heap.Layout.$fBitsStgWord
+ (toStgWord
+ platform_a5jHh
+ (fromIntegral
+ @ Int
+ @ Integer
+ GHC.Real.$fIntegralInt
+ GHC.Num.$fNumInteger
+ n_bits_a5jHi))
+ (shiftL
+ @ StgWord
+ GHC.Runtime.Heap.Layout.$fBitsStgWord
+ (case bitmap_a5jHj of {
+ [] -> toStgWord platform_a5jHh 0;
+ : b_a5jHn ds_d5k2R ->
+ case ds_d5k2R of {
+ __DEFAULT ->
+ panic
+ @ StgWord
+ (ghc-prim-0.6.1:GHC.CString.unpackCString# "mkLiveness"#);
+ [] -> b_a5jHn
+ }
+ })
+ (pc_BITMAP_BITS_SHIFT (platformConstants platform_a5jHh)))),
+ ghc-prim-0.6.1:GHC.Types.[] @ RawCmmDecl);
+ True ->
+ >>=
+ @ UniqSM
+ GHC.Types.Unique.Supply.$fMonadUniqSM
+ @ GHC.Types.Unique.Unique
+ @ (CmmLit, [RawCmmDecl])
+ (getUniqueM @ UniqSM GHC.Types.Unique.Supply.$fMonadUniqueUniqSM)
+ (\ (uniq_a5jHo :: GHC.Types.Unique.Unique) ->
+ let {
+ bitmap_lbl_a5jHp :: CLabel
+ [LclId,
+ Unf=Unf{Src=<vanilla>, TopLvl=False, Value=False, ConLike=False,
+ WorkFree=False, Expandable=False, Guidance=IF_ARGS [] 20 0}]
+ bitmap_lbl_a5jHp = mkBitmapLabel uniq_a5jHo } in
+ return
+ @ UniqSM
+ GHC.Types.Unique.Supply.$fMonadUniqSM
+ @ (CmmLit,
+ [GenCmmDecl
+ (GenCmmStatics 'True)
+ (GHC.Cmm.Dataflow.Label.LabelMap RawCmmStatics)
+ CmmGraph])
+ (GHC.Cmm.Expr.CmmLabel bitmap_lbl_a5jHp,
+ GHC.Base.build
+ @ (GenCmmDecl
+ (GenCmmStatics 'True)
+ (GHC.Cmm.Dataflow.Label.LabelMap RawCmmStatics)
+ CmmGraph)
+ (\ (@ a_d5k2l)
+ (c_d5k2m
+ :: GenCmmDecl
+ (GenCmmStatics 'True)
+ (GHC.Cmm.Dataflow.Label.LabelMap RawCmmStatics)
+ CmmGraph
+ -> a_d5k2l -> a_d5k2l)
+ (n_d5k2n :: a_d5k2l) ->
+ c_d5k2m
+ (mkRODataLits
+ @ 'True
+ @ (GHC.Cmm.Dataflow.Label.LabelMap RawCmmStatics)
+ @ CmmGraph
+ bitmap_lbl_a5jHp
+ lits_a5jHm)
+ n_d5k2n)))
+ }
+
+-- RHS size: {terms: 17, types: 7, coercions: 0, joins: 0/0}
+packIntsCLit :: Platform -> Int -> Int -> CmmLit
+[LclIdX,
+ Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
+ WorkFree=True, Expandable=True, Guidance=IF_ARGS [0 0 0] 180 0}]
+packIntsCLit
+ = \ (platform_a5jGZ :: Platform)
+ (a_a5jH0 :: Int)
+ (b_a5jH1 :: Int) ->
+ packHalfWordsCLit
+ platform_a5jGZ
+ (toStgHalfWord
+ platform_a5jGZ
+ (fromIntegral
+ @ Int
+ @ Integer
+ GHC.Real.$fIntegralInt
+ GHC.Num.$fNumInteger
+ a_a5jH0))
+ (toStgHalfWord
+ platform_a5jGZ
+ (fromIntegral
+ @ Int
+ @ Integer
+ GHC.Real.$fIntegralInt
+ GHC.Num.$fNumInteger
+ b_a5jH1))
+
+Rec {
+-- RHS size: {terms: 338, types: 541, coercions: 0, joins: 1/12}
+mkInfoTableContents [Occ=LoopBreaker]
+ :: DynFlags
+ -> CmmInfoTable
+ -> Maybe Int
+ -> UniqSM ([RawCmmDecl], InfoTableContents)
+[LclIdX,
+ Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
+ WorkFree=True, Expandable=True, Guidance=NEVER}]
+mkInfoTableContents
+ = \ (dflags_a5jG3 :: DynFlags)
+ (info_a5jG4 :: CmmInfoTable)
+ (mb_rts_tag_a5jG9 :: Maybe Int) ->
+ case info_a5jG4 of wild_00
+ { CmmInfoTable ds_d5k8t ds_d5k8u ds_d5k8v ds_d5k8w _ [Occ=Dead] ->
+ let {
+ platform_a5jGa :: Platform
+ [LclId,
+ Unf=Unf{Src=<vanilla>, TopLvl=False, Value=False, ConLike=False,
+ WorkFree=False, Expandable=True, Guidance=IF_ARGS [] 20 0}]
+ platform_a5jGa = targetPlatform dflags_a5jG3 } in
+ let {
+ mk_pieces_a5jGb
+ :: ClosureTypeInfo
+ -> [CmmLit]
+ -> UniqSM (Maybe CmmLit, Maybe CmmLit, [CmmLit], [RawCmmDecl])
+ [LclId,
+ Unf=Unf{Src=<vanilla>, TopLvl=False, Value=True, ConLike=True,
+ WorkFree=True, Expandable=True, Guidance=NEVER}]
+ mk_pieces_a5jGb
+ = \ (ds_d5k8E :: ClosureTypeInfo) (_no_srt_a5jGe :: [CmmLit]) ->
+ join {
+ fail_d5k9N
+ :: ghc-prim-0.6.1:GHC.Prim.Void#
+ -> UniqSM (Maybe CmmLit, Maybe CmmLit, [CmmLit], [RawCmmDecl])
+ [LclId[JoinId(1)],
+ Str=<L,U>,
+ Unf=Unf{Src=<vanilla>, TopLvl=False, Value=True, ConLike=True,
+ WorkFree=True, Expandable=True, Guidance=IF_ARGS [0] 130 0}]
+ fail_d5k9N _ [Occ=Dead, OS=OneShot]
+ = pprPanic
+ @ (UniqSM (Maybe CmmLit, Maybe CmmLit, [CmmLit], [RawCmmDecl]))
+ $dIP_a5jV3
+ (ghc-prim-0.6.1:GHC.CString.unpackCString# "mk_pieces"#)
+ (ppr
+ @ ClosureTypeInfo
+ GHC.Runtime.Heap.Layout.$fOutputableClosureTypeInfo
+ ds_d5k8E) } in
+ case ds_d5k8E of {
+ __DEFAULT -> jump fail_d5k9N ghc-prim-0.6.1:GHC.Prim.void#;
+ Constr con_tag_a5jGc con_descr_a5jGd ->
+ >>=
+ @ UniqSM
+ GHC.Types.Unique.Supply.$fMonadUniqSM
+ @ (CmmLit,
+ GenCmmDecl
+ RawCmmStatics
+ (GHC.Cmm.Dataflow.Label.LabelMap RawCmmStatics)
+ CmmGraph)
+ @ (Maybe CmmLit, Maybe CmmLit, [CmmLit], [RawCmmDecl])
+ (newStringLit
+ @ (GHC.Cmm.Dataflow.Label.LabelMap RawCmmStatics)
+ @ CmmGraph
+ con_descr_a5jGd)
+ (\ (ds_d5k8N
+ :: (CmmLit,
+ GenCmmDecl
+ RawCmmStatics
+ (GHC.Cmm.Dataflow.Label.LabelMap RawCmmStatics)
+ CmmGraph)) ->
+ case ds_d5k8N of { (descr_lit_a5jGf, decl_a5jGg) ->
+ return
+ @ UniqSM
+ GHC.Types.Unique.Supply.$fMonadUniqSM
+ @ (Maybe CmmLit, Maybe CmmLit, [CmmLit],
+ [GenCmmDecl
+ RawCmmStatics
+ (GHC.Cmm.Dataflow.Label.LabelMap RawCmmStatics)
+ CmmGraph])
+ (GHC.Maybe.Just
+ @ CmmLit
+ (GHC.Cmm.Expr.$WCmmInt
+ (fromIntegral
+ @ GHC.Types.Basic.ConTagZ
+ @ Integer
+ GHC.Real.$fIntegralInt
+ GHC.Num.$fNumInteger
+ con_tag_a5jGc)
+ (halfWordWidth platform_a5jGa)),
+ GHC.Maybe.Nothing @ CmmLit,
+ GHC.Base.build
+ @ CmmLit
+ (\ (@ a_d5k8K)
+ (c_d5k8L :: CmmLit -> a_d5k8K -> a_d5k8K)
+ (n_d5k8M :: a_d5k8K) ->
+ c_d5k8L descr_lit_a5jGf n_d5k8M),
+ GHC.Base.build
+ @ (GenCmmDecl
+ RawCmmStatics
+ (GHC.Cmm.Dataflow.Label.LabelMap RawCmmStatics)
+ CmmGraph)
+ (\ (@ a_d5k8H)
+ (c_d5k8I
+ :: GenCmmDecl
+ RawCmmStatics
+ (GHC.Cmm.Dataflow.Label.LabelMap RawCmmStatics)
+ CmmGraph
+ -> a_d5k8H -> a_d5k8H)
+ (n_d5k8J :: a_d5k8H) ->
+ c_d5k8I decl_a5jGg n_d5k8J))
+ });
+ Fun arity_a5jGk ds_d5k9M ->
+ case ds_d5k9M of {
+ __DEFAULT -> jump fail_d5k9N ghc-prim-0.6.1:GHC.Prim.void#;
+ ArgSpec fun_type_a5jGl ->
+ return
+ @ UniqSM
+ GHC.Types.Unique.Supply.$fMonadUniqSM
+ @ (Maybe CmmLit, Maybe CmmLit, [CmmLit], [RawCmmDecl])
+ (GHC.Maybe.Nothing @ CmmLit, GHC.Maybe.Nothing @ CmmLit,
+ ghc-prim-0.6.1:GHC.Types.:
+ @ CmmLit
+ (packIntsCLit platform_a5jGa fun_type_a5jGl arity_a5jGk)
+ _no_srt_a5jGe,
+ ghc-prim-0.6.1:GHC.Types.[] @ RawCmmDecl);
+ ArgGen arg_bits_a5jGp ->
+ let {
+ srt_lit_a5jGs :: CmmLit
+ [LclId,
+ Unf=Unf{Src=<vanilla>, TopLvl=False, Value=False, ConLike=False,
+ WorkFree=False, Expandable=False, Guidance=IF_ARGS [] 350 0}]
+ srt_lit_a5jGs
+ = case _no_srt_a5jGe of {
+ [] -> mkIntCLit platform_a5jGa (ghc-prim-0.6.1:GHC.Types.I# 0#);
+ : lit_a5jGt _rest_a5jGu ->
+ case &&
+ debugIsOn
+ (not
+ (null
+ @ [] Data.Foldable.$fFoldable[] @ CmmLit _rest_a5jGu))
+ of {
+ False -> lit_a5jGt;
+ True ->
+ assertPanic
+ @ CmmLit
+ (ghc-prim-0.6.1:GHC.CString.unpackCString#
+ "E:\\\\ghc_inferTags\\\\compiler\\\\GHC\\\\Cmm\\\\Info.hs"#)
+ (ghc-prim-0.6.1:GHC.Types.I# 262#)
+ }
+ } } in
+ let {
+ slow_entry_a5jGr :: CmmLit
+ [LclId,
+ Unf=Unf{Src=<vanilla>, TopLvl=False, Value=True, ConLike=True,
+ WorkFree=False, Expandable=False, Guidance=IF_ARGS [] 40 20}]
+ slow_entry_a5jGr
+ = GHC.Cmm.Expr.CmmLabel
+ (toSlowEntryLbl platform_a5jGa ds_d5k8t) } in
+ >>=
+ @ UniqSM
+ GHC.Types.Unique.Supply.$fMonadUniqSM
+ @ (CmmLit, [RawCmmDecl])
+ @ (Maybe CmmLit, Maybe CmmLit, [CmmLit], [RawCmmDecl])
+ (mkLivenessBits dflags_a5jG3 arg_bits_a5jGp)
+ (\ (ds_d5k9n :: (CmmLit, [RawCmmDecl])) ->
+ case ds_d5k9n of { (liveness_lit_a5jGv, liveness_data_a5jGw) ->
+ let {
+ fun_type_a5jGx :: Int
+ [LclId,
+ Unf=Unf{Src=<vanilla>, TopLvl=False, Value=False, ConLike=False,
+ WorkFree=False, Expandable=False, Guidance=IF_ARGS [] 50 0}]
+ fun_type_a5jGx
+ = case null
+ @ []
+ Data.Foldable.$fFoldable[]
+ @ RawCmmDecl
+ liveness_data_a5jGw
+ of {
+ False -> aRG_GEN_BIG;
+ True -> aRG_GEN
+ } } in
+ return
+ @ UniqSM
+ GHC.Types.Unique.Supply.$fMonadUniqSM
+ @ (Maybe CmmLit, Maybe CmmLit, [CmmLit], [RawCmmDecl])
+ (GHC.Maybe.Nothing @ CmmLit, GHC.Maybe.Nothing @ CmmLit,
+ ++
+ @ CmmLit
+ (GHC.Base.build
+ @ CmmLit
+ (\ (@ a_d5k96)
+ (c_d5k97 :: CmmLit -> a_d5k96 -> a_d5k96)
+ (n_d5k98 :: a_d5k96) ->
+ c_d5k97
+ (packIntsCLit platform_a5jGa fun_type_a5jGx arity_a5jGk)
+ n_d5k98))
+ (++
+ @ CmmLit
+ (case inlineSRT platform_a5jGa of {
+ False ->
+ GHC.Base.build
+ @ CmmLit
+ (\ (@ a_d5k99)
+ (c_d5k9a :: CmmLit -> a_d5k99 -> a_d5k99)
+ (n_d5k9b :: a_d5k99) ->
+ c_d5k9a srt_lit_a5jGs n_d5k9b);
+ True -> ghc-prim-0.6.1:GHC.Types.[] @ CmmLit
+ })
+ (GHC.Base.build
+ @ CmmLit
+ (\ (@ a_d5k9c)
+ (c_d5k9d :: CmmLit -> a_d5k9c -> a_d5k9c)
+ (n_d5k9e :: a_d5k9c) ->
+ c_d5k9d
+ liveness_lit_a5jGv (c_d5k9d slow_entry_a5jGr n_d5k9e)))),
+ liveness_data_a5jGw)
+ })
+ };
+ Thunk ->
+ return
+ @ UniqSM
+ GHC.Types.Unique.Supply.$fMonadUniqSM
+ @ (Maybe CmmLit, Maybe CmmLit, [CmmLit], [RawCmmDecl])
+ (GHC.Maybe.Nothing @ CmmLit, GHC.Maybe.Nothing @ CmmLit,
+ _no_srt_a5jGe, ghc-prim-0.6.1:GHC.Types.[] @ RawCmmDecl);
+ ThunkSelector offset_a5jGi ->
+ return
+ @ UniqSM
+ GHC.Types.Unique.Supply.$fMonadUniqSM
+ @ (Maybe CmmLit, Maybe CmmLit, [CmmLit], [RawCmmDecl])
+ (GHC.Maybe.Just
+ @ CmmLit (GHC.Cmm.Expr.$WCmmInt 0 (halfWordWidth platform_a5jGa)),
+ GHC.Maybe.Just
+ @ CmmLit
+ (mkWordCLit
+ platform_a5jGa
+ (fromIntegral
+ @ GHC.Runtime.Heap.Layout.SelectorOffset
+ @ Integer
+ GHC.Real.$fIntegralInt
+ GHC.Num.$fNumInteger
+ offset_a5jGi)),
+ ghc-prim-0.6.1:GHC.Types.[] @ CmmLit,
+ ghc-prim-0.6.1:GHC.Types.[] @ RawCmmDecl)
+ } } in
+ case ds_d5k8u of {
+ __DEFAULT ->
+ case ds_d5k8u of {
+ __DEFAULT ->
+ case ds_d5k8u of {
+ __DEFAULT ->
+ panic
+ @ (UniqSM ([RawCmmDecl], InfoTableContents))
+ (ghc-prim-0.6.1:GHC.CString.unpackCString# "mkInfoTableContents"#);
+ HeapRep _ [Occ=Dead] ptrs_a5jGM nonptrs_a5jGN closure_type_a5jGO ->
+ let {
+ layout_a5jGP :: CmmLit
+ [LclId,
+ Unf=Unf{Src=<vanilla>, TopLvl=False, Value=False, ConLike=False,
+ WorkFree=False, Expandable=False, Guidance=IF_ARGS [] 40 0}]
+ layout_a5jGP
+ = packIntsCLit platform_a5jGa ptrs_a5jGM nonptrs_a5jGN } in
+ >>=
+ @ UniqSM
+ GHC.Types.Unique.Supply.$fMonadUniqSM
+ @ ((CmmLit, CmmLit), [RawCmmDecl])
+ @ ([RawCmmDecl], InfoTableContents)
+ (mkProfLits platform_a5jGa ds_d5k8v)
+ (\ (ds_d5k6P :: ((CmmLit, CmmLit), [RawCmmDecl])) ->
+ case ds_d5k6P of { (prof_lits_a5jGQ, prof_data_a5jGR) ->
+ let {
+ ds_d5k6G :: ([CmmLit], CmmLit)
+ [LclId,
+ Unf=Unf{Src=<vanilla>, TopLvl=False, Value=False, ConLike=False,
+ WorkFree=False, Expandable=False, Guidance=IF_ARGS [] 40 0}]
+ ds_d5k6G = mkSRTLit platform_a5jGa ds_d5k8t ds_d5k8w } in
+ let {
+ srt_bitmap_a5jGT :: CmmLit
+ [LclId,
+ Unf=Unf{Src=<vanilla>, TopLvl=False, Value=False, ConLike=False,
+ WorkFree=True, Expandable=False, Guidance=IF_ARGS [] 10 0}]
+ srt_bitmap_a5jGT
+ = case ds_d5k6G of { (_ [Occ=Dead], srt_bitmap_a5jGT) ->
+ srt_bitmap_a5jGT
+ } } in
+ >>=
+ @ UniqSM
+ GHC.Types.Unique.Supply.$fMonadUniqSM
+ @ (Maybe CmmLit, Maybe CmmLit, [CmmLit], [RawCmmDecl])
+ @ ([RawCmmDecl], InfoTableContents)
+ (mk_pieces_a5jGb
+ closure_type_a5jGO
+ (case ds_d5k6G of { (srt_label_a5jGS, _ [Occ=Dead]) ->
+ srt_label_a5jGS
+ }))
+ (\ (ds_d5k6B
+ :: (Maybe CmmLit, Maybe CmmLit, [CmmLit], [RawCmmDecl])) ->
+ case ds_d5k6B of
+ { (mb_srt_field_a5jGU, mb_layout_a5jGV, extra_bits_a5jGW,
+ ct_data_a5jGX) ->
+ return
+ @ UniqSM
+ GHC.Types.Unique.Supply.$fMonadUniqSM
+ @ ([RawCmmDecl], ([CmmLit], [CmmLit]))
+ (++ @ RawCmmDecl prof_data_a5jGR ct_data_a5jGX,
+ (mkStdInfoTable
+ dflags_a5jG3
+ prof_lits_a5jGQ
+ (orElse @ Int mb_rts_tag_a5jG9 (rtsClosureType ds_d5k8u))
+ (orElse @ CmmLit mb_srt_field_a5jGU srt_bitmap_a5jGT)
+ (orElse @ CmmLit mb_layout_a5jGV layout_a5jGP),
+ extra_bits_a5jGW))
+ })
+ })
+ };
+ StackRep frame_a5jGC ->
+ >>=
+ @ UniqSM
+ GHC.Types.Unique.Supply.$fMonadUniqSM
+ @ ((CmmLit, CmmLit), [RawCmmDecl])
+ @ ([RawCmmDecl], InfoTableContents)
+ (mkProfLits platform_a5jGa ds_d5k8v)
+ (\ (ds_d5k5C :: ((CmmLit, CmmLit), [RawCmmDecl])) ->
+ case ds_d5k5C of { (prof_lits_a5jGD, prof_data_a5jGE) ->
+ let {
+ ds_d5k5t :: ([CmmLit], CmmLit)
+ [LclId,
+ Unf=Unf{Src=<vanilla>, TopLvl=False, Value=False, ConLike=False,
+ WorkFree=False, Expandable=False, Guidance=IF_ARGS [] 40 0}]
+ ds_d5k5t = mkSRTLit platform_a5jGa ds_d5k8t ds_d5k8w } in
+ let {
+ srt_label_a5jGF :: [CmmLit]
+ [LclId,
+ Unf=Unf{Src=<vanilla>, TopLvl=False, Value=False, ConLike=False,
+ WorkFree=True, Expandable=False, Guidance=IF_ARGS [] 10 0}]
+ srt_label_a5jGF
+ = case ds_d5k5t of { (srt_label_a5jGF, _ [Occ=Dead]) ->
+ srt_label_a5jGF
+ } } in
+ let {
+ srt_bitmap_a5jGG :: CmmLit
+ [LclId,
+ Unf=Unf{Src=<vanilla>, TopLvl=False, Value=False, ConLike=False,
+ WorkFree=True, Expandable=False, Guidance=IF_ARGS [] 10 0}]
+ srt_bitmap_a5jGG
+ = case ds_d5k5t of { (_ [Occ=Dead], srt_bitmap_a5jGG) ->
+ srt_bitmap_a5jGG
+ } } in
+ >>=
+ @ UniqSM
+ GHC.Types.Unique.Supply.$fMonadUniqSM
+ @ (CmmLit, [RawCmmDecl])
+ @ ([RawCmmDecl], InfoTableContents)
+ (mkLivenessBits dflags_a5jG3 frame_a5jGC)
+ (\ (ds_d5k5o :: (CmmLit, [RawCmmDecl])) ->
+ case ds_d5k5o of { (liveness_lit_a5jGH, liveness_data_a5jGI) ->
+ return
+ @ UniqSM
+ GHC.Types.Unique.Supply.$fMonadUniqSM
+ @ ([RawCmmDecl], ([CmmLit], [CmmLit]))
+ (++ @ RawCmmDecl prof_data_a5jGE liveness_data_a5jGI,
+ (mkStdInfoTable
+ dflags_a5jG3
+ prof_lits_a5jGD
+ (case mb_rts_tag_a5jG9 of {
+ __DEFAULT ->
+ case null
+ @ []
+ Data.Foldable.$fFoldable[]
+ @ RawCmmDecl
+ liveness_data_a5jGI
+ of {
+ False -> rET_BIG;
+ True -> rET_SMALL
+ };
+ Just tag_a5jGL -> tag_a5jGL
+ })
+ srt_bitmap_a5jGG
+ liveness_lit_a5jGH,
+ srt_label_a5jGF))
+ })
+ })
+ };
+ RTSRep rts_tag_a5jGA rep_a5jGB ->
+ mkInfoTableContents
+ dflags_a5jG3
+ (case wild_00 of
+ { CmmInfoTable ds_d5k3X _ [Occ=Dead] ds_d5k3Z ds_d5k40 ds_d5k41 ->
+ GHC.Cmm.CmmInfoTable ds_d5k3X rep_a5jGB ds_d5k3Z ds_d5k40 ds_d5k41
+ })
+ (GHC.Maybe.Just @ Int rts_tag_a5jGA)
+ }
+ }
+end Rec }
+
+-- RHS size: {terms: 178, types: 329, coercions: 12, joins: 0/4}
+mkInfoTable :: DynFlags -> CmmDeclSRTs -> UniqSM [RawCmmDecl]
+[LclIdX,
+ Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
+ WorkFree=True, Expandable=True, Guidance=NEVER}]
+mkInfoTable
+ = \ (ds_d5ka0 :: DynFlags)
+ (ds_d5ka1 :: GenCmmDecl RawCmmStatics CmmTopInfo CmmGraph) ->
+ case ds_d5ka1 of {
+ CmmProc infos_a5jFG entry_lbl_a5jFH live_a5jFI blocks_a5jFJ ->
+ let {
+ platform_a5jFK :: Platform
+ [LclId,
+ Unf=Unf{Src=<vanilla>, TopLvl=False, Value=False, ConLike=False,
+ WorkFree=False, Expandable=True, Guidance=IF_ARGS [] 20 0}]
+ platform_a5jFK = targetPlatform ds_d5ka0 } in
+ case not (platformTablesNextToCode (targetPlatform ds_d5ka0)) of {
+ False ->
+ >>=
+ @ UniqSM
+ GHC.Types.Unique.Supply.$fMonadUniqSM
+ @ ([[RawCmmDecl]],
+ [(GHC.Cmm.Dataflow.Label.Label, GenCmmStatics 'True)])
+ @ [RawCmmDecl]
+ (fmap
+ @ UniqSM
+ GHC.Types.Unique.Supply.$fFunctorUniqSM
+ @ [([RawCmmDecl],
+ (GHC.Cmm.Dataflow.Label.Label, GenCmmStatics 'True))]
+ @ ([[RawCmmDecl]],
+ [(GHC.Cmm.Dataflow.Label.Label, GenCmmStatics 'True)])
+ (unzip
+ @ [RawCmmDecl]
+ @ (GHC.Cmm.Dataflow.Label.Label, GenCmmStatics 'True))
+ (mapM
+ @ []
+ Data.Traversable.$fTraversable[]
+ @ UniqSM
+ @ (GHC.Cmm.Dataflow.Label.Label, CmmInfoTable)
+ @ ([RawCmmDecl],
+ (GHC.Cmm.Dataflow.Label.Label, GenCmmStatics 'True))
+ GHC.Types.Unique.Supply.$fMonadUniqSM
+ (\ (ds_d5kbk :: (GHC.Cmm.Dataflow.Label.Label, CmmInfoTable)) ->
+ case ds_d5kbk of { (lbl_a5jFM, itbl_a5jFN) ->
+ >>=
+ @ UniqSM
+ GHC.Types.Unique.Supply.$fMonadUniqSM
+ @ ([RawCmmDecl], InfoTableContents)
+ @ ([RawCmmDecl],
+ (GHC.Cmm.Dataflow.Label.Label, GenCmmStatics 'True))
+ (mkInfoTableContents ds_d5ka0 itbl_a5jFN (GHC.Maybe.Nothing @ Int))
+ (\ (ds_d5kbn :: ([RawCmmDecl], InfoTableContents)) ->
+ case ds_d5kbn of { (top_decls_a5jFO, ds_d5kbx) ->
+ case ds_d5kbx of { (std_info_a5jFP, extra_bits_a5jFQ) ->
+ let {
+ info_lbl_a5jFR :: CLabel
+ [LclId,
+ Unf=Unf{Src=<vanilla>, TopLvl=False, Value=False, ConLike=False,
+ WorkFree=False, Expandable=True, Guidance=IF_ARGS [] 20 0}]
+ info_lbl_a5jFR = cit_lbl itbl_a5jFN } in
+ return
+ @ UniqSM
+ GHC.Types.Unique.Supply.$fMonadUniqSM
+ @ ([RawCmmDecl],
+ (GHC.Cmm.Dataflow.Label.Label, GenCmmStatics 'True))
+ (top_decls_a5jFO,
+ (lbl_a5jFM,
+ $ @ 'ghc-prim-0.6.1:GHC.Types.LiftedRep
+ @ [CmmStatic]
+ @ (GenCmmStatics 'True)
+ (GHC.Cmm.CmmStaticsRaw @ 'True info_lbl_a5jFR)
+ ($ @ 'ghc-prim-0.6.1:GHC.Types.LiftedRep
+ @ [CmmLit]
+ @ [CmmStatic]
+ (map @ CmmLit @ CmmStatic GHC.Cmm.CmmStaticLit)
+ (++
+ @ CmmLit
+ (reverse
+ @ CmmLit
+ (map
+ @ CmmLit
+ @ CmmLit
+ (makeRelativeRefTo platform_a5jFK info_lbl_a5jFR)
+ extra_bits_a5jFQ))
+ (map
+ @ CmmLit
+ @ CmmLit
+ (makeRelativeRefTo platform_a5jFK info_lbl_a5jFR)
+ std_info_a5jFP)))))
+ }
+ })
+ })
+ ((mapToList
+ @ GHC.Cmm.Dataflow.Label.LabelMap
+ GHC.Cmm.Dataflow.Label.$fIsMapLabelMap
+ @ CmmInfoTable
+ (info_tbls infos_a5jFG))
+ `cast` (([((,)
+ (Sub (GHC.Cmm.Dataflow.Label.D:R:KeyOfLabelMap[0]))
+ <CmmInfoTable>_R)_R])_R
+ :: [(KeyOf GHC.Cmm.Dataflow.Label.LabelMap, CmmInfoTable)]
+ ~R# [(GHC.Cmm.Dataflow.Label.Label, CmmInfoTable)]))))
+ (\ (ds_d5kaZ
+ :: ([[RawCmmDecl]],
+ [(GHC.Cmm.Dataflow.Label.Label, GenCmmStatics 'True)])) ->
+ case ds_d5kaZ of { (top_declss_a5jG1, raw_infos_a5jG2) ->
+ return
+ @ UniqSM
+ GHC.Types.Unique.Supply.$fMonadUniqSM
+ @ [RawCmmDecl]
+ (++
+ @ RawCmmDecl
+ (concat
+ @ [] @ RawCmmDecl Data.Foldable.$fFoldable[] top_declss_a5jG1)
+ (GHC.Base.build
+ @ RawCmmDecl
+ (\ (@ a_d5kaW)
+ (c_d5kaX :: RawCmmDecl -> a_d5kaW -> a_d5kaW)
+ (n_d5kaY :: a_d5kaW) ->
+ c_d5kaX
+ (GHC.Cmm.CmmProc
+ @ RawCmmStatics
+ @ (GHC.Cmm.Dataflow.Label.LabelMap (GenCmmStatics 'True))
+ @ CmmGraph
+ (mapFromList
+ @ GHC.Cmm.Dataflow.Label.LabelMap
+ GHC.Cmm.Dataflow.Label.$fIsMapLabelMap
+ @ (GenCmmStatics 'True)
+ (raw_infos_a5jG2
+ `cast` (([((,)
+ (Sub (Sym (GHC.Cmm.Dataflow.Label.D:R:KeyOfLabelMap[0])))
+ <GenCmmStatics 'True>_R)_R])_R
+ :: [(GHC.Cmm.Dataflow.Label.Label,
+ GenCmmStatics 'True)]
+ ~R# [(KeyOf GHC.Cmm.Dataflow.Label.LabelMap,
+ GenCmmStatics 'True)])))
+ entry_lbl_a5jFH
+ live_a5jFI
+ blocks_a5jFJ)
+ n_d5kaY)))
+ });
+ True ->
+ case topInfoTable @ RawCmmStatics @ CmmNode ds_d5ka1 of {
+ Nothing ->
+ return
+ @ UniqSM
+ GHC.Types.Unique.Supply.$fMonadUniqSM
+ @ [GenCmmDecl
+ RawCmmStatics
+ (GHC.Cmm.Dataflow.Label.LabelMap RawCmmStatics)
+ CmmGraph]
+ (GHC.Base.build
+ @ (GenCmmDecl
+ RawCmmStatics
+ (GHC.Cmm.Dataflow.Label.LabelMap RawCmmStatics)
+ CmmGraph)
+ (\ (@ a_d5kad)
+ (c_d5kae
+ :: GenCmmDecl
+ RawCmmStatics
+ (GHC.Cmm.Dataflow.Label.LabelMap RawCmmStatics)
+ CmmGraph
+ -> a_d5kad -> a_d5kad)
+ (n_d5kaf :: a_d5kad) ->
+ c_d5kae
+ (GHC.Cmm.CmmProc
+ @ RawCmmStatics
+ @ (GHC.Cmm.Dataflow.Label.LabelMap RawCmmStatics)
+ @ CmmGraph
+ (mapEmpty
+ @ GHC.Cmm.Dataflow.Label.LabelMap
+ GHC.Cmm.Dataflow.Label.$fIsMapLabelMap
+ @ RawCmmStatics)
+ entry_lbl_a5jFH
+ live_a5jFI
+ blocks_a5jFJ)
+ n_d5kaf));
+ Just info_a5jFU ->
+ case info_a5jFU of wild_XD
+ { CmmInfoTable ds_d5kaR _ [Occ=Dead] _ [Occ=Dead] _ [Occ=Dead]
+ _ [Occ=Dead] ->
+ >>=
+ @ UniqSM
+ GHC.Types.Unique.Supply.$fMonadUniqSM
+ @ ([RawCmmDecl], InfoTableContents)
+ @ [RawCmmDecl]
+ (mkInfoTableContents ds_d5ka0 wild_XD (GHC.Maybe.Nothing @ Int))
+ (\ (ds_d5kas :: ([RawCmmDecl], InfoTableContents)) ->
+ case ds_d5kas of { (top_decls_a5jFW, ds_d5kaC) ->
+ case ds_d5kaC of { (std_info_a5jFX, extra_bits_a5jFY) ->
+ let {
+ rel_extra_bits_a5jG0 :: [CmmLit]
+ [LclId,
+ Unf=Unf{Src=<vanilla>, TopLvl=False, Value=False, ConLike=False,
+ WorkFree=False, Expandable=False, Guidance=IF_ARGS [] 60 0}]
+ rel_extra_bits_a5jG0
+ = map
+ @ CmmLit
+ @ CmmLit
+ (makeRelativeRefTo platform_a5jFK ds_d5kaR)
+ extra_bits_a5jFY } in
+ let {
+ rel_std_info_a5jFZ :: [CmmLit]
+ [LclId,
+ Unf=Unf{Src=<vanilla>, TopLvl=False, Value=False, ConLike=False,
+ WorkFree=False, Expandable=False, Guidance=IF_ARGS [] 60 0}]
+ rel_std_info_a5jFZ
+ = map
+ @ CmmLit
+ @ CmmLit
+ (makeRelativeRefTo platform_a5jFK ds_d5kaR)
+ std_info_a5jFX } in
+ return
+ @ UniqSM
+ GHC.Types.Unique.Supply.$fMonadUniqSM
+ @ [RawCmmDecl]
+ (++
+ @ RawCmmDecl
+ top_decls_a5jFW
+ (GHC.Base.build
+ @ RawCmmDecl
+ (\ (@ a_d5kap)
+ (c_d5kaq :: RawCmmDecl -> a_d5kap -> a_d5kap)
+ (n_d5kar :: a_d5kap) ->
+ c_d5kaq
+ (GHC.Cmm.CmmProc
+ @ RawCmmStatics
+ @ (GHC.Cmm.Dataflow.Label.LabelMap RawCmmStatics)
+ @ CmmGraph
+ (mapEmpty
+ @ GHC.Cmm.Dataflow.Label.LabelMap
+ GHC.Cmm.Dataflow.Label.$fIsMapLabelMap
+ @ RawCmmStatics)
+ entry_lbl_a5jFH
+ live_a5jFI
+ blocks_a5jFJ)
+ (c_d5kaq
+ (mkRODataLits
+ @ 'True
+ @ (GHC.Cmm.Dataflow.Label.LabelMap RawCmmStatics)
+ @ CmmGraph
+ ds_d5kaR
+ (ghc-prim-0.6.1:GHC.Types.:
+ @ CmmLit
+ (GHC.Cmm.Expr.CmmLabel entry_lbl_a5jFH)
+ (++ @ CmmLit rel_std_info_a5jFZ rel_extra_bits_a5jG0)))
+ n_d5kar))))
+ }
+ })
+ }
+ }
+ };
+ CmmData sec_a5jFC dat_a5jFD ->
+ return
+ @ UniqSM
+ GHC.Types.Unique.Supply.$fMonadUniqSM
+ @ [GenCmmDecl
+ RawCmmStatics
+ (GHC.Cmm.Dataflow.Label.LabelMap RawCmmStatics)
+ CmmGraph]
+ (GHC.Base.build
+ @ (GenCmmDecl
+ RawCmmStatics
+ (GHC.Cmm.Dataflow.Label.LabelMap RawCmmStatics)
+ CmmGraph)
+ (\ (@ a_d5ka4)
+ (c_d5ka5
+ :: GenCmmDecl
+ RawCmmStatics
+ (GHC.Cmm.Dataflow.Label.LabelMap RawCmmStatics)
+ CmmGraph
+ -> a_d5ka4 -> a_d5ka4)
+ (n_d5ka6 :: a_d5ka4) ->
+ c_d5ka5
+ (GHC.Cmm.CmmData
+ @ RawCmmStatics
+ @ (GHC.Cmm.Dataflow.Label.LabelMap RawCmmStatics)
+ @ CmmGraph
+ sec_a5jFC
+ dat_a5jFD)
+ n_d5ka6))
+ }
+
+-- RHS size: {terms: 69, types: 138, coercions: 0, joins: 0/2}
+cmmToRawCmm
+ :: forall a.
+ DynFlags
+ -> Stream IO CmmGroupSRTs a -> IO (Stream IO RawCmmGroup a)
+[LclIdX,
+ Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
+ WorkFree=False, Expandable=False, Guidance=IF_ARGS [] 750 60}]
+cmmToRawCmm
+ = \ (@ a_a5jZ4) ->
+ let {
+ $dFunctor_a5k0n :: Functor (Stream IO [RawCmmDecl])
+ [LclId,
+ Unf=Unf{Src=<vanilla>, TopLvl=False, Value=False, ConLike=False,
+ WorkFree=False, Expandable=True, Guidance=IF_ARGS [] 20 0}]
+ $dFunctor_a5k0n
+ = GHC.Data.Stream.$fFunctorStream
+ @ IO @ [RawCmmDecl] GHC.Base.$fMonadIO } in
+ \ (dflags_a5jFp :: DynFlags)
+ (cmms_a5jFq :: Stream IO CmmGroupSRTs a_a5jZ4) ->
+ let {
+ forceRes_a5jFr
+ :: forall (t :: * -> *) a a. Foldable t => (a, t a) -> ()
+ [LclId,
+ Unf=Unf{Src=<vanilla>, TopLvl=False, Value=True, ConLike=True,
+ WorkFree=True, Expandable=True, Guidance=IF_ARGS [30 20] 100 0}]
+ forceRes_a5jFr
+ = \ (@ (t_a5jZg :: * -> *))
+ (@ a_a5jZe)
+ (@ a_a5jZl)
+ ($dFoldable_a5jZr :: Foldable t_a5jZg)
+ (ds_d5kbN :: (a_a5jZe, t_a5jZg a_a5jZl)) ->
+ case ds_d5kbN of { (uniqs_a5jFs, rawcmms_a5jFt) ->
+ case uniqs_a5jFs of { __DEFAULT ->
+ foldr
+ @ t_a5jZg
+ $dFoldable_a5jZr
+ @ a_a5jZl
+ @ ()
+ (\ (decl_a5jFu :: a_a5jZl) (r_a5jFv :: ()) ->
+ case decl_a5jFu of { __DEFAULT -> r_a5jFv })
+ ghc-prim-0.6.1:GHC.Tuple.()
+ rawcmms_a5jFt
+ }
+ } } in
+ >>=
+ @ IO
+ GHC.Base.$fMonadIO
+ @ UniqSupply
+ @ (Stream IO RawCmmGroup a_a5jZ4)
+ (mkSplitUniqSupply (ghc-prim-0.6.1:GHC.Types.C# 'i'#))
+ (\ (uniqs_a5jFw :: UniqSupply) ->
+ return
+ @ IO
+ GHC.Base.$fMonadIO
+ @ (Stream IO [RawCmmDecl] a_a5jZ4)
+ (<$>
+ @ (Stream IO [RawCmmDecl])
+ @ (UniqSupply, a_a5jZ4)
+ @ a_a5jZ4
+ $dFunctor_a5k0n
+ (snd @ UniqSupply @ a_a5jZ4)
+ (Stream.mapAccumL_
+ @ IO
+ @ UniqSupply
+ @ [CmmDeclSRTs]
+ @ [RawCmmDecl]
+ @ a_a5jZ4
+ GHC.Base.$fMonadIO
+ (\ (uniqs_a5jFy :: UniqSupply) (cmm_a5jFz :: [CmmDeclSRTs]) ->
+ $ @ 'ghc-prim-0.6.1:GHC.Types.LiftedRep
+ @ (IO (UniqSupply, [RawCmmDecl]))
+ @ (IO (UniqSupply, [RawCmmDecl]))
+ (withTimingSilent
+ @ IO
+ @ (UniqSupply, [RawCmmDecl])
+ Control.Monad.IO.Class.$fMonadIOIO
+ dflags_a5jFp
+ (text
+ (ghc-prim-0.6.1:GHC.CString.unpackCString# "Cmm -> Raw Cmm"#))
+ (forceRes_a5jFr
+ @ [] @ UniqSupply @ RawCmmDecl Data.Foldable.$fFoldable[]))
+ (case $ @ 'ghc-prim-0.6.1:GHC.Types.LiftedRep
+ @ (UniqSM [RawCmmDecl])
+ @ ([RawCmmDecl], UniqSupply)
+ (initUs @ [RawCmmDecl] uniqs_a5jFy)
+ (concatMapM
+ @ UniqSM
+ @ CmmDeclSRTs
+ @ RawCmmDecl
+ GHC.Types.Unique.Supply.$fMonadUniqSM
+ (mkInfoTable dflags_a5jFp)
+ cmm_a5jFz)
+ of
+ { (b_a5jFA, uniqs'_a5jFB) ->
+ return
+ @ IO
+ GHC.Base.$fMonadIO
+ @ (UniqSupply, [RawCmmDecl])
+ (uniqs'_a5jFB, b_a5jFA)
+ }))
+ uniqs_a5jFw
+ cmms_a5jFq)))
+
+-- RHS size: {terms: 8, types: 2, coercions: 0, joins: 0/0}
+maxStdInfoTableSizeW :: WordOff
+[LclIdX,
+ Unf=Unf{Src=<vanilla>, TopLvl=True, Value=False, ConLike=False,
+ WorkFree=False, Expandable=False, Guidance=IF_ARGS [] 90 0}]
+maxStdInfoTableSizeW
+ = + @ WordOff
+ GHC.Num.$fNumInt
+ (+ @ WordOff
+ GHC.Num.$fNumInt
+ (ghc-prim-0.6.1:GHC.Types.I# 1#)
+ fixedInfoTableSizeW)
+ profInfoTableSizeW
+
+-- RHS size: {terms: 5, types: 1, coercions: 0, joins: 0/0}
+maxRetInfoTableSizeW :: WordOff
+[LclIdX,
+ Unf=Unf{Src=<vanilla>, TopLvl=True, Value=False, ConLike=False,
+ WorkFree=False, Expandable=False, Guidance=IF_ARGS [] 50 0}]
+maxRetInfoTableSizeW
+ = + @ WordOff
+ GHC.Num.$fNumInt
+ maxStdInfoTableSizeW
+ (ghc-prim-0.6.1:GHC.Types.I# 1#)
+
+-- RHS size: {terms: 12, types: 3, coercions: 0, joins: 0/0}
+stdInfoTableSizeW :: Profile -> WordOff
+[LclIdX,
+ Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
+ WorkFree=True, Expandable=True, Guidance=IF_ARGS [0] 90 0}]
+stdInfoTableSizeW
+ = \ (profile_a5jIr :: Profile) ->
+ + @ WordOff
+ GHC.Num.$fNumInt
+ fixedInfoTableSizeW
+ (case profileIsProfiling profile_a5jIr of {
+ False -> ghc-prim-0.6.1:GHC.Types.I# 0#;
+ True -> profInfoTableSizeW
+ })
+
+-- RHS size: {terms: 7, types: 2, coercions: 0, joins: 0/0}
+stdInfoTableSizeB :: Profile -> ByteOff
+[LclIdX,
+ Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
+ WorkFree=True, Expandable=True, Guidance=IF_ARGS [0] 80 0}]
+stdInfoTableSizeB
+ = \ (profile_a5jIs :: Profile) ->
+ * @ WordOff
+ GHC.Num.$fNumInt
+ (stdInfoTableSizeW profile_a5jIs)
+ (profileWordSizeInBytes profile_a5jIs)
+
+-- RHS size: {terms: 8, types: 2, coercions: 0, joins: 0/0}
+stdSrtBitmapOffset :: Profile -> ByteOff
+[LclIdX,
+ Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
+ WorkFree=True, Expandable=True, Guidance=IF_ARGS [0] 100 0}]
+stdSrtBitmapOffset
+ = \ (profile_a5jIt :: Profile) ->
+ - @ ByteOff
+ GHC.Num.$fNumInt
+ (stdInfoTableSizeB profile_a5jIt)
+ (halfWordSize (profilePlatform profile_a5jIt))
+
+-- RHS size: {terms: 13, types: 3, coercions: 0, joins: 0/1}
+infoTableSrtBitmap :: Profile -> CmmExpr -> CmmExpr
+[LclIdX,
+ Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
+ WorkFree=True, Expandable=True, Guidance=IF_ARGS [0 0] 140 0}]
+infoTableSrtBitmap
+ = \ (profile_a5jI3 :: Profile) (info_tbl_a5jI4 :: CmmExpr) ->
+ let {
+ platform_a5jI5 :: Platform
+ [LclId,
+ Unf=Unf{Src=<vanilla>, TopLvl=False, Value=False, ConLike=False,
+ WorkFree=False, Expandable=True, Guidance=IF_ARGS [] 20 0}]
+ platform_a5jI5 = profilePlatform profile_a5jI3 } in
+ GHC.Cmm.Expr.$WCmmLoad
+ (cmmOffsetB
+ platform_a5jI5 info_tbl_a5jI4 (stdSrtBitmapOffset profile_a5jI3))
+ (bHalfWord platform_a5jI5)
+
+-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
+infoTableConstrTag :: Profile -> CmmExpr -> CmmExpr
+[LclIdX,
+ Unf=Unf{Src=<vanilla>, TopLvl=True, Value=False, ConLike=False,
+ WorkFree=True, Expandable=True,
+ Guidance=ALWAYS_IF(arity=0,unsat_ok=True,boring_ok=True)}]
+infoTableConstrTag = infoTableSrtBitmap
+
+-- RHS size: {terms: 7, types: 2, coercions: 0, joins: 0/0}
+stdClosureTypeOffset :: Profile -> ByteOff
+[LclIdX,
+ Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
+ WorkFree=True, Expandable=True, Guidance=IF_ARGS [0] 80 0}]
+stdClosureTypeOffset
+ = \ (profile_a5jIu :: Profile) ->
+ - @ ByteOff
+ GHC.Num.$fNumInt
+ (stdInfoTableSizeB profile_a5jIu)
+ (profileWordSizeInBytes profile_a5jIu)
+
+-- RHS size: {terms: 13, types: 3, coercions: 0, joins: 0/1}
+infoTableClosureType :: Profile -> CmmExpr -> CmmExpr
+[LclIdX,
+ Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
+ WorkFree=True, Expandable=True, Guidance=IF_ARGS [0 0] 140 0}]
+infoTableClosureType
+ = \ (profile_a5jI6 :: Profile) (info_tbl_a5jI7 :: CmmExpr) ->
+ let {
+ platform_a5jI8 :: Platform
+ [LclId,
+ Unf=Unf{Src=<vanilla>, TopLvl=False, Value=False, ConLike=False,
+ WorkFree=False, Expandable=True, Guidance=IF_ARGS [] 20 0}]
+ platform_a5jI8 = profilePlatform profile_a5jI6 } in
+ GHC.Cmm.Expr.$WCmmLoad
+ (cmmOffsetB
+ platform_a5jI8 info_tbl_a5jI7 (stdClosureTypeOffset profile_a5jI6))
+ (bHalfWord platform_a5jI8)
+
+-- RHS size: {terms: 11, types: 3, coercions: 0, joins: 0/0}
+stdPtrsOffset :: Profile -> ByteOff
+[LclIdX,
+ Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
+ WorkFree=True, Expandable=True, Guidance=IF_ARGS [0] 130 0}]
+stdPtrsOffset
+ = \ (profile_a5jIv :: Profile) ->
+ - @ ByteOff
+ GHC.Num.$fNumInt
+ (stdInfoTableSizeB profile_a5jIv)
+ (* @ Int
+ GHC.Num.$fNumInt
+ (ghc-prim-0.6.1:GHC.Types.I# 2#)
+ (profileWordSizeInBytes profile_a5jIv))
+
+-- RHS size: {terms: 13, types: 3, coercions: 0, joins: 0/1}
+infoTablePtrs :: Profile -> CmmExpr -> CmmExpr
+[LclIdX,
+ Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
+ WorkFree=True, Expandable=True, Guidance=IF_ARGS [0 0] 140 0}]
+infoTablePtrs
+ = \ (profile_a5jI9 :: Profile) (info_tbl_a5jIa :: CmmExpr) ->
+ let {
+ platform_a5jIb :: Platform
+ [LclId,
+ Unf=Unf{Src=<vanilla>, TopLvl=False, Value=False, ConLike=False,
+ WorkFree=False, Expandable=True, Guidance=IF_ARGS [] 20 0}]
+ platform_a5jIb = profilePlatform profile_a5jI9 } in
+ GHC.Cmm.Expr.$WCmmLoad
+ (cmmOffsetB
+ platform_a5jIb info_tbl_a5jIa (stdPtrsOffset profile_a5jI9))
+ (bHalfWord platform_a5jIb)
+
+-- RHS size: {terms: 16, types: 4, coercions: 0, joins: 0/0}
+stdNonPtrsOffset :: Profile -> ByteOff
+[LclIdX,
+ Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
+ WorkFree=True, Expandable=True, Guidance=IF_ARGS [0] 210 0}]
+stdNonPtrsOffset
+ = \ (profile_a5jIw :: Profile) ->
+ + @ ByteOff
+ GHC.Num.$fNumInt
+ (- @ ByteOff
+ GHC.Num.$fNumInt
+ (stdInfoTableSizeB profile_a5jIw)
+ (* @ Int
+ GHC.Num.$fNumInt
+ (ghc-prim-0.6.1:GHC.Types.I# 2#)
+ (profileWordSizeInBytes profile_a5jIw)))
+ (halfWordSize (profilePlatform profile_a5jIw))
+
+-- RHS size: {terms: 13, types: 3, coercions: 0, joins: 0/1}
+infoTableNonPtrs :: Profile -> CmmExpr -> CmmExpr
+[LclIdX,
+ Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
+ WorkFree=True, Expandable=True, Guidance=IF_ARGS [0 0] 140 0}]
+infoTableNonPtrs
+ = \ (profile_a5jIc :: Profile) (info_tbl_a5jId :: CmmExpr) ->
+ let {
+ platform_a5jIe :: Platform
+ [LclId,
+ Unf=Unf{Src=<vanilla>, TopLvl=False, Value=False, ConLike=False,
+ WorkFree=False, Expandable=True, Guidance=IF_ARGS [] 20 0}]
+ platform_a5jIe = profilePlatform profile_a5jIc } in
+ GHC.Cmm.Expr.$WCmmLoad
+ (cmmOffsetB
+ platform_a5jIe info_tbl_a5jId (stdNonPtrsOffset profile_a5jIc))
+ (bHalfWord platform_a5jIe)
+
+-- RHS size: {terms: 7, types: 2, coercions: 0, joins: 0/0}
+conInfoTableSizeB :: Profile -> Int
+[LclIdX,
+ Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
+ WorkFree=True, Expandable=True, Guidance=IF_ARGS [0] 80 0}]
+conInfoTableSizeB
+ = \ (profile_a5jIx :: Profile) ->
+ + @ ByteOff
+ GHC.Num.$fNumInt
+ (stdInfoTableSizeB profile_a5jIx)
+ (profileWordSizeInBytes profile_a5jIx)
+
+-- RHS size: {terms: 31, types: 7, coercions: 0, joins: 0/1}
+funInfoTable :: Profile -> CmmExpr -> CmmExpr
+[LclIdX,
+ Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
+ WorkFree=True, Expandable=True, Guidance=IF_ARGS [0 0] 350 0}]
+funInfoTable
+ = \ (profile_a5jIf :: Profile) (info_ptr_a5jIg :: CmmExpr) ->
+ let {
+ platform_a5jIh :: Platform
+ [LclId,
+ Unf=Unf{Src=<vanilla>, TopLvl=False, Value=False, ConLike=False,
+ WorkFree=False, Expandable=True, Guidance=IF_ARGS [] 20 0}]
+ platform_a5jIh = profilePlatform profile_a5jIf } in
+ case platformTablesNextToCode platform_a5jIh of {
+ False ->
+ cmmOffsetW
+ platform_a5jIh
+ info_ptr_a5jIg
+ (+ @ WordOff
+ GHC.Num.$fNumInt
+ (ghc-prim-0.6.1:GHC.Types.I# 1#)
+ (stdInfoTableSizeW profile_a5jIf));
+ True ->
+ cmmOffsetB
+ platform_a5jIh
+ info_ptr_a5jIg
+ (- @ ByteOff
+ GHC.Num.$fNumInt
+ (negate
+ @ ByteOff GHC.Num.$fNumInt (stdInfoTableSizeB profile_a5jIf))
+ (pc_SIZEOF_StgFunInfoExtraRev (platformConstants platform_a5jIh)))
+ }
+
+-- RHS size: {terms: 46, types: 24, coercions: 0, joins: 0/4}
+funInfoArity :: Profile -> CmmExpr -> CmmExpr
+[LclIdX,
+ Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
+ WorkFree=True, Expandable=True, Guidance=IF_ARGS [0 0] 430 0}]
+funInfoArity
+ = \ (profile_a5jIi :: Profile) (iptr_a5jIj :: CmmExpr) ->
+ let {
+ platform_a5jIk :: Platform
+ [LclId,
+ Unf=Unf{Src=<vanilla>, TopLvl=False, Value=False, ConLike=False,
+ WorkFree=False, Expandable=True, Guidance=IF_ARGS [] 20 0}]
+ platform_a5jIk = profilePlatform profile_a5jIi } in
+ let {
+ pc_a5jIq :: PlatformConstants
+ [LclId,
+ Unf=Unf{Src=<vanilla>, TopLvl=False, Value=False, ConLike=False,
+ WorkFree=False, Expandable=True, Guidance=IF_ARGS [] 20 0}]
+ pc_a5jIq = platformConstants platform_a5jIk } in
+ let {
+ ds_d5k14 :: (Int, Int)
+ [LclId,
+ Unf=Unf{Src=<vanilla>, TopLvl=False, Value=False, ConLike=False,
+ WorkFree=False, Expandable=False, Guidance=IF_ARGS [] 140 60}]
+ ds_d5k14
+ = case platformTablesNextToCode platform_a5jIk of {
+ False ->
+ (pc_REP_StgFunInfoExtraFwd_arity pc_a5jIq,
+ pc_OFFSET_StgFunInfoExtraFwd_arity pc_a5jIq);
+ True ->
+ (pc_REP_StgFunInfoExtraRev_arity pc_a5jIq,
+ pc_OFFSET_StgFunInfoExtraRev_arity pc_a5jIq)
+ } } in
+ let {
+ rep_bytes_a5jIo :: Int
+ [LclId,
+ Unf=Unf{Src=<vanilla>, TopLvl=False, Value=False, ConLike=False,
+ WorkFree=True, Expandable=False, Guidance=IF_ARGS [] 10 0}]
+ rep_bytes_a5jIo
+ = case ds_d5k14 of { (rep_bytes_a5jIo, _ [Occ=Dead]) ->
+ rep_bytes_a5jIo
+ } } in
+ cmmToWord
+ platform_a5jIk
+ (cmmLoadIndex
+ platform_a5jIk
+ (cmmBits (widthFromBytes rep_bytes_a5jIo))
+ (funInfoTable profile_a5jIi iptr_a5jIj)
+ (div
+ @ Int
+ GHC.Real.$fIntegralInt
+ (case ds_d5k14 of { (_ [Occ=Dead], offset_a5jIp) -> offset_a5jIp })
+ rep_bytes_a5jIo))
+
+-- RHS size: {terms: 22, types: 5, coercions: 0, joins: 0/1}
+infoTable :: Profile -> CmmExpr -> CmmExpr
+[LclIdX,
+ Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
+ WorkFree=True, Expandable=True, Guidance=IF_ARGS [0 0] 210 0}]
+infoTable
+ = \ (profile_a5jI0 :: Profile) (info_ptr_a5jI1 :: CmmExpr) ->
+ let {
+ platform_a5jI2 :: Platform
+ [LclId,
+ Unf=Unf{Src=<vanilla>, TopLvl=False, Value=False, ConLike=False,
+ WorkFree=False, Expandable=True, Guidance=IF_ARGS [] 20 0}]
+ platform_a5jI2 = profilePlatform profile_a5jI0 } in
+ case platformTablesNextToCode platform_a5jI2 of {
+ False ->
+ cmmOffsetW
+ platform_a5jI2 info_ptr_a5jI1 (ghc-prim-0.6.1:GHC.Types.I# 1#);
+ True ->
+ cmmOffsetB
+ platform_a5jI2
+ info_ptr_a5jI1
+ (negate
+ @ ByteOff GHC.Num.$fNumInt (stdInfoTableSizeB profile_a5jI0))
+ }
+
+-- RHS size: {terms: 29, types: 12, coercions: 0, joins: 0/3}
+getConstrTag :: PtrOpts -> CmmExpr -> CmmExpr
+[LclIdX,
+ Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
+ WorkFree=True, Expandable=True, Guidance=IF_ARGS [0 0] 270 30}]
+getConstrTag
+ = \ (opts_a5jHQ :: PtrOpts) (closure_ptr_a5jHR :: CmmExpr) ->
+ let {
+ profile_a5jHU :: Profile
+ [LclId,
+ Unf=Unf{Src=<vanilla>, TopLvl=False, Value=False, ConLike=False,
+ WorkFree=False, Expandable=True, Guidance=IF_ARGS [] 20 0}]
+ profile_a5jHU = po_profile opts_a5jHQ } in
+ let {
+ platform_a5jHT :: Platform
+ [LclId,
+ Unf=Unf{Src=<vanilla>, TopLvl=False, Value=False, ConLike=False,
+ WorkFree=False, Expandable=True, Guidance=IF_ARGS [] 20 0}]
+ platform_a5jHT = profilePlatform profile_a5jHU } in
+ let {
+ info_table_a5jHS :: CmmExpr
+ [LclId,
+ Unf=Unf{Src=<vanilla>, TopLvl=False, Value=False, ConLike=False,
+ WorkFree=False, Expandable=False, Guidance=IF_ARGS [] 60 0}]
+ info_table_a5jHS
+ = infoTable
+ profile_a5jHU (closureInfoPtr opts_a5jHQ closure_ptr_a5jHR) } in
+ GHC.Cmm.Expr.CmmMachOp
+ (GHC.Cmm.MachOp.MO_UU_Conv
+ (halfWordWidth platform_a5jHT) (wordWidth platform_a5jHT))
+ (GHC.Base.build
+ @ CmmExpr
+ (\ (@ a_d5k1w)
+ (c_d5k1x :: CmmExpr -> a_d5k1w -> a_d5k1w)
+ (n_d5k1y :: a_d5k1w) ->
+ c_d5k1x
+ (infoTableConstrTag profile_a5jHU info_table_a5jHS) n_d5k1y))
+
+-- RHS size: {terms: 29, types: 12, coercions: 0, joins: 0/3}
+cmmGetClosureType :: PtrOpts -> CmmExpr -> CmmExpr
+[LclIdX,
+ Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
+ WorkFree=True, Expandable=True, Guidance=IF_ARGS [0 0] 270 30}]
+cmmGetClosureType
+ = \ (opts_a5jHV :: PtrOpts) (closure_ptr_a5jHW :: CmmExpr) ->
+ let {
+ profile_a5jHZ :: Profile
+ [LclId,
+ Unf=Unf{Src=<vanilla>, TopLvl=False, Value=False, ConLike=False,
+ WorkFree=False, Expandable=True, Guidance=IF_ARGS [] 20 0}]
+ profile_a5jHZ = po_profile opts_a5jHV } in
+ let {
+ platform_a5jHY :: Platform
+ [LclId,
+ Unf=Unf{Src=<vanilla>, TopLvl=False, Value=False, ConLike=False,
+ WorkFree=False, Expandable=True, Guidance=IF_ARGS [] 20 0}]
+ platform_a5jHY = profilePlatform profile_a5jHZ } in
+ let {
+ info_table_a5jHX :: CmmExpr
+ [LclId,
+ Unf=Unf{Src=<vanilla>, TopLvl=False, Value=False, ConLike=False,
+ WorkFree=False, Expandable=False, Guidance=IF_ARGS [] 60 0}]
+ info_table_a5jHX
+ = infoTable
+ profile_a5jHZ (closureInfoPtr opts_a5jHV closure_ptr_a5jHW) } in
+ GHC.Cmm.Expr.CmmMachOp
+ (GHC.Cmm.MachOp.MO_UU_Conv
+ (halfWordWidth platform_a5jHY) (wordWidth platform_a5jHY))
+ (GHC.Base.build
+ @ CmmExpr
+ (\ (@ a_d5k1z)
+ (c_d5k1A :: CmmExpr -> a_d5k1z -> a_d5k1z)
+ (n_d5k1B :: a_d5k1z) ->
+ c_d5k1A
+ (infoTableClosureType profile_a5jHZ info_table_a5jHX) n_d5k1B))
+
+
diff --git a/compiler/GHC/Cmm/Info.dump-ds-preopt b/compiler/GHC/Cmm/Info.dump-ds-preopt
new file mode 100644
index 0000000000..6fa6df0c5e
--- /dev/null
+++ b/compiler/GHC/Cmm/Info.dump-ds-preopt
@@ -0,0 +1,4746 @@
+
+==================== Desugar (before optimization) ====================
+2020-11-24 12:41:53.5212256 UTC
+
+Result size of Desugar (before optimization)
+ = {terms: 1,698, types: 1,967, coercions: 23, joins: 0/116}
+
+Rec {
+-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
+$dNum_a19DG :: Num ByteOff
+[LclId]
+$dNum_a19DG = $dNum_a19BB
+
+-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
+$dNum_a19CI :: Num WordOff
+[LclId]
+$dNum_a19CI = $dNum_a19BB
+
+-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
+$dNum_a19CE :: Num WordOff
+[LclId]
+$dNum_a19CE = $dNum_a19BB
+
+-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
+$dNum_a19CC :: Num ByteOff
+[LclId]
+$dNum_a19CC = $dNum_a19BB
+
+-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
+$dNum_a19Cy :: Num ByteOff
+[LclId]
+$dNum_a19Cy = $dNum_a19BB
+
+-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
+$dNum_a19Cr :: Num ByteOff
+[LclId]
+$dNum_a19Cr = $dNum_a19BB
+
+-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
+$dNum_a19Co :: Num Int
+[LclId]
+$dNum_a19Co = $dNum_a19BB
+
+-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
+$dNum_a19Ck :: Num Int
+[LclId]
+$dNum_a19Ck = $dNum_a19BB
+
+-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
+$dNum_a19Ci :: Num ByteOff
+[LclId]
+$dNum_a19Ci = $dNum_a19BB
+
+-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
+$dNum_a19Cg :: Num ByteOff
+[LclId]
+$dNum_a19Cg = $dNum_a19BB
+
+-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
+$dNum_a19Cd :: Num Int
+[LclId]
+$dNum_a19Cd = $dNum_a19BB
+
+-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
+$dNum_a19C9 :: Num Int
+[LclId]
+$dNum_a19C9 = $dNum_a19BB
+
+-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
+$dNum_a19C7 :: Num ByteOff
+[LclId]
+$dNum_a19C7 = $dNum_a19BB
+
+-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
+$dNum_a19C4 :: Num ByteOff
+[LclId]
+$dNum_a19C4 = $dNum_a19BB
+
+-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
+$dNum_a19C1 :: Num ByteOff
+[LclId]
+$dNum_a19C1 = $dNum_a19BB
+
+-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
+$dNum_a19BY :: Num WordOff
+[LclId]
+$dNum_a19BY = $dNum_a19BB
+
+-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
+$dNum_a19BV :: Num WordOff
+[LclId]
+$dNum_a19BV = $dNum_a19BB
+
+-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
+$dNum_a19BR :: Num WordOff
+[LclId]
+$dNum_a19BR = $dNum_a19BB
+
+-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
+$dNum_a19BO :: Num WordOff
+[LclId]
+$dNum_a19BO = $dNum_a19BB
+
+-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
+$dNum_a19BK :: Num WordOff
+[LclId]
+$dNum_a19BK = $dNum_a19BB
+
+-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
+$dNum_a19BH :: Num WordOff
+[LclId]
+$dNum_a19BH = $dNum_a19BB
+
+-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
+$dNum_a19BD :: Num WordOff
+[LclId]
+$dNum_a19BD = $dNum_a19BB
+
+-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
+$dNum_a19BB :: Num WordOff
+[LclId]
+$dNum_a19BB = GHC.Num.$fNumInt
+
+-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
+$dIntegral_a19I0 :: Integral GHC.Runtime.Heap.Layout.SelectorOffset
+[LclId]
+$dIntegral_a19I0 = $dIntegral_a19Dc
+
+-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
+$dIntegral_a19HA :: Integral GHC.Types.Basic.ConTagZ
+[LclId]
+$dIntegral_a19HA = $dIntegral_a19Dc
+
+-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
+$dIntegral_a19H2 :: Integral Int
+[LclId]
+$dIntegral_a19H2 = $dIntegral_a19Dc
+
+-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
+$dIntegral_a19GY :: Integral Int
+[LclId]
+$dIntegral_a19GY = $dIntegral_a19Dc
+
+-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
+$dIntegral_a19Gd :: Integral Int
+[LclId]
+$dIntegral_a19Gd = $dIntegral_a19Dc
+
+-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
+$dIntegral_a19G2 :: Integral Int
+[LclId]
+$dIntegral_a19G2 = $dIntegral_a19Dc
+
+-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
+$dIntegral_a19Fs :: Integral Int
+[LclId]
+$dIntegral_a19Fs = $dIntegral_a19Dc
+
+-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
+$dIntegral_a19Dc :: Integral Int
+[LclId]
+$dIntegral_a19Dc = GHC.Real.$fIntegralInt
+
+-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
+$dNum_a19I1 :: Num Integer
+[LclId]
+$dNum_a19I1 = $dNum_a19Ei
+
+-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
+$dNum_a19HB :: Num Integer
+[LclId]
+$dNum_a19HB = $dNum_a19Ei
+
+-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
+$dNum_a19H3 :: Num Integer
+[LclId]
+$dNum_a19H3 = $dNum_a19Ei
+
+-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
+$dNum_a19GZ :: Num Integer
+[LclId]
+$dNum_a19GZ = $dNum_a19Ei
+
+-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
+$dNum_a19Ge :: Num Integer
+[LclId]
+$dNum_a19Ge = $dNum_a19Ei
+
+-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
+$dNum_a19G3 :: Num Integer
+[LclId]
+$dNum_a19G3 = $dNum_a19Ei
+
+-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
+$dNum_a19Ft :: Num Integer
+[LclId]
+$dNum_a19Ft = $dNum_a19Ei
+
+-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
+$dNum_a19Em :: Num Integer
+[LclId]
+$dNum_a19Em = $dNum_a19Ei
+
+-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
+$dNum_a19Ei :: Num Integer
+[LclId]
+$dNum_a19Ei = GHC.Num.$fNumInteger
+
+-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
+$dMonad_a19MQ :: Monad UniqSM
+[LclId]
+$dMonad_a19MQ = $dMonad_a19EH
+
+-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
+$dMonad_a19MJ :: Monad UniqSM
+[LclId]
+$dMonad_a19MJ = $dMonad_a19EH
+
+-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
+$dMonad_a19Mv :: Monad UniqSM
+[LclId]
+$dMonad_a19Mv = $dMonad_a19EH
+
+-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
+$dMonad_a19Me :: Monad UniqSM
+[LclId]
+$dMonad_a19Me = $dMonad_a19EH
+
+-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
+$dMonad_a19LX :: Monad UniqSM
+[LclId]
+$dMonad_a19LX = $dMonad_a19EH
+
+-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
+$dMonad_a19LK :: Monad UniqSM
+[LclId]
+$dMonad_a19LK = $dMonad_a19EH
+
+-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
+$dMonad_a19Ln :: Monad UniqSM
+[LclId]
+$dMonad_a19Ln = $dMonad_a19EH
+
+-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
+$dMonad_a19L1 :: Monad UniqSM
+[LclId]
+$dMonad_a19L1 = $dMonad_a19EH
+
+-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
+$dMonad_a19KH :: Monad UniqSM
+[LclId]
+$dMonad_a19KH = $dMonad_a19EH
+
+-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
+$dMonad_a19Kx :: Monad UniqSM
+[LclId]
+$dMonad_a19Kx = $dMonad_a19EH
+
+-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
+$dMonad_a19Km :: Monad UniqSM
+[LclId]
+$dMonad_a19Km = $dMonad_a19EH
+
+-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
+$dMonad_a19K9 :: Monad UniqSM
+[LclId]
+$dMonad_a19K9 = $dMonad_a19EH
+
+-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
+$dMonad_a19JT :: Monad UniqSM
+[LclId]
+$dMonad_a19JT = $dMonad_a19EH
+
+-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
+$dMonad_a19JB :: Monad UniqSM
+[LclId]
+$dMonad_a19JB = $dMonad_a19EH
+
+-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
+$dMonad_a19Jo :: Monad UniqSM
+[LclId]
+$dMonad_a19Jo = $dMonad_a19EH
+
+-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
+$dMonad_a19IU :: Monad UniqSM
+[LclId]
+$dMonad_a19IU = $dMonad_a19EH
+
+-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
+$dMonad_a19IB :: Monad UniqSM
+[LclId]
+$dMonad_a19IB = $dMonad_a19EH
+
+-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
+$dMonad_a19Ia :: Monad UniqSM
+[LclId]
+$dMonad_a19Ia = $dMonad_a19EH
+
+-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
+$dMonad_a19HQ :: Monad UniqSM
+[LclId]
+$dMonad_a19HQ = $dMonad_a19EH
+
+-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
+$dMonad_a19HG :: Monad UniqSM
+[LclId]
+$dMonad_a19HG = $dMonad_a19EH
+
+-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
+$dMonad_a19Hr :: Monad UniqSM
+[LclId]
+$dMonad_a19Hr = $dMonad_a19EH
+
+-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
+$dMonad_a19Hl :: Monad UniqSM
+[LclId]
+$dMonad_a19Hl = $dMonad_a19EH
+
+-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
+$dMonad_a19GH :: Monad UniqSM
+[LclId]
+$dMonad_a19GH = $dMonad_a19EH
+
+-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
+$dMonad_a19Gy :: Monad UniqSM
+[LclId]
+$dMonad_a19Gy = $dMonad_a19EH
+
+-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
+$dMonad_a19Go :: Monad UniqSM
+[LclId]
+$dMonad_a19Go = $dMonad_a19EH
+
+-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
+$dMonad_a19F5 :: Monad UniqSM
+[LclId]
+$dMonad_a19F5 = $dMonad_a19EH
+
+-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
+$dMonad_a19EZ :: Monad UniqSM
+[LclId]
+$dMonad_a19EZ = $dMonad_a19EH
+
+-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
+$dMonad_a19ER :: Monad UniqSM
+[LclId]
+$dMonad_a19ER = $dMonad_a19EH
+
+-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
+$dMonad_a19EH :: Monad UniqSM
+[LclId]
+$dMonad_a19EH = GHC.Types.Unique.Supply.$fMonadUniqSM
+
+-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
+$dFoldable_a19MV :: Foldable []
+[LclId]
+$dFoldable_a19MV = $dFoldable_a19FF
+
+-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
+$dFoldable_a19JL :: Foldable []
+[LclId]
+$dFoldable_a19JL = $dFoldable_a19FF
+
+-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
+$dFoldable_a19IJ :: Foldable []
+[LclId]
+$dFoldable_a19IJ = $dFoldable_a19FF
+
+-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
+$dFoldable_a19Iq :: Foldable []
+[LclId]
+$dFoldable_a19Iq = $dFoldable_a19FF
+
+-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
+$dFoldable_a19FF :: Foldable []
+[LclId]
+$dFoldable_a19FF = Data.Foldable.$fFoldable[]
+
+-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
+$dBits_a19G5 :: Bits StgWord
+[LclId]
+$dBits_a19G5 = $dBits_a19FZ
+
+-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
+$dBits_a19FZ :: Bits StgWord
+[LclId]
+$dBits_a19FZ = GHC.Runtime.Heap.Layout.$fBitsStgWord
+
+-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
+$dOrd_a19Gk :: Ord Int
+[LclId]
+$dOrd_a19Gk = ghc-prim-0.6.1:GHC.Classes.$fOrdInt
+
+-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
+$dMonadUnique_a19Gs :: MonadUnique UniqSM
+[LclId]
+$dMonadUnique_a19Gs = GHC.Types.Unique.Supply.$fMonadUniqueUniqSM
+
+-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
+$dEq_a19GR :: Eq Arch
+[LclId]
+$dEq_a19GR = GHC.Platform.ArchOS.$fEqArch
+
+-- RHS size: {terms: 20, types: 3, coercions: 7, joins: 0/0}
+$dIP_a19J3 :: HasCallStack
+[LclId]
+$dIP_a19J3
+ = (GHC.Stack.Types.pushCallStack
+ (ghc-prim-0.6.1:GHC.CString.unpackCString# "pprPanic"#,
+ GHC.Stack.Types.SrcLoc
+ (ghc-prim-0.6.1:GHC.CString.unpackCString# "ghc"#)
+ (ghc-prim-0.6.1:GHC.CString.unpackCString# "GHC.Cmm.Info"#)
+ (ghc-prim-0.6.1:GHC.CString.unpackCString#
+ "E:\\\\ghc_inferTags\\\\compiler\\\\GHC\\\\Cmm\\\\Info.hs"#)
+ (ghc-prim-0.6.1:GHC.Types.I# 264#)
+ (ghc-prim-0.6.1:GHC.Types.I# 25#)
+ (ghc-prim-0.6.1:GHC.Types.I# 264#)
+ (ghc-prim-0.6.1:GHC.Types.I# 57#))
+ ($dIP_a19OK
+ `cast` (ghc-prim-0.6.1:GHC.Classes.N:IP[0]
+ <"callStack">_N <GHC.Stack.Types.CallStack>_N
+ :: (?callStack::GHC.Stack.Types.CallStack)
+ ~R# GHC.Stack.Types.CallStack)))
+ `cast` (Sym (ghc-prim-0.6.1:GHC.Classes.N:IP[0]
+ <"callStack">_N <GHC.Stack.Types.CallStack>_N)
+ :: GHC.Stack.Types.CallStack
+ ~R# (?callStack::GHC.Stack.Types.CallStack))
+
+-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
+$dOutputable_a19J5 :: Outputable ClosureTypeInfo
+[LclId]
+$dOutputable_a19J5
+ = GHC.Runtime.Heap.Layout.$fOutputableClosureTypeInfo
+
+-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
+$dIsMap_a19N1 :: IsMap GHC.Cmm.Dataflow.Label.LabelMap
+[LclId]
+$dIsMap_a19N1 = $dIsMap_a19LS
+
+-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
+$dIsMap_a19MM :: IsMap GHC.Cmm.Dataflow.Label.LabelMap
+[LclId]
+$dIsMap_a19MM = $dIsMap_a19LS
+
+-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
+$dIsMap_a19Ml :: IsMap GHC.Cmm.Dataflow.Label.LabelMap
+[LclId]
+$dIsMap_a19Ml = $dIsMap_a19LS
+
+-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
+$dIsMap_a19LS :: IsMap GHC.Cmm.Dataflow.Label.LabelMap
+[LclId]
+$dIsMap_a19LS = GHC.Cmm.Dataflow.Label.$fIsMapLabelMap
+
+-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
+$dFunctor_a19Mz :: Functor UniqSM
+[LclId]
+$dFunctor_a19Mz = GHC.Types.Unique.Supply.$fFunctorUniqSM
+
+-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
+$dTraversable_a19MF :: Traversable []
+[LclId]
+$dTraversable_a19MF = Data.Traversable.$fTraversable[]
+
+-- RHS size: {terms: 1, types: 0, coercions: 4, joins: 0/0}
+$dIP_a19OK :: HasCallStack
+[LclId]
+$dIP_a19OK
+ = GHC.Stack.Types.emptyCallStack
+ `cast` (Sym (ghc-prim-0.6.1:GHC.Classes.N:IP[0]
+ <"callStack">_N <GHC.Stack.Types.CallStack>_N)
+ :: GHC.Stack.Types.CallStack
+ ~R# (?callStack::GHC.Stack.Types.CallStack))
+
+-- RHS size: {terms: 8, types: 0, coercions: 0, joins: 0/0}
+GHC.Cmm.Info.$tcPtrOpts :: ghc-prim-0.6.1:GHC.Types.TyCon
+[LclIdX]
+GHC.Cmm.Info.$tcPtrOpts
+ = ghc-prim-0.6.1:GHC.Types.TyCon
+ 10783844252980521413##
+ 13019815378033756893##
+ GHC.Cmm.Info.$trModule
+ (ghc-prim-0.6.1:GHC.Types.TrNameS "PtrOpts"#)
+ 0#
+ ghc-prim-0.6.1:GHC.Types.krep$*
+
+-- RHS size: {terms: 8, types: 0, coercions: 0, joins: 0/0}
+GHC.Cmm.Info.$tc'PtrOpts :: ghc-prim-0.6.1:GHC.Types.TyCon
+[LclIdX]
+GHC.Cmm.Info.$tc'PtrOpts
+ = ghc-prim-0.6.1:GHC.Types.TyCon
+ 11086577099826734001##
+ 4931096801432934088##
+ GHC.Cmm.Info.$trModule
+ (ghc-prim-0.6.1:GHC.Types.TrNameS "'PtrOpts"#)
+ 0#
+ $krep_a19ON
+
+-- RHS size: {terms: 3, types: 0, coercions: 0, joins: 0/0}
+$krep_a19OP [InlPrag=NOUSERINLINE[~]]
+ :: ghc-prim-0.6.1:GHC.Types.KindRep
+[LclId]
+$krep_a19OP
+ = ghc-prim-0.6.1:GHC.Types.KindRepFun $krep_a19OQ $krep_a19OR
+
+-- RHS size: {terms: 3, types: 0, coercions: 0, joins: 0/0}
+$krep_a19ON [InlPrag=NOUSERINLINE[~]]
+ :: ghc-prim-0.6.1:GHC.Types.KindRep
+[LclId]
+$krep_a19ON
+ = ghc-prim-0.6.1:GHC.Types.KindRepFun $krep_a19OO $krep_a19OP
+
+-- RHS size: {terms: 3, types: 1, coercions: 0, joins: 0/0}
+$krep_a19OO [InlPrag=NOUSERINLINE[~]]
+ :: ghc-prim-0.6.1:GHC.Types.KindRep
+[LclId]
+$krep_a19OO
+ = ghc-prim-0.6.1:GHC.Types.KindRepTyConApp
+ GHC.Platform.Profile.$tcProfile
+ (ghc-prim-0.6.1:GHC.Types.[] @ ghc-prim-0.6.1:GHC.Types.KindRep)
+
+-- RHS size: {terms: 3, types: 1, coercions: 0, joins: 0/0}
+$krep_a19OQ [InlPrag=NOUSERINLINE[~]]
+ :: ghc-prim-0.6.1:GHC.Types.KindRep
+[LclId]
+$krep_a19OQ
+ = ghc-prim-0.6.1:GHC.Types.KindRepTyConApp
+ ghc-prim-0.6.1:GHC.Types.$tcBool
+ (ghc-prim-0.6.1:GHC.Types.[] @ ghc-prim-0.6.1:GHC.Types.KindRep)
+
+-- RHS size: {terms: 3, types: 1, coercions: 0, joins: 0/0}
+$krep_a19OR [InlPrag=NOUSERINLINE[~]]
+ :: ghc-prim-0.6.1:GHC.Types.KindRep
+[LclId]
+$krep_a19OR
+ = ghc-prim-0.6.1:GHC.Types.KindRepTyConApp
+ GHC.Cmm.Info.$tcPtrOpts
+ (ghc-prim-0.6.1:GHC.Types.[] @ ghc-prim-0.6.1:GHC.Types.KindRep)
+
+-- RHS size: {terms: 5, types: 0, coercions: 0, joins: 0/0}
+GHC.Cmm.Info.$trModule :: ghc-prim-0.6.1:GHC.Types.Module
+[LclIdX]
+GHC.Cmm.Info.$trModule
+ = ghc-prim-0.6.1:GHC.Types.Module
+ (ghc-prim-0.6.1:GHC.Types.TrNameS "ghc"#)
+ (ghc-prim-0.6.1:GHC.Types.TrNameS "GHC.Cmm.Info"#)
+
+-- RHS size: {terms: 2, types: 0, coercions: 0, joins: 0/0}
+profInfoTableSizeW :: WordOff
+[LclIdX]
+profInfoTableSizeW = ghc-prim-0.6.1:GHC.Types.I# 2#
+
+-- RHS size: {terms: 2, types: 0, coercions: 0, joins: 0/0}
+fixedInfoTableSizeW :: WordOff
+[LclIdX]
+fixedInfoTableSizeW = ghc-prim-0.6.1:GHC.Types.I# 2#
+
+-- RHS size: {terms: 8, types: 2, coercions: 0, joins: 0/0}
+maxStdInfoTableSizeW :: WordOff
+[LclIdX]
+maxStdInfoTableSizeW
+ = + @ WordOff
+ $dNum_a19BB
+ (+ @ WordOff
+ $dNum_a19BD
+ (ghc-prim-0.6.1:GHC.Types.I# 1#)
+ fixedInfoTableSizeW)
+ profInfoTableSizeW
+
+-- RHS size: {terms: 5, types: 1, coercions: 0, joins: 0/0}
+maxRetInfoTableSizeW :: WordOff
+[LclIdX]
+maxRetInfoTableSizeW
+ = + @ WordOff
+ $dNum_a19BK
+ maxStdInfoTableSizeW
+ (ghc-prim-0.6.1:GHC.Types.I# 1#)
+
+-- RHS size: {terms: 12, types: 3, coercions: 0, joins: 0/0}
+stdInfoTableSizeW :: Profile -> WordOff
+[LclIdX]
+stdInfoTableSizeW
+ = \ (profile_a19wi :: Profile) ->
+ + @ WordOff
+ $dNum_a19BR
+ fixedInfoTableSizeW
+ (case profileIsProfiling profile_a19wi of wild_00 {
+ False -> ghc-prim-0.6.1:GHC.Types.I# 0#;
+ True -> profInfoTableSizeW
+ })
+
+-- RHS size: {terms: 7, types: 2, coercions: 0, joins: 0/0}
+stdInfoTableSizeB :: Profile -> ByteOff
+[LclIdX]
+stdInfoTableSizeB
+ = \ (profile_a19wj :: Profile) ->
+ * @ WordOff
+ $dNum_a19BY
+ (stdInfoTableSizeW profile_a19wj)
+ (profileWordSizeInBytes profile_a19wj)
+
+-- RHS size: {terms: 8, types: 2, coercions: 0, joins: 0/0}
+stdSrtBitmapOffset :: Profile -> ByteOff
+[LclIdX]
+stdSrtBitmapOffset
+ = \ (profile_a19wk :: Profile) ->
+ - @ ByteOff
+ $dNum_a19C1
+ (stdInfoTableSizeB profile_a19wk)
+ (halfWordSize (profilePlatform profile_a19wk))
+
+-- RHS size: {terms: 7, types: 2, coercions: 0, joins: 0/0}
+stdClosureTypeOffset :: Profile -> ByteOff
+[LclIdX]
+stdClosureTypeOffset
+ = \ (profile_a19wl :: Profile) ->
+ - @ ByteOff
+ $dNum_a19C4
+ (stdInfoTableSizeB profile_a19wl)
+ (profileWordSizeInBytes profile_a19wl)
+
+-- RHS size: {terms: 11, types: 3, coercions: 0, joins: 0/0}
+stdPtrsOffset :: Profile -> ByteOff
+[LclIdX]
+stdPtrsOffset
+ = \ (profile_a19wm :: Profile) ->
+ - @ ByteOff
+ $dNum_a19C7
+ (stdInfoTableSizeB profile_a19wm)
+ (* @ Int
+ $dNum_a19C9
+ (ghc-prim-0.6.1:GHC.Types.I# 2#)
+ (profileWordSizeInBytes profile_a19wm))
+
+-- RHS size: {terms: 16, types: 4, coercions: 0, joins: 0/0}
+stdNonPtrsOffset :: Profile -> ByteOff
+[LclIdX]
+stdNonPtrsOffset
+ = \ (profile_a19wn :: Profile) ->
+ + @ ByteOff
+ $dNum_a19Cg
+ (- @ ByteOff
+ $dNum_a19Ci
+ (stdInfoTableSizeB profile_a19wn)
+ (* @ Int
+ $dNum_a19Ck
+ (ghc-prim-0.6.1:GHC.Types.I# 2#)
+ (profileWordSizeInBytes profile_a19wn)))
+ (halfWordSize (profilePlatform profile_a19wn))
+
+-- RHS size: {terms: 7, types: 2, coercions: 0, joins: 0/0}
+conInfoTableSizeB :: Profile -> Int
+[LclIdX]
+conInfoTableSizeB
+ = \ (profile_a19wo :: Profile) ->
+ + @ ByteOff
+ $dNum_a19Cr
+ (stdInfoTableSizeB profile_a19wo)
+ (profileWordSizeInBytes profile_a19wo)
+
+-- RHS size: {terms: 35, types: 10, coercions: 0, joins: 0/2}
+funInfoTable :: Profile -> CmmExpr -> CmmExpr
+[LclIdX]
+funInfoTable
+ = \ (profile_a19w6 :: Profile) (info_ptr_a19w7 :: CmmExpr) ->
+ letrec {
+ platform_a19w8 :: Platform
+ [LclId]
+ platform_a19w8 = profilePlatform profile_a19w6; } in
+ let {
+ fail_d19OY :: ghc-prim-0.6.1:GHC.Prim.Void# -> CmmExpr
+ [LclId]
+ fail_d19OY
+ = \ (ds_d19OZ [OS=OneShot] :: ghc-prim-0.6.1:GHC.Prim.Void#) ->
+ cmmOffsetW
+ platform_a19w8
+ info_ptr_a19w7
+ (+ @ WordOff
+ $dNum_a19CE
+ (ghc-prim-0.6.1:GHC.Types.I# 1#)
+ (stdInfoTableSizeW profile_a19w6)) } in
+ case platformTablesNextToCode platform_a19w8 of wild_00 {
+ False -> fail_d19OY ghc-prim-0.6.1:GHC.Prim.void#;
+ True ->
+ cmmOffsetB
+ platform_a19w8
+ info_ptr_a19w7
+ (- @ ByteOff
+ $dNum_a19Cy
+ (negate @ ByteOff $dNum_a19CC (stdInfoTableSizeB profile_a19w6))
+ (pc_SIZEOF_StgFunInfoExtraRev (platformConstants platform_a19w8)))
+ }
+
+-- RHS size: {terms: 58, types: 33, coercions: 0, joins: 0/9}
+funInfoArity :: Profile -> CmmExpr -> CmmExpr
+[LclIdX]
+funInfoArity
+ = \ (profile_a19w9 :: Profile) (iptr_a19wa :: CmmExpr) ->
+ letrec {
+ fun_info_a19wc :: CmmExpr
+ [LclId]
+ fun_info_a19wc = funInfoTable profile_a19w9 iptr_a19wa; } in
+ letrec {
+ platform_a19wb :: Platform
+ [LclId]
+ platform_a19wb = profilePlatform profile_a19w9; } in
+ letrec {
+ tablesNextToCode_a19we :: Bool
+ [LclId]
+ tablesNextToCode_a19we
+ = platformTablesNextToCode platform_a19wb; } in
+ letrec {
+ pc_a19wh :: PlatformConstants
+ [LclId]
+ pc_a19wh = platformConstants platform_a19wb; } in
+ letrec {
+ ds_d19P6 :: (Int, Int)
+ [LclId]
+ ds_d19P6
+ = let {
+ fail_d19P0 :: ghc-prim-0.6.1:GHC.Prim.Void# -> (Int, Int)
+ [LclId]
+ fail_d19P0
+ = \ (ds_d19P1 [OS=OneShot] :: ghc-prim-0.6.1:GHC.Prim.Void#) ->
+ (pc_REP_StgFunInfoExtraFwd_arity pc_a19wh,
+ pc_OFFSET_StgFunInfoExtraFwd_arity pc_a19wh) } in
+ case tablesNextToCode_a19we of wild_00 {
+ False -> fail_d19P0 ghc-prim-0.6.1:GHC.Prim.void#;
+ True ->
+ (pc_REP_StgFunInfoExtraRev_arity pc_a19wh,
+ pc_OFFSET_StgFunInfoExtraRev_arity pc_a19wh)
+ };
+ rep_bytes_a19wf :: Int
+ [LclId]
+ rep_bytes_a19wf
+ = case ds_d19P6 of wild_00 { (rep_bytes_a19wf, offset_a19wg) ->
+ rep_bytes_a19wf
+ };
+ offset_a19wg :: Int
+ [LclId]
+ offset_a19wg
+ = case ds_d19P6 of wild_00 { (rep_bytes_a19wf, offset_a19wg) ->
+ offset_a19wg
+ }; } in
+ letrec {
+ rep_a19wd :: CmmType
+ [LclId]
+ rep_a19wd = cmmBits (widthFromBytes rep_bytes_a19wf); } in
+ cmmToWord
+ platform_a19wb
+ (cmmLoadIndex
+ platform_a19wb
+ rep_a19wd
+ fun_info_a19wc
+ (div @ Int $dIntegral_a19Dc offset_a19wg rep_bytes_a19wf))
+
+-- RHS size: {terms: 13, types: 3, coercions: 0, joins: 0/1}
+infoTableNonPtrs :: Profile -> CmmExpr -> CmmExpr
+[LclIdX]
+infoTableNonPtrs
+ = \ (profile_a19w3 :: Profile) (info_tbl_a19w4 :: CmmExpr) ->
+ letrec {
+ platform_a19w5 :: Platform
+ [LclId]
+ platform_a19w5 = profilePlatform profile_a19w3; } in
+ GHC.Cmm.Expr.$WCmmLoad
+ (cmmOffsetB
+ platform_a19w5 info_tbl_a19w4 (stdNonPtrsOffset profile_a19w3))
+ (bHalfWord platform_a19w5)
+
+-- RHS size: {terms: 13, types: 3, coercions: 0, joins: 0/1}
+infoTablePtrs :: Profile -> CmmExpr -> CmmExpr
+[LclIdX]
+infoTablePtrs
+ = \ (profile_a19w0 :: Profile) (info_tbl_a19w1 :: CmmExpr) ->
+ letrec {
+ platform_a19w2 :: Platform
+ [LclId]
+ platform_a19w2 = profilePlatform profile_a19w0; } in
+ GHC.Cmm.Expr.$WCmmLoad
+ (cmmOffsetB
+ platform_a19w2 info_tbl_a19w1 (stdPtrsOffset profile_a19w0))
+ (bHalfWord platform_a19w2)
+
+-- RHS size: {terms: 13, types: 3, coercions: 0, joins: 0/1}
+infoTableClosureType :: Profile -> CmmExpr -> CmmExpr
+[LclIdX]
+infoTableClosureType
+ = \ (profile_a19vX :: Profile) (info_tbl_a19vY :: CmmExpr) ->
+ letrec {
+ platform_a19vZ :: Platform
+ [LclId]
+ platform_a19vZ = profilePlatform profile_a19vX; } in
+ GHC.Cmm.Expr.$WCmmLoad
+ (cmmOffsetB
+ platform_a19vZ info_tbl_a19vY (stdClosureTypeOffset profile_a19vX))
+ (bHalfWord platform_a19vZ)
+
+-- RHS size: {terms: 13, types: 3, coercions: 0, joins: 0/1}
+infoTableSrtBitmap :: Profile -> CmmExpr -> CmmExpr
+[LclIdX]
+infoTableSrtBitmap
+ = \ (profile_a19vU :: Profile) (info_tbl_a19vV :: CmmExpr) ->
+ letrec {
+ platform_a19vW :: Platform
+ [LclId]
+ platform_a19vW = profilePlatform profile_a19vU; } in
+ GHC.Cmm.Expr.$WCmmLoad
+ (cmmOffsetB
+ platform_a19vW info_tbl_a19vV (stdSrtBitmapOffset profile_a19vU))
+ (bHalfWord platform_a19vW)
+
+-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
+infoTableConstrTag :: Profile -> CmmExpr -> CmmExpr
+[LclIdX]
+infoTableConstrTag = infoTableSrtBitmap
+
+-- RHS size: {terms: 26, types: 8, coercions: 0, joins: 0/2}
+infoTable :: Profile -> CmmExpr -> CmmExpr
+[LclIdX]
+infoTable
+ = \ (profile_a19vR :: Profile) (info_ptr_a19vS :: CmmExpr) ->
+ letrec {
+ platform_a19vT :: Platform
+ [LclId]
+ platform_a19vT = profilePlatform profile_a19vR; } in
+ let {
+ fail_d19Pl :: ghc-prim-0.6.1:GHC.Prim.Void# -> CmmExpr
+ [LclId]
+ fail_d19Pl
+ = \ (ds_d19Pm [OS=OneShot] :: ghc-prim-0.6.1:GHC.Prim.Void#) ->
+ cmmOffsetW
+ platform_a19vT info_ptr_a19vS (ghc-prim-0.6.1:GHC.Types.I# 1#) } in
+ case platformTablesNextToCode platform_a19vT of wild_00 {
+ False -> fail_d19Pl ghc-prim-0.6.1:GHC.Prim.void#;
+ True ->
+ cmmOffsetB
+ platform_a19vT
+ info_ptr_a19vS
+ (negate @ ByteOff $dNum_a19DG (stdInfoTableSizeB profile_a19vR))
+ }
+
+-- RHS size: {terms: 12, types: 3, coercions: 0, joins: 0/0}
+entryCode :: Platform -> CmmExpr -> CmmExpr
+[LclIdX]
+entryCode
+ = \ (platform_a19vF :: Platform) (e_a19vG :: CmmExpr) ->
+ case platformTablesNextToCode platform_a19vF of wild_00 {
+ False -> GHC.Cmm.Expr.$WCmmLoad e_a19vG (bWord platform_a19vF);
+ True -> e_a19vG
+ }
+
+-- RHS size: {terms: 29, types: 14, coercions: 0, joins: 0/2}
+wordAligned :: PtrOpts -> CmmExpr -> CmmExpr
+[LclIdX]
+wordAligned
+ = \ (opts_a19vA :: PtrOpts) (e_a19vB :: CmmExpr) ->
+ letrec {
+ platform_a19vC :: Platform
+ [LclId]
+ platform_a19vC = profilePlatform (po_profile opts_a19vA); } in
+ let {
+ fail_d19Pw :: ghc-prim-0.6.1:GHC.Prim.Void# -> CmmExpr
+ [LclId]
+ fail_d19Pw
+ = \ (ds_d19Px [OS=OneShot] :: ghc-prim-0.6.1:GHC.Prim.Void#) ->
+ e_a19vB } in
+ case po_align_check opts_a19vA of wild_00 {
+ False -> fail_d19Pw ghc-prim-0.6.1:GHC.Prim.void#;
+ True ->
+ GHC.Cmm.Expr.CmmMachOp
+ (GHC.Cmm.MachOp.MO_AlignmentCheck
+ (platformWordSizeInBytes platform_a19vC)
+ (wordWidth platform_a19vC))
+ (GHC.Base.build
+ @ CmmExpr
+ (\ (@ a_d19Pn)
+ (c_d19Po :: CmmExpr -> a_d19Pn -> a_d19Pn)
+ (n_d19Pp :: a_d19Pn) ->
+ c_d19Po e_a19vB n_d19Pp))
+ }
+
+-- RHS size: {terms: 10, types: 2, coercions: 0, joins: 0/0}
+closureInfoPtr :: PtrOpts -> CmmExpr -> CmmExpr
+[LclIdX]
+closureInfoPtr
+ = \ (opts_a19vD :: PtrOpts) (e_a19vE :: CmmExpr) ->
+ GHC.Cmm.Expr.$WCmmLoad
+ (wordAligned opts_a19vD e_a19vE)
+ (bWord (profilePlatform (po_profile opts_a19vD)))
+
+-- RHS size: {terms: 29, types: 12, coercions: 0, joins: 0/3}
+getConstrTag :: PtrOpts -> CmmExpr -> CmmExpr
+[LclIdX]
+getConstrTag
+ = \ (opts_a19vH :: PtrOpts) (closure_ptr_a19vI :: CmmExpr) ->
+ letrec {
+ profile_a19vL :: Profile
+ [LclId]
+ profile_a19vL = po_profile opts_a19vH; } in
+ letrec {
+ platform_a19vK :: Platform
+ [LclId]
+ platform_a19vK = profilePlatform profile_a19vL; } in
+ letrec {
+ info_table_a19vJ :: CmmExpr
+ [LclId]
+ info_table_a19vJ
+ = infoTable
+ profile_a19vL (closureInfoPtr opts_a19vH closure_ptr_a19vI); } in
+ GHC.Cmm.Expr.CmmMachOp
+ (GHC.Cmm.MachOp.MO_UU_Conv
+ (halfWordWidth platform_a19vK) (wordWidth platform_a19vK))
+ (GHC.Base.build
+ @ CmmExpr
+ (\ (@ a_d19Py)
+ (c_d19Pz :: CmmExpr -> a_d19Py -> a_d19Py)
+ (n_d19PA :: a_d19Py) ->
+ c_d19Pz
+ (infoTableConstrTag profile_a19vL info_table_a19vJ) n_d19PA))
+
+-- RHS size: {terms: 29, types: 12, coercions: 0, joins: 0/3}
+cmmGetClosureType :: PtrOpts -> CmmExpr -> CmmExpr
+[LclIdX]
+cmmGetClosureType
+ = \ (opts_a19vM :: PtrOpts) (closure_ptr_a19vN :: CmmExpr) ->
+ letrec {
+ profile_a19vQ :: Profile
+ [LclId]
+ profile_a19vQ = po_profile opts_a19vM; } in
+ letrec {
+ platform_a19vP :: Platform
+ [LclId]
+ platform_a19vP = profilePlatform profile_a19vQ; } in
+ letrec {
+ info_table_a19vO :: CmmExpr
+ [LclId]
+ info_table_a19vO
+ = infoTable
+ profile_a19vQ (closureInfoPtr opts_a19vM closure_ptr_a19vN); } in
+ GHC.Cmm.Expr.CmmMachOp
+ (GHC.Cmm.MachOp.MO_UU_Conv
+ (halfWordWidth platform_a19vP) (wordWidth platform_a19vP))
+ (GHC.Base.build
+ @ CmmExpr
+ (\ (@ a_d19PB)
+ (c_d19PC :: CmmExpr -> a_d19PB -> a_d19PB)
+ (n_d19PD :: a_d19PB) ->
+ c_d19PC
+ (infoTableClosureType profile_a19vQ info_table_a19vO) n_d19PD))
+
+-- RHS size: {terms: 6, types: 2, coercions: 0, joins: 0/0}
+srtEscape :: Platform -> StgHalfWord
+[LclIdX]
+srtEscape
+ = \ (platform_a19vz :: Platform) ->
+ toStgHalfWord platform_a19vz (negate @ Integer $dNum_a19Ei 1)
+
+-- RHS size: {terms: 20, types: 32, coercions: 0, joins: 0/3}
+newStringLit
+ :: forall info stmt.
+ ByteString -> UniqSM (CmmLit, GenCmmDecl RawCmmStatics info stmt)
+[LclIdX]
+newStringLit
+ = \ (@ info_a19En) (@ stmt_a19Eo) ->
+ let {
+ $dMonad_a19Ez :: Monad UniqSM
+ [LclId]
+ $dMonad_a19Ez = $dMonad_a19EH } in
+ let {
+ $dMonadUnique_a19Ex :: MonadUnique UniqSM
+ [LclId]
+ $dMonadUnique_a19Ex = $dMonadUnique_a19Gs } in
+ let {
+ $dMonad_a19Et :: Monad UniqSM
+ [LclId]
+ $dMonad_a19Et = $dMonad_a19EH } in
+ \ (bytes_a19vx :: ByteString) ->
+ >>=
+ @ UniqSM
+ $dMonad_a19Et
+ @ GHC.Types.Unique.Unique
+ @ (CmmLit, GenCmmDecl RawCmmStatics info_a19En stmt_a19Eo)
+ (getUniqueM @ UniqSM $dMonadUnique_a19Ex)
+ (\ (uniq_a19vy :: GHC.Types.Unique.Unique) ->
+ return
+ @ UniqSM
+ $dMonad_a19Ez
+ @ (CmmLit, GenCmmDecl (GenCmmStatics 'True) info_a19En stmt_a19Eo)
+ (mkByteStringCLit
+ @ 'True
+ @ info_a19En
+ @ stmt_a19Eo
+ (mkStringLitLabel uniq_a19vy)
+ bytes_a19vx))
+
+-- RHS size: {terms: 46, types: 131, coercions: 0, joins: 0/0}
+mkProfLits
+ :: Platform
+ -> ProfilingInfo -> UniqSM ((CmmLit, CmmLit), [RawCmmDecl])
+[LclIdX]
+mkProfLits
+ = \ (platform_a19vq :: Platform) (ds_d19PE :: ProfilingInfo) ->
+ case ds_d19PE of wild_00 {
+ NoProfilingInfo ->
+ return
+ @ UniqSM
+ $dMonad_a19EH
+ @ ((CmmLit, CmmLit), [RawCmmDecl])
+ ((zeroCLit platform_a19vq, zeroCLit platform_a19vq),
+ ghc-prim-0.6.1:GHC.Types.[] @ RawCmmDecl);
+ ProfilingInfo td_a19vr cd_a19vs ->
+ >>=
+ @ UniqSM
+ $dMonad_a19ER
+ @ (CmmLit,
+ GenCmmDecl
+ RawCmmStatics
+ (GHC.Cmm.Dataflow.Label.LabelMap RawCmmStatics)
+ CmmGraph)
+ @ ((CmmLit, CmmLit), [RawCmmDecl])
+ (newStringLit
+ @ (GHC.Cmm.Dataflow.Label.LabelMap RawCmmStatics)
+ @ CmmGraph
+ td_a19vr)
+ (\ (ds_d19PR
+ :: (CmmLit,
+ GenCmmDecl
+ RawCmmStatics
+ (GHC.Cmm.Dataflow.Label.LabelMap RawCmmStatics)
+ CmmGraph)) ->
+ case ds_d19PR of wild_00 { (td_lit_a19vt, td_decl_a19vu) ->
+ >>=
+ @ UniqSM
+ $dMonad_a19EZ
+ @ (CmmLit,
+ GenCmmDecl
+ RawCmmStatics
+ (GHC.Cmm.Dataflow.Label.LabelMap RawCmmStatics)
+ CmmGraph)
+ @ ((CmmLit, CmmLit), [RawCmmDecl])
+ (newStringLit
+ @ (GHC.Cmm.Dataflow.Label.LabelMap RawCmmStatics)
+ @ CmmGraph
+ cd_a19vs)
+ (\ (ds_d19PM
+ :: (CmmLit,
+ GenCmmDecl
+ RawCmmStatics
+ (GHC.Cmm.Dataflow.Label.LabelMap RawCmmStatics)
+ CmmGraph)) ->
+ case ds_d19PM of wild_00 { (cd_lit_a19vv, cd_decl_a19vw) ->
+ return
+ @ UniqSM
+ $dMonad_a19F5
+ @ ((CmmLit, CmmLit),
+ [GenCmmDecl
+ RawCmmStatics
+ (GHC.Cmm.Dataflow.Label.LabelMap RawCmmStatics)
+ CmmGraph])
+ ((td_lit_a19vt, cd_lit_a19vv),
+ GHC.Base.build
+ @ (GenCmmDecl
+ RawCmmStatics
+ (GHC.Cmm.Dataflow.Label.LabelMap RawCmmStatics)
+ CmmGraph)
+ (\ (@ a_d19PJ)
+ (c_d19PK
+ :: GenCmmDecl
+ RawCmmStatics
+ (GHC.Cmm.Dataflow.Label.LabelMap RawCmmStatics)
+ CmmGraph
+ -> a_d19PJ -> a_d19PJ)
+ (n_d19PL :: a_d19PJ) ->
+ c_d19PK td_decl_a19vu (c_d19PK cd_decl_a19vw n_d19PL)))
+ })
+ })
+ }
+
+-- RHS size: {terms: 52, types: 39, coercions: 0, joins: 0/4}
+mkStdInfoTable
+ :: DynFlags
+ -> (CmmLit, CmmLit) -> Int -> CmmLit -> CmmLit -> [CmmLit]
+[LclIdX]
+mkStdInfoTable
+ = \ (dflags_a19vh :: DynFlags)
+ (ds_d19Q2 :: (CmmLit, CmmLit))
+ (cl_type_a19vk :: Int)
+ (srt_a19vl :: CmmLit)
+ (layout_lit_a19vm :: CmmLit) ->
+ case ds_d19Q2 of wild_00
+ { (type_descr_a19vi, closure_descr_a19vj) ->
+ letrec {
+ prof_info_a19vo :: [CmmLit]
+ [LclId]
+ prof_info_a19vo
+ = let {
+ fail_d19Ql :: ghc-prim-0.6.1:GHC.Prim.Void# -> [CmmLit]
+ [LclId]
+ fail_d19Ql
+ = \ (ds_d19Qm [OS=OneShot] :: ghc-prim-0.6.1:GHC.Prim.Void#) ->
+ ghc-prim-0.6.1:GHC.Types.[] @ CmmLit } in
+ case sccProfilingEnabled dflags_a19vh of wild_00 {
+ False -> fail_d19Ql ghc-prim-0.6.1:GHC.Prim.void#;
+ True ->
+ GHC.Base.build
+ @ CmmLit
+ (\ (@ a_d19Qc)
+ (c_d19Qd :: CmmLit -> a_d19Qc -> a_d19Qc)
+ (n_d19Qe :: a_d19Qc) ->
+ c_d19Qd type_descr_a19vi (c_d19Qd closure_descr_a19vj n_d19Qe))
+ }; } in
+ letrec {
+ platform_a19vn :: Platform
+ [LclId]
+ platform_a19vn = targetPlatform dflags_a19vh; } in
+ letrec {
+ tag_a19vp :: CmmLit
+ [LclId]
+ tag_a19vp
+ = GHC.Cmm.Expr.$WCmmInt
+ (fromIntegral
+ @ Int @ Integer $dIntegral_a19Fs $dNum_a19Ft cl_type_a19vk)
+ (halfWordWidth platform_a19vn); } in
+ ++
+ @ CmmLit
+ prof_info_a19vo
+ (GHC.Base.build
+ @ CmmLit
+ (\ (@ a_d19Q5)
+ (c_d19Q6 :: CmmLit -> a_d19Q5 -> a_d19Q5)
+ (n_d19Q7 :: a_d19Q5) ->
+ c_d19Q6
+ layout_lit_a19vm (c_d19Q6 tag_a19vp (c_d19Q6 srt_a19vl n_d19Q7))))
+ }
+
+-- RHS size: {terms: 103, types: 99, coercions: 0, joins: 0/10}
+mkLivenessBits
+ :: DynFlags -> Liveness -> UniqSM (CmmLit, [RawCmmDecl])
+[LclIdX]
+mkLivenessBits
+ = \ (dflags_a19v6 :: DynFlags) (liveness_a19v7 :: Liveness) ->
+ letrec {
+ n_bits_a19v9 :: Int
+ [LclId]
+ n_bits_a19v9
+ = length @ [] $dFoldable_a19FF @ Bool liveness_a19v7; } in
+ letrec {
+ platform_a19v8 :: Platform
+ [LclId]
+ platform_a19v8 = targetPlatform dflags_a19v6; } in
+ letrec {
+ bitmap_a19va :: Bitmap
+ [LclId]
+ bitmap_a19va = mkBitmap platform_a19v8 liveness_a19v7; } in
+ letrec {
+ small_bitmap_a19vb :: StgWord
+ [LclId]
+ small_bitmap_a19vb
+ = let {
+ ds_d19Qy :: [StgWord]
+ [LclId]
+ ds_d19Qy = bitmap_a19va } in
+ let {
+ fail_d19QU :: ghc-prim-0.6.1:GHC.Prim.Void# -> StgWord
+ [LclId]
+ fail_d19QU
+ = \ (ds_d19QV [OS=OneShot] :: ghc-prim-0.6.1:GHC.Prim.Void#) ->
+ panic
+ @ StgWord
+ (ghc-prim-0.6.1:GHC.CString.unpackCString# "mkLiveness"#) } in
+ case ds_d19Qy of wild_00 {
+ [] -> toStgWord platform_a19v8 0;
+ : b_a19ve ds_d19QT ->
+ case ds_d19QT of wild_00 {
+ __DEFAULT -> fail_d19QU ghc-prim-0.6.1:GHC.Prim.void#;
+ [] -> b_a19ve
+ }
+ }; } in
+ letrec {
+ bitmap_word_a19vc :: StgWord
+ [LclId]
+ bitmap_word_a19vc
+ = .|.
+ @ StgWord
+ $dBits_a19FZ
+ (toStgWord
+ platform_a19v8
+ (fromIntegral
+ @ Int @ Integer $dIntegral_a19G2 $dNum_a19G3 n_bits_a19v9))
+ (shiftL
+ @ StgWord
+ $dBits_a19G5
+ small_bitmap_a19vb
+ (pc_BITMAP_BITS_SHIFT (platformConstants platform_a19v8))); } in
+ letrec {
+ lits_a19vd :: [CmmLit]
+ [LclId]
+ lits_a19vd
+ = ghc-prim-0.6.1:GHC.Types.:
+ @ CmmLit
+ (mkWordCLit
+ platform_a19v8
+ (fromIntegral
+ @ Int @ Integer $dIntegral_a19Gd $dNum_a19Ge n_bits_a19v9))
+ (map
+ @ StgWord
+ @ CmmLit
+ (mkStgWordCLit platform_a19v8)
+ bitmap_a19va); } in
+ let {
+ fail_d19Qw
+ :: ghc-prim-0.6.1:GHC.Prim.Void# -> UniqSM (CmmLit, [RawCmmDecl])
+ [LclId]
+ fail_d19Qw
+ = \ (ds_d19Qx [OS=OneShot] :: ghc-prim-0.6.1:GHC.Prim.Void#) ->
+ return
+ @ UniqSM
+ $dMonad_a19GH
+ @ (CmmLit, [RawCmmDecl])
+ (mkStgWordCLit platform_a19v8 bitmap_word_a19vc,
+ ghc-prim-0.6.1:GHC.Types.[] @ RawCmmDecl) } in
+ case > @ Int
+ $dOrd_a19Gk
+ n_bits_a19v9
+ (mAX_SMALL_BITMAP_SIZE platform_a19v8)
+ of wild_00 {
+ False -> fail_d19Qw ghc-prim-0.6.1:GHC.Prim.void#;
+ True ->
+ >>=
+ @ UniqSM
+ $dMonad_a19Go
+ @ GHC.Types.Unique.Unique
+ @ (CmmLit, [RawCmmDecl])
+ (getUniqueM @ UniqSM $dMonadUnique_a19Gs)
+ (\ (uniq_a19vf :: GHC.Types.Unique.Unique) ->
+ letrec {
+ bitmap_lbl_a19vg :: CLabel
+ [LclId]
+ bitmap_lbl_a19vg = mkBitmapLabel uniq_a19vf; } in
+ return
+ @ UniqSM
+ $dMonad_a19Gy
+ @ (CmmLit,
+ [GenCmmDecl
+ (GenCmmStatics 'True)
+ (GHC.Cmm.Dataflow.Label.LabelMap RawCmmStatics)
+ CmmGraph])
+ (GHC.Cmm.Expr.CmmLabel bitmap_lbl_a19vg,
+ GHC.Base.build
+ @ (GenCmmDecl
+ (GenCmmStatics 'True)
+ (GHC.Cmm.Dataflow.Label.LabelMap RawCmmStatics)
+ CmmGraph)
+ (\ (@ a_d19Qn)
+ (c_d19Qo
+ :: GenCmmDecl
+ (GenCmmStatics 'True)
+ (GHC.Cmm.Dataflow.Label.LabelMap RawCmmStatics)
+ CmmGraph
+ -> a_d19Qn -> a_d19Qn)
+ (n_d19Qp :: a_d19Qn) ->
+ c_d19Qo
+ (mkRODataLits
+ @ 'True
+ @ (GHC.Cmm.Dataflow.Label.LabelMap RawCmmStatics)
+ @ CmmGraph
+ bitmap_lbl_a19vg
+ lits_a19vd)
+ n_d19Qp)))
+ }
+
+-- RHS size: {terms: 34, types: 12, coercions: 0, joins: 0/2}
+makeRelativeRefTo :: Platform -> CLabel -> CmmLit -> CmmLit
+[LclIdX]
+makeRelativeRefTo
+ = \ (platform_a19v0 :: Platform)
+ (info_lbl_a19v1 :: CLabel)
+ (lit_a19v2 :: CmmLit) ->
+ case platformTablesNextToCode platform_a19v0 of wild_00 {
+ False -> lit_a19v2;
+ True ->
+ let {
+ ds_d19QW :: CmmLit
+ [LclId]
+ ds_d19QW = lit_a19v2 } in
+ let {
+ fail_d19Rt :: ghc-prim-0.6.1:GHC.Prim.Void# -> CmmLit
+ [LclId]
+ fail_d19Rt
+ = \ (ds_d19Ru [OS=OneShot] :: ghc-prim-0.6.1:GHC.Prim.Void#) ->
+ lit_a19v2 } in
+ case ds_d19QW of wild_00 {
+ __DEFAULT -> fail_d19Rt ghc-prim-0.6.1:GHC.Prim.void#;
+ CmmLabel lbl_a19v3 ->
+ GHC.Cmm.Expr.CmmLabelDiffOff
+ lbl_a19v3
+ info_lbl_a19v1
+ (ghc-prim-0.6.1:GHC.Types.I# 0#)
+ (wordWidth platform_a19v0);
+ CmmLabelOff lbl_a19v4 off_a19v5 ->
+ GHC.Cmm.Expr.CmmLabelDiffOff
+ lbl_a19v4 info_lbl_a19v1 off_a19v5 (wordWidth platform_a19v0)
+ }
+ }
+
+-- RHS size: {terms: 9, types: 2, coercions: 0, joins: 0/0}
+inlineSRT :: Platform -> Bool
+[LclIdX]
+inlineSRT
+ = \ (platform_a19uZ :: Platform) ->
+ &&
+ (==
+ @ Arch
+ $dEq_a19GR
+ (platformArch platform_a19uZ)
+ GHC.Platform.ArchOS.ArchX86_64)
+ (platformTablesNextToCode platform_a19uZ)
+
+-- RHS size: {terms: 50, types: 35, coercions: 0, joins: 0/4}
+mkSRTLit
+ :: Platform -> CLabel -> Maybe CLabel -> ([CmmLit], CmmLit)
+[LclIdX]
+mkSRTLit
+ = \ (platform_a19uT :: Platform)
+ (info_lbl_a19uU :: CLabel)
+ (ds_d19Rv :: Maybe CLabel) ->
+ let {
+ platform_a19uW :: Platform
+ [LclId]
+ platform_a19uW = platform_a19uT } in
+ let {
+ platform_a19uX :: Platform
+ [LclId]
+ platform_a19uX = platform_a19uT } in
+ case ds_d19Rv of wild_00 {
+ Nothing ->
+ (ghc-prim-0.6.1:GHC.Types.[] @ CmmLit,
+ GHC.Cmm.Expr.$WCmmInt 0 (halfWordWidth platform_a19uW));
+ Just lbl_a19uV ->
+ let {
+ lbl_a19uY :: CLabel
+ [LclId]
+ lbl_a19uY = lbl_a19uV } in
+ let {
+ fail_d19RQ :: ghc-prim-0.6.1:GHC.Prim.Void# -> ([CmmLit], CmmLit)
+ [LclId]
+ fail_d19RQ
+ = \ (ds_d19RR [OS=OneShot] :: ghc-prim-0.6.1:GHC.Prim.Void#) ->
+ (GHC.Base.build
+ @ CmmLit
+ (\ (@ a_d19RC)
+ (c_d19RD :: CmmLit -> a_d19RC -> a_d19RC)
+ (n_d19RE :: a_d19RC) ->
+ c_d19RD (GHC.Cmm.Expr.CmmLabel lbl_a19uY) n_d19RE),
+ GHC.Cmm.Expr.$WCmmInt 1 (halfWordWidth platform_a19uX)) } in
+ case inlineSRT platform_a19uT of wild_00 {
+ False -> fail_d19RQ ghc-prim-0.6.1:GHC.Prim.void#;
+ True ->
+ (ghc-prim-0.6.1:GHC.Types.[] @ CmmLit,
+ GHC.Cmm.Expr.CmmLabelDiffOff
+ lbl_a19uV
+ info_lbl_a19uU
+ (ghc-prim-0.6.1:GHC.Types.I# 0#)
+ (halfWordWidth platform_a19uT))
+ }
+ }
+
+-- RHS size: {terms: 17, types: 7, coercions: 0, joins: 0/0}
+packIntsCLit :: Platform -> Int -> Int -> CmmLit
+[LclIdX]
+packIntsCLit
+ = \ (platform_a19uQ :: Platform)
+ (a_a19uR :: Int)
+ (b_a19uS :: Int) ->
+ packHalfWordsCLit
+ platform_a19uQ
+ (toStgHalfWord
+ platform_a19uQ
+ (fromIntegral
+ @ Int @ Integer $dIntegral_a19GY $dNum_a19GZ a_a19uR))
+ (toStgHalfWord
+ platform_a19uQ
+ (fromIntegral
+ @ Int @ Integer $dIntegral_a19H2 $dNum_a19H3 b_a19uS))
+
+-- RHS size: {terms: 408, types: 606, coercions: 0, joins: 0/41}
+mkInfoTableContents
+ :: DynFlags
+ -> CmmInfoTable
+ -> Maybe Int
+ -> UniqSM ([RawCmmDecl], InfoTableContents)
+[LclIdX]
+mkInfoTableContents
+ = \ (dflags_a19tU :: DynFlags)
+ (info_a19tV :: CmmInfoTable)
+ (mb_rts_tag_a19u0 :: Maybe Int) ->
+ let {
+ fail_d19WA
+ :: ghc-prim-0.6.1:GHC.Prim.Void#
+ -> UniqSM ([RawCmmDecl], InfoTableContents)
+ [LclId]
+ fail_d19WA
+ = \ (ds_d19WB [OS=OneShot] :: ghc-prim-0.6.1:GHC.Prim.Void#) ->
+ panic
+ @ (UniqSM ([RawCmmDecl], InfoTableContents))
+ (ghc-prim-0.6.1:GHC.CString.unpackCString#
+ "mkInfoTableContents"#) } in
+ case info_a19tV of wild_00
+ { CmmInfoTable ds_d19Wv ds_d19Ww ds_d19Wx ds_d19Wy ds_d19Wz ->
+ let {
+ info_lbl_a19tW :: CLabel
+ [LclId]
+ info_lbl_a19tW = ds_d19Wv } in
+ let {
+ smrep_a19tX :: SMRep
+ [LclId]
+ smrep_a19tX = ds_d19Ww } in
+ let {
+ prof_a19tY :: ProfilingInfo
+ [LclId]
+ prof_a19tY = ds_d19Wx } in
+ let {
+ srt_a19tZ :: Maybe CLabel
+ [LclId]
+ srt_a19tZ = ds_d19Wy } in
+ letrec {
+ platform_a19u1 :: Platform
+ [LclId]
+ platform_a19u1 = targetPlatform dflags_a19tU; } in
+ letrec {
+ mk_pieces_a19u2
+ :: ClosureTypeInfo
+ -> [CmmLit]
+ -> UniqSM (Maybe CmmLit, Maybe CmmLit, [CmmLit], [RawCmmDecl])
+ [LclId]
+ mk_pieces_a19u2
+ = \ (ds_d19WG :: ClosureTypeInfo) (_no_srt_a19u5 :: [CmmLit]) ->
+ let {
+ other_a19uq :: ClosureTypeInfo
+ [LclId]
+ other_a19uq = ds_d19WG } in
+ let {
+ fail_d19XP
+ :: ghc-prim-0.6.1:GHC.Prim.Void#
+ -> UniqSM (Maybe CmmLit, Maybe CmmLit, [CmmLit], [RawCmmDecl])
+ [LclId]
+ fail_d19XP
+ = \ (ds_d19XQ [OS=OneShot] :: ghc-prim-0.6.1:GHC.Prim.Void#) ->
+ pprPanic
+ @ (UniqSM (Maybe CmmLit, Maybe CmmLit, [CmmLit], [RawCmmDecl]))
+ $dIP_a19J3
+ (ghc-prim-0.6.1:GHC.CString.unpackCString# "mk_pieces"#)
+ (ppr @ ClosureTypeInfo $dOutputable_a19J5 other_a19uq) } in
+ case ds_d19WG of wild_00 {
+ __DEFAULT -> fail_d19XP ghc-prim-0.6.1:GHC.Prim.void#;
+ Constr con_tag_a19u3 con_descr_a19u4 ->
+ >>=
+ @ UniqSM
+ $dMonad_a19Hl
+ @ (CmmLit,
+ GenCmmDecl
+ RawCmmStatics
+ (GHC.Cmm.Dataflow.Label.LabelMap RawCmmStatics)
+ CmmGraph)
+ @ (Maybe CmmLit, Maybe CmmLit, [CmmLit], [RawCmmDecl])
+ (newStringLit
+ @ (GHC.Cmm.Dataflow.Label.LabelMap RawCmmStatics)
+ @ CmmGraph
+ con_descr_a19u4)
+ (\ (ds_d19WP
+ :: (CmmLit,
+ GenCmmDecl
+ RawCmmStatics
+ (GHC.Cmm.Dataflow.Label.LabelMap RawCmmStatics)
+ CmmGraph)) ->
+ case ds_d19WP of wild_00 { (descr_lit_a19u6, decl_a19u7) ->
+ return
+ @ UniqSM
+ $dMonad_a19Hr
+ @ (Maybe CmmLit, Maybe CmmLit, [CmmLit],
+ [GenCmmDecl
+ RawCmmStatics
+ (GHC.Cmm.Dataflow.Label.LabelMap RawCmmStatics)
+ CmmGraph])
+ (GHC.Maybe.Just
+ @ CmmLit
+ (GHC.Cmm.Expr.$WCmmInt
+ (fromIntegral
+ @ GHC.Types.Basic.ConTagZ
+ @ Integer
+ $dIntegral_a19HA
+ $dNum_a19HB
+ con_tag_a19u3)
+ (halfWordWidth platform_a19u1)),
+ GHC.Maybe.Nothing @ CmmLit,
+ GHC.Base.build
+ @ CmmLit
+ (\ (@ a_d19WM)
+ (c_d19WN :: CmmLit -> a_d19WM -> a_d19WM)
+ (n_d19WO :: a_d19WM) ->
+ c_d19WN descr_lit_a19u6 n_d19WO),
+ GHC.Base.build
+ @ (GenCmmDecl
+ RawCmmStatics
+ (GHC.Cmm.Dataflow.Label.LabelMap RawCmmStatics)
+ CmmGraph)
+ (\ (@ a_d19WJ)
+ (c_d19WK
+ :: GenCmmDecl
+ RawCmmStatics
+ (GHC.Cmm.Dataflow.Label.LabelMap RawCmmStatics)
+ CmmGraph
+ -> a_d19WJ -> a_d19WJ)
+ (n_d19WL :: a_d19WJ) ->
+ c_d19WK decl_a19u7 n_d19WL))
+ });
+ Fun arity_a19ub ds_d19XO ->
+ let {
+ arity_a19uf :: GHC.Runtime.Heap.Layout.FunArity
+ [LclId]
+ arity_a19uf = arity_a19ub } in
+ case ds_d19XO of wild_00 {
+ __DEFAULT -> fail_d19XP ghc-prim-0.6.1:GHC.Prim.void#;
+ ArgSpec fun_type_a19uc ->
+ let {
+ srt_label_a19ud :: [CmmLit]
+ [LclId]
+ srt_label_a19ud = _no_srt_a19u5 } in
+ letrec {
+ extra_bits_a19ue :: [CmmLit]
+ [LclId]
+ extra_bits_a19ue
+ = ghc-prim-0.6.1:GHC.Types.:
+ @ CmmLit
+ (packIntsCLit platform_a19u1 fun_type_a19uc arity_a19ub)
+ srt_label_a19ud; } in
+ return
+ @ UniqSM
+ $dMonad_a19Ia
+ @ (Maybe CmmLit, Maybe CmmLit, [CmmLit], [RawCmmDecl])
+ (GHC.Maybe.Nothing @ CmmLit, GHC.Maybe.Nothing @ CmmLit,
+ extra_bits_a19ue, ghc-prim-0.6.1:GHC.Types.[] @ RawCmmDecl);
+ ArgGen arg_bits_a19ug ->
+ let {
+ srt_label_a19uh :: [CmmLit]
+ [LclId]
+ srt_label_a19uh = _no_srt_a19u5 } in
+ letrec {
+ srt_lit_a19uj :: CmmLit
+ [LclId]
+ srt_lit_a19uj
+ = let {
+ ds_d19XR :: [CmmLit]
+ [LclId]
+ ds_d19XR = srt_label_a19uh } in
+ case ds_d19XR of wild_00 {
+ [] -> mkIntCLit platform_a19u1 (ghc-prim-0.6.1:GHC.Types.I# 0#);
+ : lit_a19uk _rest_a19ul ->
+ case &&
+ debugIsOn
+ (not (null @ [] $dFoldable_a19Iq @ CmmLit _rest_a19ul))
+ of wild_00 {
+ False -> lit_a19uk;
+ True ->
+ assertPanic
+ @ CmmLit
+ (ghc-prim-0.6.1:GHC.CString.unpackCString#
+ "E:\\\\ghc_inferTags\\\\compiler\\\\GHC\\\\Cmm\\\\Info.hs"#)
+ (ghc-prim-0.6.1:GHC.Types.I# 262#)
+ }
+ }; } in
+ letrec {
+ slow_entry_a19ui :: CmmLit
+ [LclId]
+ slow_entry_a19ui
+ = GHC.Cmm.Expr.CmmLabel
+ (toSlowEntryLbl platform_a19u1 info_lbl_a19tW); } in
+ >>=
+ @ UniqSM
+ $dMonad_a19IB
+ @ (CmmLit, [RawCmmDecl])
+ @ (Maybe CmmLit, Maybe CmmLit, [CmmLit], [RawCmmDecl])
+ (mkLivenessBits dflags_a19tU arg_bits_a19ug)
+ (\ (ds_d19Xp :: (CmmLit, [RawCmmDecl])) ->
+ case ds_d19Xp of wild_00
+ { (liveness_lit_a19um, liveness_data_a19un) ->
+ letrec {
+ fun_type_a19uo :: Int
+ [LclId]
+ fun_type_a19uo
+ = let {
+ fail_d19Xn :: ghc-prim-0.6.1:GHC.Prim.Void# -> Int
+ [LclId]
+ fail_d19Xn
+ = \ (ds_d19Xo [OS=OneShot] :: ghc-prim-0.6.1:GHC.Prim.Void#) ->
+ aRG_GEN_BIG } in
+ case null @ [] $dFoldable_a19IJ @ RawCmmDecl liveness_data_a19un
+ of wild_00 {
+ False -> fail_d19Xn ghc-prim-0.6.1:GHC.Prim.void#;
+ True -> aRG_GEN
+ }; } in
+ letrec {
+ extra_bits_a19up :: [CmmLit]
+ [LclId]
+ extra_bits_a19up
+ = ++
+ @ CmmLit
+ (GHC.Base.build
+ @ CmmLit
+ (\ (@ a_d19X8)
+ (c_d19X9 :: CmmLit -> a_d19X8 -> a_d19X8)
+ (n_d19Xa :: a_d19X8) ->
+ c_d19X9
+ (packIntsCLit platform_a19u1 fun_type_a19uo arity_a19uf)
+ n_d19Xa))
+ (++
+ @ CmmLit
+ (case inlineSRT platform_a19u1 of wild_00 {
+ False ->
+ GHC.Base.build
+ @ CmmLit
+ (\ (@ a_d19Xb)
+ (c_d19Xc :: CmmLit -> a_d19Xb -> a_d19Xb)
+ (n_d19Xd :: a_d19Xb) ->
+ c_d19Xc srt_lit_a19uj n_d19Xd);
+ True -> ghc-prim-0.6.1:GHC.Types.[] @ CmmLit
+ })
+ (GHC.Base.build
+ @ CmmLit
+ (\ (@ a_d19Xe)
+ (c_d19Xf :: CmmLit -> a_d19Xe -> a_d19Xe)
+ (n_d19Xg :: a_d19Xe) ->
+ c_d19Xf
+ liveness_lit_a19um
+ (c_d19Xf slow_entry_a19ui n_d19Xg)))); } in
+ return
+ @ UniqSM
+ $dMonad_a19IU
+ @ (Maybe CmmLit, Maybe CmmLit, [CmmLit], [RawCmmDecl])
+ (GHC.Maybe.Nothing @ CmmLit, GHC.Maybe.Nothing @ CmmLit,
+ extra_bits_a19up, liveness_data_a19un)
+ })
+ };
+ Thunk ->
+ let {
+ srt_label_a19u8 :: [CmmLit]
+ [LclId]
+ srt_label_a19u8 = _no_srt_a19u5 } in
+ return
+ @ UniqSM
+ $dMonad_a19HG
+ @ (Maybe CmmLit, Maybe CmmLit, [CmmLit], [RawCmmDecl])
+ (GHC.Maybe.Nothing @ CmmLit, GHC.Maybe.Nothing @ CmmLit,
+ srt_label_a19u8, ghc-prim-0.6.1:GHC.Types.[] @ RawCmmDecl);
+ ThunkSelector offset_a19u9 ->
+ let {
+ _no_srt_a19ua :: [CmmLit]
+ [LclId]
+ _no_srt_a19ua = _no_srt_a19u5 } in
+ return
+ @ UniqSM
+ $dMonad_a19HQ
+ @ (Maybe CmmLit, Maybe CmmLit, [CmmLit], [RawCmmDecl])
+ (GHC.Maybe.Just
+ @ CmmLit (GHC.Cmm.Expr.$WCmmInt 0 (halfWordWidth platform_a19u1)),
+ GHC.Maybe.Just
+ @ CmmLit
+ (mkWordCLit
+ platform_a19u1
+ (fromIntegral
+ @ GHC.Runtime.Heap.Layout.SelectorOffset
+ @ Integer
+ $dIntegral_a19I0
+ $dNum_a19I1
+ offset_a19u9)),
+ ghc-prim-0.6.1:GHC.Types.[] @ CmmLit,
+ ghc-prim-0.6.1:GHC.Types.[] @ RawCmmDecl)
+ }; } in
+ let {
+ fail_d19WE
+ :: ghc-prim-0.6.1:GHC.Prim.Void#
+ -> UniqSM ([RawCmmDecl], InfoTableContents)
+ [LclId]
+ fail_d19WE
+ = \ (ds_d19WF [OS=OneShot] :: ghc-prim-0.6.1:GHC.Prim.Void#) ->
+ let {
+ fail_d19WC
+ :: ghc-prim-0.6.1:GHC.Prim.Void#
+ -> UniqSM ([RawCmmDecl], InfoTableContents)
+ [LclId]
+ fail_d19WC
+ = \ (ds_d19WD [OS=OneShot] :: ghc-prim-0.6.1:GHC.Prim.Void#) ->
+ let {
+ ds_d19Uz :: SMRep
+ [LclId]
+ ds_d19Uz = smrep_a19tX } in
+ case ds_d19Uz of wild_00 {
+ __DEFAULT -> fail_d19WA ghc-prim-0.6.1:GHC.Prim.void#;
+ HeapRep ds_d19VG ptrs_a19uD nonptrs_a19uE closure_type_a19uF ->
+ letrec {
+ layout_a19uG :: CmmLit
+ [LclId]
+ layout_a19uG
+ = packIntsCLit platform_a19u1 ptrs_a19uD nonptrs_a19uE; } in
+ >>=
+ @ UniqSM
+ $dMonad_a19K9
+ @ ((CmmLit, CmmLit), [RawCmmDecl])
+ @ ([RawCmmDecl], InfoTableContents)
+ (mkProfLits platform_a19u1 prof_a19tY)
+ (\ (ds_d19UR :: ((CmmLit, CmmLit), [RawCmmDecl])) ->
+ case ds_d19UR of wild_00 { (prof_lits_a19uH, prof_data_a19uI) ->
+ letrec {
+ ds_d19UI :: ([CmmLit], CmmLit)
+ [LclId]
+ ds_d19UI = mkSRTLit platform_a19u1 info_lbl_a19tW srt_a19tZ;
+ srt_label_a19uJ :: [CmmLit]
+ [LclId]
+ srt_label_a19uJ
+ = case ds_d19UI of wild_00
+ { (srt_label_a19uJ, srt_bitmap_a19uK) ->
+ srt_label_a19uJ
+ };
+ srt_bitmap_a19uK :: CmmLit
+ [LclId]
+ srt_bitmap_a19uK
+ = case ds_d19UI of wild_00
+ { (srt_label_a19uJ, srt_bitmap_a19uK) ->
+ srt_bitmap_a19uK
+ }; } in
+ >>=
+ @ UniqSM
+ $dMonad_a19Km
+ @ (Maybe CmmLit, Maybe CmmLit, [CmmLit], [RawCmmDecl])
+ @ ([RawCmmDecl], InfoTableContents)
+ (mk_pieces_a19u2 closure_type_a19uF srt_label_a19uJ)
+ (\ (ds_d19UD
+ :: (Maybe CmmLit, Maybe CmmLit, [CmmLit], [RawCmmDecl])) ->
+ case ds_d19UD of wild_00
+ { (mb_srt_field_a19uL, mb_layout_a19uM, extra_bits_a19uN,
+ ct_data_a19uO) ->
+ letrec {
+ std_info_a19uP :: [CmmLit]
+ [LclId]
+ std_info_a19uP
+ = mkStdInfoTable
+ dflags_a19tU
+ prof_lits_a19uH
+ (orElse
+ @ Int mb_rts_tag_a19u0 (rtsClosureType smrep_a19tX))
+ (orElse @ CmmLit mb_srt_field_a19uL srt_bitmap_a19uK)
+ (orElse @ CmmLit mb_layout_a19uM layout_a19uG); } in
+ return
+ @ UniqSM
+ $dMonad_a19Kx
+ @ ([RawCmmDecl], ([CmmLit], [CmmLit]))
+ (++ @ RawCmmDecl prof_data_a19uI ct_data_a19uO,
+ (std_info_a19uP, extra_bits_a19uN))
+ })
+ })
+ } } in
+ let {
+ ds_d19T0 :: SMRep
+ [LclId]
+ ds_d19T0 = smrep_a19tX } in
+ case ds_d19T0 of wild_00 {
+ __DEFAULT -> fail_d19WC ghc-prim-0.6.1:GHC.Prim.void#;
+ StackRep frame_a19ut ->
+ >>=
+ @ UniqSM
+ $dMonad_a19Jo
+ @ ((CmmLit, CmmLit), [RawCmmDecl])
+ @ ([RawCmmDecl], InfoTableContents)
+ (mkProfLits platform_a19u1 prof_a19tY)
+ (\ (ds_d19TE :: ((CmmLit, CmmLit), [RawCmmDecl])) ->
+ case ds_d19TE of wild_00 { (prof_lits_a19uu, prof_data_a19uv) ->
+ letrec {
+ ds_d19Tv :: ([CmmLit], CmmLit)
+ [LclId]
+ ds_d19Tv = mkSRTLit platform_a19u1 info_lbl_a19tW srt_a19tZ;
+ srt_label_a19uw :: [CmmLit]
+ [LclId]
+ srt_label_a19uw
+ = case ds_d19Tv of wild_00 { (srt_label_a19uw, srt_bitmap_a19ux) ->
+ srt_label_a19uw
+ };
+ srt_bitmap_a19ux :: CmmLit
+ [LclId]
+ srt_bitmap_a19ux
+ = case ds_d19Tv of wild_00 { (srt_label_a19uw, srt_bitmap_a19ux) ->
+ srt_bitmap_a19ux
+ }; } in
+ >>=
+ @ UniqSM
+ $dMonad_a19JB
+ @ (CmmLit, [RawCmmDecl])
+ @ ([RawCmmDecl], InfoTableContents)
+ (mkLivenessBits dflags_a19tU frame_a19ut)
+ (\ (ds_d19Tq :: (CmmLit, [RawCmmDecl])) ->
+ case ds_d19Tq of wild_00
+ { (liveness_lit_a19uy, liveness_data_a19uz) ->
+ letrec {
+ rts_tag_a19uB :: Int
+ [LclId]
+ rts_tag_a19uB
+ = let {
+ fail_d19To :: ghc-prim-0.6.1:GHC.Prim.Void# -> Int
+ [LclId]
+ fail_d19To
+ = \ (ds_d19Tp [OS=OneShot]
+ :: ghc-prim-0.6.1:GHC.Prim.Void#) ->
+ let {
+ fail_d19Tm :: ghc-prim-0.6.1:GHC.Prim.Void# -> Int
+ [LclId]
+ fail_d19Tm
+ = \ (ds_d19Tn [OS=OneShot]
+ :: ghc-prim-0.6.1:GHC.Prim.Void#) ->
+ rET_BIG } in
+ case null
+ @ []
+ $dFoldable_a19JL
+ @ RawCmmDecl
+ liveness_data_a19uz
+ of wild_00 {
+ False -> fail_d19Tm ghc-prim-0.6.1:GHC.Prim.void#;
+ True -> rET_SMALL
+ } } in
+ let {
+ ds_d19T3 :: Maybe Int
+ [LclId]
+ ds_d19T3 = mb_rts_tag_a19u0 } in
+ case ds_d19T3 of wild_00 {
+ __DEFAULT -> fail_d19To ghc-prim-0.6.1:GHC.Prim.void#;
+ Just tag_a19uC -> tag_a19uC
+ }; } in
+ letrec {
+ std_info_a19uA :: [CmmLit]
+ [LclId]
+ std_info_a19uA
+ = mkStdInfoTable
+ dflags_a19tU
+ prof_lits_a19uu
+ rts_tag_a19uB
+ srt_bitmap_a19ux
+ liveness_lit_a19uy; } in
+ return
+ @ UniqSM
+ $dMonad_a19JT
+ @ ([RawCmmDecl], ([CmmLit], [CmmLit]))
+ (++ @ RawCmmDecl prof_data_a19uv liveness_data_a19uz,
+ (std_info_a19uA, srt_label_a19uw))
+ })
+ })
+ } } in
+ let {
+ ds_d19RV :: SMRep
+ [LclId]
+ ds_d19RV = smrep_a19tX } in
+ case ds_d19RV of wild_00 {
+ __DEFAULT -> fail_d19WE ghc-prim-0.6.1:GHC.Prim.void#;
+ RTSRep rts_tag_a19ur rep_a19us ->
+ mkInfoTableContents
+ dflags_a19tU
+ (let {
+ ds_d19RY :: SMRep
+ [LclId]
+ ds_d19RY = rep_a19us } in
+ let {
+ ds_d19S4 :: CmmInfoTable
+ [LclId]
+ ds_d19S4 = info_a19tV } in
+ case ds_d19S4 of wild_00
+ { CmmInfoTable ds_d19RZ ds_d19S0 ds_d19S1 ds_d19S2 ds_d19S3 ->
+ GHC.Cmm.CmmInfoTable ds_d19RZ ds_d19RY ds_d19S1 ds_d19S2 ds_d19S3
+ })
+ (GHC.Maybe.Just @ Int rts_tag_a19ur)
+ }
+ }
+
+-- RHS size: {terms: 196, types: 354, coercions: 12, joins: 0/12}
+mkInfoTable :: DynFlags -> CmmDeclSRTs -> UniqSM [RawCmmDecl]
+[LclIdX]
+mkInfoTable
+ = \ (ds_d19Y2 :: DynFlags)
+ (ds_d19Y3 :: GenCmmDecl RawCmmStatics CmmTopInfo CmmGraph) ->
+ let {
+ dflags_a19tv :: DynFlags
+ [LclId]
+ dflags_a19tv = ds_d19Y2 } in
+ let {
+ proc_a19tw :: CmmDeclSRTs
+ [LclId]
+ proc_a19tw = ds_d19Y3 } in
+ case ds_d19Y3 of wild_00 {
+ CmmProc infos_a19tx entry_lbl_a19ty live_a19tz blocks_a19tA ->
+ letrec {
+ platform_a19tB :: Platform
+ [LclId]
+ platform_a19tB = targetPlatform dflags_a19tv; } in
+ letrec {
+ do_one_info_a19tC
+ :: (GHC.Cmm.Dataflow.Label.Label, CmmInfoTable)
+ -> UniqSM
+ ([RawCmmDecl], (GHC.Cmm.Dataflow.Label.Label, GenCmmStatics 'True))
+ [LclId]
+ do_one_info_a19tC
+ = \ (ds_d19Zm :: (GHC.Cmm.Dataflow.Label.Label, CmmInfoTable)) ->
+ case ds_d19Zm of wild_00 { (lbl_a19tD, itbl_a19tE) ->
+ >>=
+ @ UniqSM
+ $dMonad_a19L1
+ @ ([RawCmmDecl], InfoTableContents)
+ @ ([RawCmmDecl],
+ (GHC.Cmm.Dataflow.Label.Label, GenCmmStatics 'True))
+ (mkInfoTableContents
+ dflags_a19tv itbl_a19tE (GHC.Maybe.Nothing @ Int))
+ (\ (ds_d19Zp :: ([RawCmmDecl], InfoTableContents)) ->
+ case ds_d19Zp of wild_00 { (top_decls_a19tF, ds_d19Zz) ->
+ case ds_d19Zz of wild_00 { (std_info_a19tG, extra_bits_a19tH) ->
+ letrec {
+ info_lbl_a19tI :: CLabel
+ [LclId]
+ info_lbl_a19tI = cit_lbl itbl_a19tE; } in
+ letrec {
+ rel_std_info_a19tJ :: [CmmLit]
+ [LclId]
+ rel_std_info_a19tJ
+ = map
+ @ CmmLit
+ @ CmmLit
+ (makeRelativeRefTo platform_a19tB info_lbl_a19tI)
+ std_info_a19tG; } in
+ letrec {
+ rel_extra_bits_a19tK :: [CmmLit]
+ [LclId]
+ rel_extra_bits_a19tK
+ = map
+ @ CmmLit
+ @ CmmLit
+ (makeRelativeRefTo platform_a19tB info_lbl_a19tI)
+ extra_bits_a19tH; } in
+ return
+ @ UniqSM
+ $dMonad_a19Ln
+ @ ([RawCmmDecl],
+ (GHC.Cmm.Dataflow.Label.Label, GenCmmStatics 'True))
+ (top_decls_a19tF,
+ (lbl_a19tD,
+ $ @ 'ghc-prim-0.6.1:GHC.Types.LiftedRep
+ @ [CmmStatic]
+ @ (GenCmmStatics 'True)
+ (GHC.Cmm.CmmStaticsRaw @ 'True info_lbl_a19tI)
+ ($ @ 'ghc-prim-0.6.1:GHC.Types.LiftedRep
+ @ [CmmLit]
+ @ [CmmStatic]
+ (map @ CmmLit @ CmmStatic GHC.Cmm.CmmStaticLit)
+ (++
+ @ CmmLit
+ (reverse @ CmmLit rel_extra_bits_a19tK)
+ rel_std_info_a19tJ))))
+ }
+ })
+ }; } in
+ let {
+ fail_d19Zk :: ghc-prim-0.6.1:GHC.Prim.Void# -> UniqSM [RawCmmDecl]
+ [LclId]
+ fail_d19Zk
+ = \ (ds_d19Zl [OS=OneShot] :: ghc-prim-0.6.1:GHC.Prim.Void#) ->
+ >>=
+ @ UniqSM
+ $dMonad_a19Mv
+ @ ([[RawCmmDecl]],
+ [(GHC.Cmm.Dataflow.Label.Label, GenCmmStatics 'True)])
+ @ [RawCmmDecl]
+ (fmap
+ @ UniqSM
+ $dFunctor_a19Mz
+ @ [([RawCmmDecl],
+ (GHC.Cmm.Dataflow.Label.Label, GenCmmStatics 'True))]
+ @ ([[RawCmmDecl]],
+ [(GHC.Cmm.Dataflow.Label.Label, GenCmmStatics 'True)])
+ (unzip
+ @ [RawCmmDecl]
+ @ (GHC.Cmm.Dataflow.Label.Label, GenCmmStatics 'True))
+ (mapM
+ @ []
+ $dTraversable_a19MF
+ @ UniqSM
+ @ (GHC.Cmm.Dataflow.Label.Label, CmmInfoTable)
+ @ ([RawCmmDecl],
+ (GHC.Cmm.Dataflow.Label.Label, GenCmmStatics 'True))
+ $dMonad_a19MJ
+ do_one_info_a19tC
+ ((mapToList
+ @ GHC.Cmm.Dataflow.Label.LabelMap
+ $dIsMap_a19MM
+ @ CmmInfoTable
+ (info_tbls infos_a19tx))
+ `cast` (([((,)
+ (Sub (GHC.Cmm.Dataflow.Label.D:R:KeyOfLabelMap[0]))
+ <CmmInfoTable>_R)_R])_R
+ :: [(KeyOf GHC.Cmm.Dataflow.Label.LabelMap, CmmInfoTable)]
+ ~R# [(GHC.Cmm.Dataflow.Label.Label, CmmInfoTable)]))))
+ (\ (ds_d19Z1
+ :: ([[RawCmmDecl]],
+ [(GHC.Cmm.Dataflow.Label.Label, GenCmmStatics 'True)])) ->
+ case ds_d19Z1 of wild_00 { (top_declss_a19tS, raw_infos_a19tT) ->
+ return
+ @ UniqSM
+ $dMonad_a19MQ
+ @ [RawCmmDecl]
+ (++
+ @ RawCmmDecl
+ (concat @ [] @ RawCmmDecl $dFoldable_a19MV top_declss_a19tS)
+ (GHC.Base.build
+ @ RawCmmDecl
+ (\ (@ a_d19YY)
+ (c_d19YZ :: RawCmmDecl -> a_d19YY -> a_d19YY)
+ (n_d19Z0 :: a_d19YY) ->
+ c_d19YZ
+ (GHC.Cmm.CmmProc
+ @ RawCmmStatics
+ @ (GHC.Cmm.Dataflow.Label.LabelMap (GenCmmStatics 'True))
+ @ CmmGraph
+ (mapFromList
+ @ GHC.Cmm.Dataflow.Label.LabelMap
+ $dIsMap_a19N1
+ @ (GenCmmStatics 'True)
+ (raw_infos_a19tT
+ `cast` (([((,)
+ (Sub (Sym (GHC.Cmm.Dataflow.Label.D:R:KeyOfLabelMap[0])))
+ <GenCmmStatics 'True>_R)_R])_R
+ :: [(GHC.Cmm.Dataflow.Label.Label,
+ GenCmmStatics 'True)]
+ ~R# [(KeyOf GHC.Cmm.Dataflow.Label.LabelMap,
+ GenCmmStatics 'True)])))
+ entry_lbl_a19ty
+ live_a19tz
+ blocks_a19tA)
+ n_d19Z0)))
+ }) } in
+ case not (platformTablesNextToCode (targetPlatform dflags_a19tv))
+ of wild_00 {
+ False -> fail_d19Zk ghc-prim-0.6.1:GHC.Prim.void#;
+ True ->
+ let {
+ ds_d19Yb :: Maybe CmmInfoTable
+ [LclId]
+ ds_d19Yb = topInfoTable @ RawCmmStatics @ CmmNode proc_a19tw } in
+ case ds_d19Yb of wild_00 {
+ Nothing ->
+ return
+ @ UniqSM
+ $dMonad_a19LK
+ @ [GenCmmDecl
+ RawCmmStatics
+ (GHC.Cmm.Dataflow.Label.LabelMap RawCmmStatics)
+ CmmGraph]
+ (GHC.Base.build
+ @ (GenCmmDecl
+ RawCmmStatics
+ (GHC.Cmm.Dataflow.Label.LabelMap RawCmmStatics)
+ CmmGraph)
+ (\ (@ a_d19Yf)
+ (c_d19Yg
+ :: GenCmmDecl
+ RawCmmStatics
+ (GHC.Cmm.Dataflow.Label.LabelMap RawCmmStatics)
+ CmmGraph
+ -> a_d19Yf -> a_d19Yf)
+ (n_d19Yh :: a_d19Yf) ->
+ c_d19Yg
+ (GHC.Cmm.CmmProc
+ @ RawCmmStatics
+ @ (GHC.Cmm.Dataflow.Label.LabelMap RawCmmStatics)
+ @ CmmGraph
+ (mapEmpty
+ @ GHC.Cmm.Dataflow.Label.LabelMap $dIsMap_a19LS @ RawCmmStatics)
+ entry_lbl_a19ty
+ live_a19tz
+ blocks_a19tA)
+ n_d19Yh));
+ Just info_a19tL ->
+ case info_a19tL of wild_00
+ { CmmInfoTable ds_d19YT ds_d19YU ds_d19YV ds_d19YW ds_d19YX ->
+ let {
+ info_lbl_a19tM :: CLabel
+ [LclId]
+ info_lbl_a19tM = ds_d19YT } in
+ >>=
+ @ UniqSM
+ $dMonad_a19LX
+ @ ([RawCmmDecl], InfoTableContents)
+ @ [RawCmmDecl]
+ (mkInfoTableContents
+ dflags_a19tv info_a19tL (GHC.Maybe.Nothing @ Int))
+ (\ (ds_d19Yu :: ([RawCmmDecl], InfoTableContents)) ->
+ case ds_d19Yu of wild_00 { (top_decls_a19tN, ds_d19YE) ->
+ case ds_d19YE of wild_00 { (std_info_a19tO, extra_bits_a19tP) ->
+ letrec {
+ rel_extra_bits_a19tR :: [CmmLit]
+ [LclId]
+ rel_extra_bits_a19tR
+ = map
+ @ CmmLit
+ @ CmmLit
+ (makeRelativeRefTo platform_a19tB info_lbl_a19tM)
+ extra_bits_a19tP; } in
+ letrec {
+ rel_std_info_a19tQ :: [CmmLit]
+ [LclId]
+ rel_std_info_a19tQ
+ = map
+ @ CmmLit
+ @ CmmLit
+ (makeRelativeRefTo platform_a19tB info_lbl_a19tM)
+ std_info_a19tO; } in
+ return
+ @ UniqSM
+ $dMonad_a19Me
+ @ [RawCmmDecl]
+ (++
+ @ RawCmmDecl
+ top_decls_a19tN
+ (GHC.Base.build
+ @ RawCmmDecl
+ (\ (@ a_d19Yr)
+ (c_d19Ys :: RawCmmDecl -> a_d19Yr -> a_d19Yr)
+ (n_d19Yt :: a_d19Yr) ->
+ c_d19Ys
+ (GHC.Cmm.CmmProc
+ @ RawCmmStatics
+ @ (GHC.Cmm.Dataflow.Label.LabelMap RawCmmStatics)
+ @ CmmGraph
+ (mapEmpty
+ @ GHC.Cmm.Dataflow.Label.LabelMap
+ $dIsMap_a19Ml
+ @ RawCmmStatics)
+ entry_lbl_a19ty
+ live_a19tz
+ blocks_a19tA)
+ (c_d19Ys
+ (mkRODataLits
+ @ 'True
+ @ (GHC.Cmm.Dataflow.Label.LabelMap RawCmmStatics)
+ @ CmmGraph
+ info_lbl_a19tM
+ (ghc-prim-0.6.1:GHC.Types.:
+ @ CmmLit
+ (GHC.Cmm.Expr.CmmLabel entry_lbl_a19ty)
+ (++ @ CmmLit rel_std_info_a19tQ rel_extra_bits_a19tR)))
+ n_d19Yt))))
+ }
+ })
+ }
+ }
+ };
+ CmmData sec_a19tt dat_a19tu ->
+ return
+ @ UniqSM
+ $dMonad_a19KH
+ @ [GenCmmDecl
+ RawCmmStatics
+ (GHC.Cmm.Dataflow.Label.LabelMap RawCmmStatics)
+ CmmGraph]
+ (GHC.Base.build
+ @ (GenCmmDecl
+ RawCmmStatics
+ (GHC.Cmm.Dataflow.Label.LabelMap RawCmmStatics)
+ CmmGraph)
+ (\ (@ a_d19Y6)
+ (c_d19Y7
+ :: GenCmmDecl
+ RawCmmStatics
+ (GHC.Cmm.Dataflow.Label.LabelMap RawCmmStatics)
+ CmmGraph
+ -> a_d19Y6 -> a_d19Y6)
+ (n_d19Y8 :: a_d19Y6) ->
+ c_d19Y7
+ (GHC.Cmm.CmmData
+ @ RawCmmStatics
+ @ (GHC.Cmm.Dataflow.Label.LabelMap RawCmmStatics)
+ @ CmmGraph
+ sec_a19tt
+ dat_a19tu)
+ n_d19Y8))
+ }
+
+-- RHS size: {terms: 91, types: 171, coercions: 0, joins: 0/13}
+cmmToRawCmm
+ :: forall a.
+ DynFlags
+ -> Stream IO CmmGroupSRTs a -> IO (Stream IO RawCmmGroup a)
+[LclIdX]
+cmmToRawCmm
+ = \ (@ a_a19N4) ->
+ let {
+ $dMonad_a19Ob :: Monad UniqSM
+ [LclId]
+ $dMonad_a19Ob = $dMonad_a19EH } in
+ let {
+ $dFoldable_a19O1 :: Foldable []
+ [LclId]
+ $dFoldable_a19O1 = $dFoldable_a19FF } in
+ let {
+ $dMonadIO_a19NX :: MonadIO IO
+ [LclId]
+ $dMonadIO_a19NX = Control.Monad.IO.Class.$fMonadIOIO } in
+ let {
+ $dMonad_a19NG :: Monad IO
+ [LclId]
+ $dMonad_a19NG = GHC.Base.$fMonadIO } in
+ let {
+ $dMonad_a19Oe :: Monad IO
+ [LclId]
+ $dMonad_a19Oe = $dMonad_a19NG } in
+ let {
+ $dMonad_a19Oj :: Monad IO
+ [LclId]
+ $dMonad_a19Oj = $dMonad_a19NG } in
+ let {
+ $dFunctor_a19Oo :: Functor (Stream IO [RawCmmDecl])
+ [LclId]
+ $dFunctor_a19Oo
+ = GHC.Data.Stream.$fFunctorStream
+ @ IO @ [RawCmmDecl] $dMonad_a19NG } in
+ let {
+ $dMonad_a19OB :: Monad IO
+ [LclId]
+ $dMonad_a19OB = $dMonad_a19NG } in
+ \ (dflags_a19tg :: DynFlags)
+ (cmms_a19th :: Stream IO CmmGroupSRTs a_a19N4) ->
+ letrec {
+ forceRes_a19ti
+ :: forall (t :: * -> *) a a. Foldable t => (a, t a) -> ()
+ [LclId]
+ forceRes_a19ti
+ = \ (@ (t_a19Ng :: * -> *))
+ (@ a_a19Ne)
+ (@ a_a19Nl)
+ ($dFoldable_a19Nr :: Foldable t_a19Ng) ->
+ let {
+ $dFoldable_a19Nh :: Foldable t_a19Ng
+ [LclId]
+ $dFoldable_a19Nh = $dFoldable_a19Nr } in
+ letrec {
+ forceRes_a19Np :: (a_a19Ne, t_a19Ng a_a19Nl) -> ()
+ [LclId]
+ forceRes_a19Np
+ = \ (ds_d19ZP :: (a_a19Ne, t_a19Ng a_a19Nl)) ->
+ case ds_d19ZP of wild_00 { (uniqs_a19tj, rawcmms_a19tk) ->
+ case uniqs_a19tj of uniqs_a19tj { __DEFAULT ->
+ foldr
+ @ t_a19Ng
+ $dFoldable_a19Nh
+ @ a_a19Nl
+ @ ()
+ (\ (decl_a19tl :: a_a19Nl) (r_a19tm :: ()) ->
+ case decl_a19tl of decl_a19tl { __DEFAULT -> r_a19tm })
+ ghc-prim-0.6.1:GHC.Tuple.()
+ rawcmms_a19tk
+ }
+ }; } in
+ forceRes_a19Np; } in
+ >>=
+ @ IO
+ $dMonad_a19NG
+ @ UniqSupply
+ @ (Stream IO RawCmmGroup a_a19N4)
+ (mkSplitUniqSupply (ghc-prim-0.6.1:GHC.Types.C# 'i'#))
+ (\ (uniqs_a19tn :: UniqSupply) ->
+ letrec {
+ do_one_a19to
+ :: UniqSupply -> [CmmDeclSRTs] -> IO (UniqSupply, [RawCmmDecl])
+ [LclId]
+ do_one_a19to
+ = \ (uniqs_a19tp :: UniqSupply) (cmm_a19tq :: [CmmDeclSRTs]) ->
+ $ @ 'ghc-prim-0.6.1:GHC.Types.LiftedRep
+ @ (IO (UniqSupply, [RawCmmDecl]))
+ @ (IO (UniqSupply, [RawCmmDecl]))
+ (withTimingSilent
+ @ IO
+ @ (UniqSupply, [RawCmmDecl])
+ $dMonadIO_a19NX
+ dflags_a19tg
+ (text
+ (ghc-prim-0.6.1:GHC.CString.unpackCString# "Cmm -> Raw Cmm"#))
+ (forceRes_a19ti @ [] @ UniqSupply @ RawCmmDecl $dFoldable_a19O1))
+ (let {
+ ds_d19ZE :: ([RawCmmDecl], UniqSupply)
+ [LclId]
+ ds_d19ZE
+ = $ @ 'ghc-prim-0.6.1:GHC.Types.LiftedRep
+ @ (UniqSM [RawCmmDecl])
+ @ ([RawCmmDecl], UniqSupply)
+ (initUs @ [RawCmmDecl] uniqs_a19tp)
+ (concatMapM
+ @ UniqSM
+ @ CmmDeclSRTs
+ @ RawCmmDecl
+ $dMonad_a19Ob
+ (mkInfoTable dflags_a19tg)
+ cmm_a19tq) } in
+ case ds_d19ZE of wild_00 { (b_a19tr, uniqs'_a19ts) ->
+ return
+ @ IO
+ $dMonad_a19Oe
+ @ (UniqSupply, [RawCmmDecl])
+ (uniqs'_a19ts, b_a19tr)
+ }); } in
+ return
+ @ IO
+ $dMonad_a19Oj
+ @ (Stream IO [RawCmmDecl] a_a19N4)
+ (<$>
+ @ (Stream IO [RawCmmDecl])
+ @ (UniqSupply, a_a19N4)
+ @ a_a19N4
+ $dFunctor_a19Oo
+ (snd @ UniqSupply @ a_a19N4)
+ (Stream.mapAccumL_
+ @ IO
+ @ UniqSupply
+ @ [CmmDeclSRTs]
+ @ [RawCmmDecl]
+ @ a_a19N4
+ $dMonad_a19OB
+ do_one_a19to
+ uniqs_a19tn
+ cmms_a19th)))
+
+-- RHS size: {terms: 8, types: 6, coercions: 0, joins: 0/0}
+mkEmptyContInfoTable :: CLabel -> CmmInfoTable
+[LclIdX]
+mkEmptyContInfoTable
+ = \ (info_lbl_a19tf :: CLabel) ->
+ GHC.Cmm.CmmInfoTable
+ info_lbl_a19tf
+ (mkStackRep (ghc-prim-0.6.1:GHC.Types.[] @ Bool))
+ GHC.Cmm.NoProfilingInfo
+ (GHC.Maybe.Nothing @ CLabel)
+ (GHC.Maybe.Nothing
+ @ (GHC.Types.Var.Id, GHC.Types.CostCentre.CostCentreStack))
+
+-- RHS size: {terms: 7, types: 5, coercions: 0, joins: 0/1}
+po_profile :: PtrOpts -> Profile
+[LclIdX[[RecSel]]]
+po_profile
+ = \ (ds_d19ZW :: PtrOpts) ->
+ case ds_d19ZW of wild_00 { PtrOpts ds_d19ZX ds_d19ZY ->
+ let {
+ po_profile_B1 :: Profile
+ [LclId]
+ po_profile_B1 = ds_d19ZX } in
+ po_profile_B1
+ }
+
+-- RHS size: {terms: 7, types: 5, coercions: 0, joins: 0/1}
+po_align_check :: PtrOpts -> Bool
+[LclIdX[[RecSel]]]
+po_align_check
+ = \ (ds_d19ZZ :: PtrOpts) ->
+ case ds_d19ZZ of wild_00 { PtrOpts ds_d1a00 ds_d1a01 ->
+ let {
+ po_align_check_B1 :: Bool
+ [LclId]
+ po_align_check_B1 = ds_d1a01 } in
+ po_align_check_B1
+ }
+end Rec }
+
+
+
+==================== Desugar (before optimization) ====================
+2020-11-24 12:44:28.6638895 UTC
+
+Result size of Desugar (before optimization)
+ = {terms: 1,698, types: 1,967, coercions: 23, joins: 0/116}
+
+Rec {
+-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
+$dNum_a5jPF :: Num ByteOff
+[LclId]
+$dNum_a5jPF = $dNum_a5jNA
+
+-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
+$dNum_a5jOH :: Num WordOff
+[LclId]
+$dNum_a5jOH = $dNum_a5jNA
+
+-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
+$dNum_a5jOD :: Num WordOff
+[LclId]
+$dNum_a5jOD = $dNum_a5jNA
+
+-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
+$dNum_a5jOB :: Num ByteOff
+[LclId]
+$dNum_a5jOB = $dNum_a5jNA
+
+-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
+$dNum_a5jOx :: Num ByteOff
+[LclId]
+$dNum_a5jOx = $dNum_a5jNA
+
+-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
+$dNum_a5jOq :: Num ByteOff
+[LclId]
+$dNum_a5jOq = $dNum_a5jNA
+
+-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
+$dNum_a5jOn :: Num Int
+[LclId]
+$dNum_a5jOn = $dNum_a5jNA
+
+-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
+$dNum_a5jOj :: Num Int
+[LclId]
+$dNum_a5jOj = $dNum_a5jNA
+
+-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
+$dNum_a5jOh :: Num ByteOff
+[LclId]
+$dNum_a5jOh = $dNum_a5jNA
+
+-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
+$dNum_a5jOf :: Num ByteOff
+[LclId]
+$dNum_a5jOf = $dNum_a5jNA
+
+-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
+$dNum_a5jOc :: Num Int
+[LclId]
+$dNum_a5jOc = $dNum_a5jNA
+
+-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
+$dNum_a5jO8 :: Num Int
+[LclId]
+$dNum_a5jO8 = $dNum_a5jNA
+
+-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
+$dNum_a5jO6 :: Num ByteOff
+[LclId]
+$dNum_a5jO6 = $dNum_a5jNA
+
+-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
+$dNum_a5jO3 :: Num ByteOff
+[LclId]
+$dNum_a5jO3 = $dNum_a5jNA
+
+-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
+$dNum_a5jO0 :: Num ByteOff
+[LclId]
+$dNum_a5jO0 = $dNum_a5jNA
+
+-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
+$dNum_a5jNX :: Num WordOff
+[LclId]
+$dNum_a5jNX = $dNum_a5jNA
+
+-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
+$dNum_a5jNU :: Num WordOff
+[LclId]
+$dNum_a5jNU = $dNum_a5jNA
+
+-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
+$dNum_a5jNQ :: Num WordOff
+[LclId]
+$dNum_a5jNQ = $dNum_a5jNA
+
+-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
+$dNum_a5jNN :: Num WordOff
+[LclId]
+$dNum_a5jNN = $dNum_a5jNA
+
+-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
+$dNum_a5jNJ :: Num WordOff
+[LclId]
+$dNum_a5jNJ = $dNum_a5jNA
+
+-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
+$dNum_a5jNG :: Num WordOff
+[LclId]
+$dNum_a5jNG = $dNum_a5jNA
+
+-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
+$dNum_a5jNC :: Num WordOff
+[LclId]
+$dNum_a5jNC = $dNum_a5jNA
+
+-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
+$dNum_a5jNA :: Num WordOff
+[LclId]
+$dNum_a5jNA = GHC.Num.$fNumInt
+
+-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
+$dIntegral_a5jTZ :: Integral GHC.Runtime.Heap.Layout.SelectorOffset
+[LclId]
+$dIntegral_a5jTZ = $dIntegral_a5jPb
+
+-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
+$dIntegral_a5jTz :: Integral GHC.Types.Basic.ConTagZ
+[LclId]
+$dIntegral_a5jTz = $dIntegral_a5jPb
+
+-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
+$dIntegral_a5jT1 :: Integral Int
+[LclId]
+$dIntegral_a5jT1 = $dIntegral_a5jPb
+
+-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
+$dIntegral_a5jSX :: Integral Int
+[LclId]
+$dIntegral_a5jSX = $dIntegral_a5jPb
+
+-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
+$dIntegral_a5jSc :: Integral Int
+[LclId]
+$dIntegral_a5jSc = $dIntegral_a5jPb
+
+-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
+$dIntegral_a5jS1 :: Integral Int
+[LclId]
+$dIntegral_a5jS1 = $dIntegral_a5jPb
+
+-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
+$dIntegral_a5jRr :: Integral Int
+[LclId]
+$dIntegral_a5jRr = $dIntegral_a5jPb
+
+-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
+$dIntegral_a5jPb :: Integral Int
+[LclId]
+$dIntegral_a5jPb = GHC.Real.$fIntegralInt
+
+-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
+$dNum_a5jU0 :: Num Integer
+[LclId]
+$dNum_a5jU0 = $dNum_a5jQh
+
+-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
+$dNum_a5jTA :: Num Integer
+[LclId]
+$dNum_a5jTA = $dNum_a5jQh
+
+-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
+$dNum_a5jT2 :: Num Integer
+[LclId]
+$dNum_a5jT2 = $dNum_a5jQh
+
+-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
+$dNum_a5jSY :: Num Integer
+[LclId]
+$dNum_a5jSY = $dNum_a5jQh
+
+-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
+$dNum_a5jSd :: Num Integer
+[LclId]
+$dNum_a5jSd = $dNum_a5jQh
+
+-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
+$dNum_a5jS2 :: Num Integer
+[LclId]
+$dNum_a5jS2 = $dNum_a5jQh
+
+-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
+$dNum_a5jRs :: Num Integer
+[LclId]
+$dNum_a5jRs = $dNum_a5jQh
+
+-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
+$dNum_a5jQl :: Num Integer
+[LclId]
+$dNum_a5jQl = $dNum_a5jQh
+
+-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
+$dNum_a5jQh :: Num Integer
+[LclId]
+$dNum_a5jQh = GHC.Num.$fNumInteger
+
+-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
+$dMonad_a5jYQ :: Monad UniqSM
+[LclId]
+$dMonad_a5jYQ = $dMonad_a5jQG
+
+-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
+$dMonad_a5jYJ :: Monad UniqSM
+[LclId]
+$dMonad_a5jYJ = $dMonad_a5jQG
+
+-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
+$dMonad_a5jYv :: Monad UniqSM
+[LclId]
+$dMonad_a5jYv = $dMonad_a5jQG
+
+-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
+$dMonad_a5jYe :: Monad UniqSM
+[LclId]
+$dMonad_a5jYe = $dMonad_a5jQG
+
+-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
+$dMonad_a5jXX :: Monad UniqSM
+[LclId]
+$dMonad_a5jXX = $dMonad_a5jQG
+
+-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
+$dMonad_a5jXK :: Monad UniqSM
+[LclId]
+$dMonad_a5jXK = $dMonad_a5jQG
+
+-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
+$dMonad_a5jXn :: Monad UniqSM
+[LclId]
+$dMonad_a5jXn = $dMonad_a5jQG
+
+-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
+$dMonad_a5jX1 :: Monad UniqSM
+[LclId]
+$dMonad_a5jX1 = $dMonad_a5jQG
+
+-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
+$dMonad_a5jWH :: Monad UniqSM
+[LclId]
+$dMonad_a5jWH = $dMonad_a5jQG
+
+-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
+$dMonad_a5jWx :: Monad UniqSM
+[LclId]
+$dMonad_a5jWx = $dMonad_a5jQG
+
+-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
+$dMonad_a5jWm :: Monad UniqSM
+[LclId]
+$dMonad_a5jWm = $dMonad_a5jQG
+
+-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
+$dMonad_a5jW9 :: Monad UniqSM
+[LclId]
+$dMonad_a5jW9 = $dMonad_a5jQG
+
+-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
+$dMonad_a5jVT :: Monad UniqSM
+[LclId]
+$dMonad_a5jVT = $dMonad_a5jQG
+
+-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
+$dMonad_a5jVB :: Monad UniqSM
+[LclId]
+$dMonad_a5jVB = $dMonad_a5jQG
+
+-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
+$dMonad_a5jVo :: Monad UniqSM
+[LclId]
+$dMonad_a5jVo = $dMonad_a5jQG
+
+-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
+$dMonad_a5jUU :: Monad UniqSM
+[LclId]
+$dMonad_a5jUU = $dMonad_a5jQG
+
+-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
+$dMonad_a5jUB :: Monad UniqSM
+[LclId]
+$dMonad_a5jUB = $dMonad_a5jQG
+
+-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
+$dMonad_a5jUa :: Monad UniqSM
+[LclId]
+$dMonad_a5jUa = $dMonad_a5jQG
+
+-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
+$dMonad_a5jTP :: Monad UniqSM
+[LclId]
+$dMonad_a5jTP = $dMonad_a5jQG
+
+-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
+$dMonad_a5jTF :: Monad UniqSM
+[LclId]
+$dMonad_a5jTF = $dMonad_a5jQG
+
+-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
+$dMonad_a5jTq :: Monad UniqSM
+[LclId]
+$dMonad_a5jTq = $dMonad_a5jQG
+
+-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
+$dMonad_a5jTk :: Monad UniqSM
+[LclId]
+$dMonad_a5jTk = $dMonad_a5jQG
+
+-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
+$dMonad_a5jSG :: Monad UniqSM
+[LclId]
+$dMonad_a5jSG = $dMonad_a5jQG
+
+-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
+$dMonad_a5jSx :: Monad UniqSM
+[LclId]
+$dMonad_a5jSx = $dMonad_a5jQG
+
+-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
+$dMonad_a5jSn :: Monad UniqSM
+[LclId]
+$dMonad_a5jSn = $dMonad_a5jQG
+
+-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
+$dMonad_a5jR4 :: Monad UniqSM
+[LclId]
+$dMonad_a5jR4 = $dMonad_a5jQG
+
+-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
+$dMonad_a5jQY :: Monad UniqSM
+[LclId]
+$dMonad_a5jQY = $dMonad_a5jQG
+
+-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
+$dMonad_a5jQQ :: Monad UniqSM
+[LclId]
+$dMonad_a5jQQ = $dMonad_a5jQG
+
+-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
+$dMonad_a5jQG :: Monad UniqSM
+[LclId]
+$dMonad_a5jQG = GHC.Types.Unique.Supply.$fMonadUniqSM
+
+-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
+$dFoldable_a5jYV :: Foldable []
+[LclId]
+$dFoldable_a5jYV = $dFoldable_a5jRE
+
+-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
+$dFoldable_a5jVL :: Foldable []
+[LclId]
+$dFoldable_a5jVL = $dFoldable_a5jRE
+
+-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
+$dFoldable_a5jUJ :: Foldable []
+[LclId]
+$dFoldable_a5jUJ = $dFoldable_a5jRE
+
+-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
+$dFoldable_a5jUq :: Foldable []
+[LclId]
+$dFoldable_a5jUq = $dFoldable_a5jRE
+
+-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
+$dFoldable_a5jRE :: Foldable []
+[LclId]
+$dFoldable_a5jRE = Data.Foldable.$fFoldable[]
+
+-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
+$dBits_a5jS4 :: Bits StgWord
+[LclId]
+$dBits_a5jS4 = $dBits_a5jRY
+
+-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
+$dBits_a5jRY :: Bits StgWord
+[LclId]
+$dBits_a5jRY = GHC.Runtime.Heap.Layout.$fBitsStgWord
+
+-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
+$dOrd_a5jSj :: Ord Int
+[LclId]
+$dOrd_a5jSj = ghc-prim-0.6.1:GHC.Classes.$fOrdInt
+
+-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
+$dMonadUnique_a5jSr :: MonadUnique UniqSM
+[LclId]
+$dMonadUnique_a5jSr = GHC.Types.Unique.Supply.$fMonadUniqueUniqSM
+
+-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
+$dEq_a5jSQ :: Eq Arch
+[LclId]
+$dEq_a5jSQ = GHC.Platform.ArchOS.$fEqArch
+
+-- RHS size: {terms: 20, types: 3, coercions: 7, joins: 0/0}
+$dIP_a5jV3 :: HasCallStack
+[LclId]
+$dIP_a5jV3
+ = (GHC.Stack.Types.pushCallStack
+ (ghc-prim-0.6.1:GHC.CString.unpackCString# "pprPanic"#,
+ GHC.Stack.Types.SrcLoc
+ (ghc-prim-0.6.1:GHC.CString.unpackCString# "ghc"#)
+ (ghc-prim-0.6.1:GHC.CString.unpackCString# "GHC.Cmm.Info"#)
+ (ghc-prim-0.6.1:GHC.CString.unpackCString#
+ "E:\\\\ghc_inferTags\\\\compiler\\\\GHC\\\\Cmm\\\\Info.hs"#)
+ (ghc-prim-0.6.1:GHC.Types.I# 264#)
+ (ghc-prim-0.6.1:GHC.Types.I# 25#)
+ (ghc-prim-0.6.1:GHC.Types.I# 264#)
+ (ghc-prim-0.6.1:GHC.Types.I# 57#))
+ ($dIP_a5k0J
+ `cast` (ghc-prim-0.6.1:GHC.Classes.N:IP[0]
+ <"callStack">_N <GHC.Stack.Types.CallStack>_N
+ :: (?callStack::GHC.Stack.Types.CallStack)
+ ~R# GHC.Stack.Types.CallStack)))
+ `cast` (Sym (ghc-prim-0.6.1:GHC.Classes.N:IP[0]
+ <"callStack">_N <GHC.Stack.Types.CallStack>_N)
+ :: GHC.Stack.Types.CallStack
+ ~R# (?callStack::GHC.Stack.Types.CallStack))
+
+-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
+$dOutputable_a5jV5 :: Outputable ClosureTypeInfo
+[LclId]
+$dOutputable_a5jV5
+ = GHC.Runtime.Heap.Layout.$fOutputableClosureTypeInfo
+
+-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
+$dIsMap_a5jZ1 :: IsMap GHC.Cmm.Dataflow.Label.LabelMap
+[LclId]
+$dIsMap_a5jZ1 = $dIsMap_a5jXS
+
+-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
+$dIsMap_a5jYM :: IsMap GHC.Cmm.Dataflow.Label.LabelMap
+[LclId]
+$dIsMap_a5jYM = $dIsMap_a5jXS
+
+-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
+$dIsMap_a5jYl :: IsMap GHC.Cmm.Dataflow.Label.LabelMap
+[LclId]
+$dIsMap_a5jYl = $dIsMap_a5jXS
+
+-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
+$dIsMap_a5jXS :: IsMap GHC.Cmm.Dataflow.Label.LabelMap
+[LclId]
+$dIsMap_a5jXS = GHC.Cmm.Dataflow.Label.$fIsMapLabelMap
+
+-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
+$dFunctor_a5jYz :: Functor UniqSM
+[LclId]
+$dFunctor_a5jYz = GHC.Types.Unique.Supply.$fFunctorUniqSM
+
+-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
+$dTraversable_a5jYF :: Traversable []
+[LclId]
+$dTraversable_a5jYF = Data.Traversable.$fTraversable[]
+
+-- RHS size: {terms: 1, types: 0, coercions: 4, joins: 0/0}
+$dIP_a5k0J :: HasCallStack
+[LclId]
+$dIP_a5k0J
+ = GHC.Stack.Types.emptyCallStack
+ `cast` (Sym (ghc-prim-0.6.1:GHC.Classes.N:IP[0]
+ <"callStack">_N <GHC.Stack.Types.CallStack>_N)
+ :: GHC.Stack.Types.CallStack
+ ~R# (?callStack::GHC.Stack.Types.CallStack))
+
+-- RHS size: {terms: 8, types: 0, coercions: 0, joins: 0/0}
+GHC.Cmm.Info.$tcPtrOpts :: ghc-prim-0.6.1:GHC.Types.TyCon
+[LclIdX]
+GHC.Cmm.Info.$tcPtrOpts
+ = ghc-prim-0.6.1:GHC.Types.TyCon
+ 10783844252980521413##
+ 13019815378033756893##
+ GHC.Cmm.Info.$trModule
+ (ghc-prim-0.6.1:GHC.Types.TrNameS "PtrOpts"#)
+ 0#
+ ghc-prim-0.6.1:GHC.Types.krep$*
+
+-- RHS size: {terms: 8, types: 0, coercions: 0, joins: 0/0}
+GHC.Cmm.Info.$tc'PtrOpts :: ghc-prim-0.6.1:GHC.Types.TyCon
+[LclIdX]
+GHC.Cmm.Info.$tc'PtrOpts
+ = ghc-prim-0.6.1:GHC.Types.TyCon
+ 11086577099826734001##
+ 4931096801432934088##
+ GHC.Cmm.Info.$trModule
+ (ghc-prim-0.6.1:GHC.Types.TrNameS "'PtrOpts"#)
+ 0#
+ $krep_a5k0L
+
+-- RHS size: {terms: 3, types: 0, coercions: 0, joins: 0/0}
+$krep_a5k0N [InlPrag=NOUSERINLINE[~]]
+ :: ghc-prim-0.6.1:GHC.Types.KindRep
+[LclId]
+$krep_a5k0N
+ = ghc-prim-0.6.1:GHC.Types.KindRepFun $krep_a5k0O $krep_a5k0P
+
+-- RHS size: {terms: 3, types: 0, coercions: 0, joins: 0/0}
+$krep_a5k0L [InlPrag=NOUSERINLINE[~]]
+ :: ghc-prim-0.6.1:GHC.Types.KindRep
+[LclId]
+$krep_a5k0L
+ = ghc-prim-0.6.1:GHC.Types.KindRepFun $krep_a5k0M $krep_a5k0N
+
+-- RHS size: {terms: 3, types: 1, coercions: 0, joins: 0/0}
+$krep_a5k0M [InlPrag=NOUSERINLINE[~]]
+ :: ghc-prim-0.6.1:GHC.Types.KindRep
+[LclId]
+$krep_a5k0M
+ = ghc-prim-0.6.1:GHC.Types.KindRepTyConApp
+ GHC.Platform.Profile.$tcProfile
+ (ghc-prim-0.6.1:GHC.Types.[] @ ghc-prim-0.6.1:GHC.Types.KindRep)
+
+-- RHS size: {terms: 3, types: 1, coercions: 0, joins: 0/0}
+$krep_a5k0O [InlPrag=NOUSERINLINE[~]]
+ :: ghc-prim-0.6.1:GHC.Types.KindRep
+[LclId]
+$krep_a5k0O
+ = ghc-prim-0.6.1:GHC.Types.KindRepTyConApp
+ ghc-prim-0.6.1:GHC.Types.$tcBool
+ (ghc-prim-0.6.1:GHC.Types.[] @ ghc-prim-0.6.1:GHC.Types.KindRep)
+
+-- RHS size: {terms: 3, types: 1, coercions: 0, joins: 0/0}
+$krep_a5k0P [InlPrag=NOUSERINLINE[~]]
+ :: ghc-prim-0.6.1:GHC.Types.KindRep
+[LclId]
+$krep_a5k0P
+ = ghc-prim-0.6.1:GHC.Types.KindRepTyConApp
+ GHC.Cmm.Info.$tcPtrOpts
+ (ghc-prim-0.6.1:GHC.Types.[] @ ghc-prim-0.6.1:GHC.Types.KindRep)
+
+-- RHS size: {terms: 5, types: 0, coercions: 0, joins: 0/0}
+GHC.Cmm.Info.$trModule :: ghc-prim-0.6.1:GHC.Types.Module
+[LclIdX]
+GHC.Cmm.Info.$trModule
+ = ghc-prim-0.6.1:GHC.Types.Module
+ (ghc-prim-0.6.1:GHC.Types.TrNameS "ghc"#)
+ (ghc-prim-0.6.1:GHC.Types.TrNameS "GHC.Cmm.Info"#)
+
+-- RHS size: {terms: 2, types: 0, coercions: 0, joins: 0/0}
+profInfoTableSizeW :: WordOff
+[LclIdX]
+profInfoTableSizeW = ghc-prim-0.6.1:GHC.Types.I# 2#
+
+-- RHS size: {terms: 2, types: 0, coercions: 0, joins: 0/0}
+fixedInfoTableSizeW :: WordOff
+[LclIdX]
+fixedInfoTableSizeW = ghc-prim-0.6.1:GHC.Types.I# 2#
+
+-- RHS size: {terms: 8, types: 2, coercions: 0, joins: 0/0}
+maxStdInfoTableSizeW :: WordOff
+[LclIdX]
+maxStdInfoTableSizeW
+ = + @ WordOff
+ $dNum_a5jNA
+ (+ @ WordOff
+ $dNum_a5jNC
+ (ghc-prim-0.6.1:GHC.Types.I# 1#)
+ fixedInfoTableSizeW)
+ profInfoTableSizeW
+
+-- RHS size: {terms: 5, types: 1, coercions: 0, joins: 0/0}
+maxRetInfoTableSizeW :: WordOff
+[LclIdX]
+maxRetInfoTableSizeW
+ = + @ WordOff
+ $dNum_a5jNJ
+ maxStdInfoTableSizeW
+ (ghc-prim-0.6.1:GHC.Types.I# 1#)
+
+-- RHS size: {terms: 12, types: 3, coercions: 0, joins: 0/0}
+stdInfoTableSizeW :: Profile -> WordOff
+[LclIdX]
+stdInfoTableSizeW
+ = \ (profile_a5jIr :: Profile) ->
+ + @ WordOff
+ $dNum_a5jNQ
+ fixedInfoTableSizeW
+ (case profileIsProfiling profile_a5jIr of wild_00 {
+ False -> ghc-prim-0.6.1:GHC.Types.I# 0#;
+ True -> profInfoTableSizeW
+ })
+
+-- RHS size: {terms: 7, types: 2, coercions: 0, joins: 0/0}
+stdInfoTableSizeB :: Profile -> ByteOff
+[LclIdX]
+stdInfoTableSizeB
+ = \ (profile_a5jIs :: Profile) ->
+ * @ WordOff
+ $dNum_a5jNX
+ (stdInfoTableSizeW profile_a5jIs)
+ (profileWordSizeInBytes profile_a5jIs)
+
+-- RHS size: {terms: 8, types: 2, coercions: 0, joins: 0/0}
+stdSrtBitmapOffset :: Profile -> ByteOff
+[LclIdX]
+stdSrtBitmapOffset
+ = \ (profile_a5jIt :: Profile) ->
+ - @ ByteOff
+ $dNum_a5jO0
+ (stdInfoTableSizeB profile_a5jIt)
+ (halfWordSize (profilePlatform profile_a5jIt))
+
+-- RHS size: {terms: 7, types: 2, coercions: 0, joins: 0/0}
+stdClosureTypeOffset :: Profile -> ByteOff
+[LclIdX]
+stdClosureTypeOffset
+ = \ (profile_a5jIu :: Profile) ->
+ - @ ByteOff
+ $dNum_a5jO3
+ (stdInfoTableSizeB profile_a5jIu)
+ (profileWordSizeInBytes profile_a5jIu)
+
+-- RHS size: {terms: 11, types: 3, coercions: 0, joins: 0/0}
+stdPtrsOffset :: Profile -> ByteOff
+[LclIdX]
+stdPtrsOffset
+ = \ (profile_a5jIv :: Profile) ->
+ - @ ByteOff
+ $dNum_a5jO6
+ (stdInfoTableSizeB profile_a5jIv)
+ (* @ Int
+ $dNum_a5jO8
+ (ghc-prim-0.6.1:GHC.Types.I# 2#)
+ (profileWordSizeInBytes profile_a5jIv))
+
+-- RHS size: {terms: 16, types: 4, coercions: 0, joins: 0/0}
+stdNonPtrsOffset :: Profile -> ByteOff
+[LclIdX]
+stdNonPtrsOffset
+ = \ (profile_a5jIw :: Profile) ->
+ + @ ByteOff
+ $dNum_a5jOf
+ (- @ ByteOff
+ $dNum_a5jOh
+ (stdInfoTableSizeB profile_a5jIw)
+ (* @ Int
+ $dNum_a5jOj
+ (ghc-prim-0.6.1:GHC.Types.I# 2#)
+ (profileWordSizeInBytes profile_a5jIw)))
+ (halfWordSize (profilePlatform profile_a5jIw))
+
+-- RHS size: {terms: 7, types: 2, coercions: 0, joins: 0/0}
+conInfoTableSizeB :: Profile -> Int
+[LclIdX]
+conInfoTableSizeB
+ = \ (profile_a5jIx :: Profile) ->
+ + @ ByteOff
+ $dNum_a5jOq
+ (stdInfoTableSizeB profile_a5jIx)
+ (profileWordSizeInBytes profile_a5jIx)
+
+-- RHS size: {terms: 35, types: 10, coercions: 0, joins: 0/2}
+funInfoTable :: Profile -> CmmExpr -> CmmExpr
+[LclIdX]
+funInfoTable
+ = \ (profile_a5jIf :: Profile) (info_ptr_a5jIg :: CmmExpr) ->
+ letrec {
+ platform_a5jIh :: Platform
+ [LclId]
+ platform_a5jIh = profilePlatform profile_a5jIf; } in
+ let {
+ fail_d5k0W :: ghc-prim-0.6.1:GHC.Prim.Void# -> CmmExpr
+ [LclId]
+ fail_d5k0W
+ = \ (ds_d5k0X [OS=OneShot] :: ghc-prim-0.6.1:GHC.Prim.Void#) ->
+ cmmOffsetW
+ platform_a5jIh
+ info_ptr_a5jIg
+ (+ @ WordOff
+ $dNum_a5jOD
+ (ghc-prim-0.6.1:GHC.Types.I# 1#)
+ (stdInfoTableSizeW profile_a5jIf)) } in
+ case platformTablesNextToCode platform_a5jIh of wild_00 {
+ False -> fail_d5k0W ghc-prim-0.6.1:GHC.Prim.void#;
+ True ->
+ cmmOffsetB
+ platform_a5jIh
+ info_ptr_a5jIg
+ (- @ ByteOff
+ $dNum_a5jOx
+ (negate @ ByteOff $dNum_a5jOB (stdInfoTableSizeB profile_a5jIf))
+ (pc_SIZEOF_StgFunInfoExtraRev (platformConstants platform_a5jIh)))
+ }
+
+-- RHS size: {terms: 58, types: 33, coercions: 0, joins: 0/9}
+funInfoArity :: Profile -> CmmExpr -> CmmExpr
+[LclIdX]
+funInfoArity
+ = \ (profile_a5jIi :: Profile) (iptr_a5jIj :: CmmExpr) ->
+ letrec {
+ fun_info_a5jIl :: CmmExpr
+ [LclId]
+ fun_info_a5jIl = funInfoTable profile_a5jIi iptr_a5jIj; } in
+ letrec {
+ platform_a5jIk :: Platform
+ [LclId]
+ platform_a5jIk = profilePlatform profile_a5jIi; } in
+ letrec {
+ tablesNextToCode_a5jIn :: Bool
+ [LclId]
+ tablesNextToCode_a5jIn
+ = platformTablesNextToCode platform_a5jIk; } in
+ letrec {
+ pc_a5jIq :: PlatformConstants
+ [LclId]
+ pc_a5jIq = platformConstants platform_a5jIk; } in
+ letrec {
+ ds_d5k14 :: (Int, Int)
+ [LclId]
+ ds_d5k14
+ = let {
+ fail_d5k0Y :: ghc-prim-0.6.1:GHC.Prim.Void# -> (Int, Int)
+ [LclId]
+ fail_d5k0Y
+ = \ (ds_d5k0Z [OS=OneShot] :: ghc-prim-0.6.1:GHC.Prim.Void#) ->
+ (pc_REP_StgFunInfoExtraFwd_arity pc_a5jIq,
+ pc_OFFSET_StgFunInfoExtraFwd_arity pc_a5jIq) } in
+ case tablesNextToCode_a5jIn of wild_00 {
+ False -> fail_d5k0Y ghc-prim-0.6.1:GHC.Prim.void#;
+ True ->
+ (pc_REP_StgFunInfoExtraRev_arity pc_a5jIq,
+ pc_OFFSET_StgFunInfoExtraRev_arity pc_a5jIq)
+ };
+ rep_bytes_a5jIo :: Int
+ [LclId]
+ rep_bytes_a5jIo
+ = case ds_d5k14 of wild_00 { (rep_bytes_a5jIo, offset_a5jIp) ->
+ rep_bytes_a5jIo
+ };
+ offset_a5jIp :: Int
+ [LclId]
+ offset_a5jIp
+ = case ds_d5k14 of wild_00 { (rep_bytes_a5jIo, offset_a5jIp) ->
+ offset_a5jIp
+ }; } in
+ letrec {
+ rep_a5jIm :: CmmType
+ [LclId]
+ rep_a5jIm = cmmBits (widthFromBytes rep_bytes_a5jIo); } in
+ cmmToWord
+ platform_a5jIk
+ (cmmLoadIndex
+ platform_a5jIk
+ rep_a5jIm
+ fun_info_a5jIl
+ (div @ Int $dIntegral_a5jPb offset_a5jIp rep_bytes_a5jIo))
+
+-- RHS size: {terms: 13, types: 3, coercions: 0, joins: 0/1}
+infoTableNonPtrs :: Profile -> CmmExpr -> CmmExpr
+[LclIdX]
+infoTableNonPtrs
+ = \ (profile_a5jIc :: Profile) (info_tbl_a5jId :: CmmExpr) ->
+ letrec {
+ platform_a5jIe :: Platform
+ [LclId]
+ platform_a5jIe = profilePlatform profile_a5jIc; } in
+ GHC.Cmm.Expr.$WCmmLoad
+ (cmmOffsetB
+ platform_a5jIe info_tbl_a5jId (stdNonPtrsOffset profile_a5jIc))
+ (bHalfWord platform_a5jIe)
+
+-- RHS size: {terms: 13, types: 3, coercions: 0, joins: 0/1}
+infoTablePtrs :: Profile -> CmmExpr -> CmmExpr
+[LclIdX]
+infoTablePtrs
+ = \ (profile_a5jI9 :: Profile) (info_tbl_a5jIa :: CmmExpr) ->
+ letrec {
+ platform_a5jIb :: Platform
+ [LclId]
+ platform_a5jIb = profilePlatform profile_a5jI9; } in
+ GHC.Cmm.Expr.$WCmmLoad
+ (cmmOffsetB
+ platform_a5jIb info_tbl_a5jIa (stdPtrsOffset profile_a5jI9))
+ (bHalfWord platform_a5jIb)
+
+-- RHS size: {terms: 13, types: 3, coercions: 0, joins: 0/1}
+infoTableClosureType :: Profile -> CmmExpr -> CmmExpr
+[LclIdX]
+infoTableClosureType
+ = \ (profile_a5jI6 :: Profile) (info_tbl_a5jI7 :: CmmExpr) ->
+ letrec {
+ platform_a5jI8 :: Platform
+ [LclId]
+ platform_a5jI8 = profilePlatform profile_a5jI6; } in
+ GHC.Cmm.Expr.$WCmmLoad
+ (cmmOffsetB
+ platform_a5jI8 info_tbl_a5jI7 (stdClosureTypeOffset profile_a5jI6))
+ (bHalfWord platform_a5jI8)
+
+-- RHS size: {terms: 13, types: 3, coercions: 0, joins: 0/1}
+infoTableSrtBitmap :: Profile -> CmmExpr -> CmmExpr
+[LclIdX]
+infoTableSrtBitmap
+ = \ (profile_a5jI3 :: Profile) (info_tbl_a5jI4 :: CmmExpr) ->
+ letrec {
+ platform_a5jI5 :: Platform
+ [LclId]
+ platform_a5jI5 = profilePlatform profile_a5jI3; } in
+ GHC.Cmm.Expr.$WCmmLoad
+ (cmmOffsetB
+ platform_a5jI5 info_tbl_a5jI4 (stdSrtBitmapOffset profile_a5jI3))
+ (bHalfWord platform_a5jI5)
+
+-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
+infoTableConstrTag :: Profile -> CmmExpr -> CmmExpr
+[LclIdX]
+infoTableConstrTag = infoTableSrtBitmap
+
+-- RHS size: {terms: 26, types: 8, coercions: 0, joins: 0/2}
+infoTable :: Profile -> CmmExpr -> CmmExpr
+[LclIdX]
+infoTable
+ = \ (profile_a5jI0 :: Profile) (info_ptr_a5jI1 :: CmmExpr) ->
+ letrec {
+ platform_a5jI2 :: Platform
+ [LclId]
+ platform_a5jI2 = profilePlatform profile_a5jI0; } in
+ let {
+ fail_d5k1j :: ghc-prim-0.6.1:GHC.Prim.Void# -> CmmExpr
+ [LclId]
+ fail_d5k1j
+ = \ (ds_d5k1k [OS=OneShot] :: ghc-prim-0.6.1:GHC.Prim.Void#) ->
+ cmmOffsetW
+ platform_a5jI2 info_ptr_a5jI1 (ghc-prim-0.6.1:GHC.Types.I# 1#) } in
+ case platformTablesNextToCode platform_a5jI2 of wild_00 {
+ False -> fail_d5k1j ghc-prim-0.6.1:GHC.Prim.void#;
+ True ->
+ cmmOffsetB
+ platform_a5jI2
+ info_ptr_a5jI1
+ (negate @ ByteOff $dNum_a5jPF (stdInfoTableSizeB profile_a5jI0))
+ }
+
+-- RHS size: {terms: 12, types: 3, coercions: 0, joins: 0/0}
+entryCode :: Platform -> CmmExpr -> CmmExpr
+[LclIdX]
+entryCode
+ = \ (platform_a5jHO :: Platform) (e_a5jHP :: CmmExpr) ->
+ case platformTablesNextToCode platform_a5jHO of wild_00 {
+ False -> GHC.Cmm.Expr.$WCmmLoad e_a5jHP (bWord platform_a5jHO);
+ True -> e_a5jHP
+ }
+
+-- RHS size: {terms: 29, types: 14, coercions: 0, joins: 0/2}
+wordAligned :: PtrOpts -> CmmExpr -> CmmExpr
+[LclIdX]
+wordAligned
+ = \ (opts_a5jHJ :: PtrOpts) (e_a5jHK :: CmmExpr) ->
+ letrec {
+ platform_a5jHL :: Platform
+ [LclId]
+ platform_a5jHL = profilePlatform (po_profile opts_a5jHJ); } in
+ let {
+ fail_d5k1u :: ghc-prim-0.6.1:GHC.Prim.Void# -> CmmExpr
+ [LclId]
+ fail_d5k1u
+ = \ (ds_d5k1v [OS=OneShot] :: ghc-prim-0.6.1:GHC.Prim.Void#) ->
+ e_a5jHK } in
+ case po_align_check opts_a5jHJ of wild_00 {
+ False -> fail_d5k1u ghc-prim-0.6.1:GHC.Prim.void#;
+ True ->
+ GHC.Cmm.Expr.CmmMachOp
+ (GHC.Cmm.MachOp.MO_AlignmentCheck
+ (platformWordSizeInBytes platform_a5jHL)
+ (wordWidth platform_a5jHL))
+ (GHC.Base.build
+ @ CmmExpr
+ (\ (@ a_d5k1l)
+ (c_d5k1m :: CmmExpr -> a_d5k1l -> a_d5k1l)
+ (n_d5k1n :: a_d5k1l) ->
+ c_d5k1m e_a5jHK n_d5k1n))
+ }
+
+-- RHS size: {terms: 10, types: 2, coercions: 0, joins: 0/0}
+closureInfoPtr :: PtrOpts -> CmmExpr -> CmmExpr
+[LclIdX]
+closureInfoPtr
+ = \ (opts_a5jHM :: PtrOpts) (e_a5jHN :: CmmExpr) ->
+ GHC.Cmm.Expr.$WCmmLoad
+ (wordAligned opts_a5jHM e_a5jHN)
+ (bWord (profilePlatform (po_profile opts_a5jHM)))
+
+-- RHS size: {terms: 29, types: 12, coercions: 0, joins: 0/3}
+getConstrTag :: PtrOpts -> CmmExpr -> CmmExpr
+[LclIdX]
+getConstrTag
+ = \ (opts_a5jHQ :: PtrOpts) (closure_ptr_a5jHR :: CmmExpr) ->
+ letrec {
+ profile_a5jHU :: Profile
+ [LclId]
+ profile_a5jHU = po_profile opts_a5jHQ; } in
+ letrec {
+ platform_a5jHT :: Platform
+ [LclId]
+ platform_a5jHT = profilePlatform profile_a5jHU; } in
+ letrec {
+ info_table_a5jHS :: CmmExpr
+ [LclId]
+ info_table_a5jHS
+ = infoTable
+ profile_a5jHU (closureInfoPtr opts_a5jHQ closure_ptr_a5jHR); } in
+ GHC.Cmm.Expr.CmmMachOp
+ (GHC.Cmm.MachOp.MO_UU_Conv
+ (halfWordWidth platform_a5jHT) (wordWidth platform_a5jHT))
+ (GHC.Base.build
+ @ CmmExpr
+ (\ (@ a_d5k1w)
+ (c_d5k1x :: CmmExpr -> a_d5k1w -> a_d5k1w)
+ (n_d5k1y :: a_d5k1w) ->
+ c_d5k1x
+ (infoTableConstrTag profile_a5jHU info_table_a5jHS) n_d5k1y))
+
+-- RHS size: {terms: 29, types: 12, coercions: 0, joins: 0/3}
+cmmGetClosureType :: PtrOpts -> CmmExpr -> CmmExpr
+[LclIdX]
+cmmGetClosureType
+ = \ (opts_a5jHV :: PtrOpts) (closure_ptr_a5jHW :: CmmExpr) ->
+ letrec {
+ profile_a5jHZ :: Profile
+ [LclId]
+ profile_a5jHZ = po_profile opts_a5jHV; } in
+ letrec {
+ platform_a5jHY :: Platform
+ [LclId]
+ platform_a5jHY = profilePlatform profile_a5jHZ; } in
+ letrec {
+ info_table_a5jHX :: CmmExpr
+ [LclId]
+ info_table_a5jHX
+ = infoTable
+ profile_a5jHZ (closureInfoPtr opts_a5jHV closure_ptr_a5jHW); } in
+ GHC.Cmm.Expr.CmmMachOp
+ (GHC.Cmm.MachOp.MO_UU_Conv
+ (halfWordWidth platform_a5jHY) (wordWidth platform_a5jHY))
+ (GHC.Base.build
+ @ CmmExpr
+ (\ (@ a_d5k1z)
+ (c_d5k1A :: CmmExpr -> a_d5k1z -> a_d5k1z)
+ (n_d5k1B :: a_d5k1z) ->
+ c_d5k1A
+ (infoTableClosureType profile_a5jHZ info_table_a5jHX) n_d5k1B))
+
+-- RHS size: {terms: 6, types: 2, coercions: 0, joins: 0/0}
+srtEscape :: Platform -> StgHalfWord
+[LclIdX]
+srtEscape
+ = \ (platform_a5jHI :: Platform) ->
+ toStgHalfWord platform_a5jHI (negate @ Integer $dNum_a5jQh 1)
+
+-- RHS size: {terms: 20, types: 32, coercions: 0, joins: 0/3}
+newStringLit
+ :: forall info stmt.
+ ByteString -> UniqSM (CmmLit, GenCmmDecl RawCmmStatics info stmt)
+[LclIdX]
+newStringLit
+ = \ (@ info_a5jQm) (@ stmt_a5jQn) ->
+ let {
+ $dMonad_a5jQy :: Monad UniqSM
+ [LclId]
+ $dMonad_a5jQy = $dMonad_a5jQG } in
+ let {
+ $dMonadUnique_a5jQw :: MonadUnique UniqSM
+ [LclId]
+ $dMonadUnique_a5jQw = $dMonadUnique_a5jSr } in
+ let {
+ $dMonad_a5jQs :: Monad UniqSM
+ [LclId]
+ $dMonad_a5jQs = $dMonad_a5jQG } in
+ \ (bytes_a5jHG :: ByteString) ->
+ >>=
+ @ UniqSM
+ $dMonad_a5jQs
+ @ GHC.Types.Unique.Unique
+ @ (CmmLit, GenCmmDecl RawCmmStatics info_a5jQm stmt_a5jQn)
+ (getUniqueM @ UniqSM $dMonadUnique_a5jQw)
+ (\ (uniq_a5jHH :: GHC.Types.Unique.Unique) ->
+ return
+ @ UniqSM
+ $dMonad_a5jQy
+ @ (CmmLit, GenCmmDecl (GenCmmStatics 'True) info_a5jQm stmt_a5jQn)
+ (mkByteStringCLit
+ @ 'True
+ @ info_a5jQm
+ @ stmt_a5jQn
+ (mkStringLitLabel uniq_a5jHH)
+ bytes_a5jHG))
+
+-- RHS size: {terms: 46, types: 131, coercions: 0, joins: 0/0}
+mkProfLits
+ :: Platform
+ -> ProfilingInfo -> UniqSM ((CmmLit, CmmLit), [RawCmmDecl])
+[LclIdX]
+mkProfLits
+ = \ (platform_a5jHz :: Platform) (ds_d5k1C :: ProfilingInfo) ->
+ case ds_d5k1C of wild_00 {
+ NoProfilingInfo ->
+ return
+ @ UniqSM
+ $dMonad_a5jQG
+ @ ((CmmLit, CmmLit), [RawCmmDecl])
+ ((zeroCLit platform_a5jHz, zeroCLit platform_a5jHz),
+ ghc-prim-0.6.1:GHC.Types.[] @ RawCmmDecl);
+ ProfilingInfo td_a5jHA cd_a5jHB ->
+ >>=
+ @ UniqSM
+ $dMonad_a5jQQ
+ @ (CmmLit,
+ GenCmmDecl
+ RawCmmStatics
+ (GHC.Cmm.Dataflow.Label.LabelMap RawCmmStatics)
+ CmmGraph)
+ @ ((CmmLit, CmmLit), [RawCmmDecl])
+ (newStringLit
+ @ (GHC.Cmm.Dataflow.Label.LabelMap RawCmmStatics)
+ @ CmmGraph
+ td_a5jHA)
+ (\ (ds_d5k1P
+ :: (CmmLit,
+ GenCmmDecl
+ RawCmmStatics
+ (GHC.Cmm.Dataflow.Label.LabelMap RawCmmStatics)
+ CmmGraph)) ->
+ case ds_d5k1P of wild_00 { (td_lit_a5jHC, td_decl_a5jHD) ->
+ >>=
+ @ UniqSM
+ $dMonad_a5jQY
+ @ (CmmLit,
+ GenCmmDecl
+ RawCmmStatics
+ (GHC.Cmm.Dataflow.Label.LabelMap RawCmmStatics)
+ CmmGraph)
+ @ ((CmmLit, CmmLit), [RawCmmDecl])
+ (newStringLit
+ @ (GHC.Cmm.Dataflow.Label.LabelMap RawCmmStatics)
+ @ CmmGraph
+ cd_a5jHB)
+ (\ (ds_d5k1K
+ :: (CmmLit,
+ GenCmmDecl
+ RawCmmStatics
+ (GHC.Cmm.Dataflow.Label.LabelMap RawCmmStatics)
+ CmmGraph)) ->
+ case ds_d5k1K of wild_00 { (cd_lit_a5jHE, cd_decl_a5jHF) ->
+ return
+ @ UniqSM
+ $dMonad_a5jR4
+ @ ((CmmLit, CmmLit),
+ [GenCmmDecl
+ RawCmmStatics
+ (GHC.Cmm.Dataflow.Label.LabelMap RawCmmStatics)
+ CmmGraph])
+ ((td_lit_a5jHC, cd_lit_a5jHE),
+ GHC.Base.build
+ @ (GenCmmDecl
+ RawCmmStatics
+ (GHC.Cmm.Dataflow.Label.LabelMap RawCmmStatics)
+ CmmGraph)
+ (\ (@ a_d5k1H)
+ (c_d5k1I
+ :: GenCmmDecl
+ RawCmmStatics
+ (GHC.Cmm.Dataflow.Label.LabelMap RawCmmStatics)
+ CmmGraph
+ -> a_d5k1H -> a_d5k1H)
+ (n_d5k1J :: a_d5k1H) ->
+ c_d5k1I td_decl_a5jHD (c_d5k1I cd_decl_a5jHF n_d5k1J)))
+ })
+ })
+ }
+
+-- RHS size: {terms: 52, types: 39, coercions: 0, joins: 0/4}
+mkStdInfoTable
+ :: DynFlags
+ -> (CmmLit, CmmLit) -> Int -> CmmLit -> CmmLit -> [CmmLit]
+[LclIdX]
+mkStdInfoTable
+ = \ (dflags_a5jHq :: DynFlags)
+ (ds_d5k20 :: (CmmLit, CmmLit))
+ (cl_type_a5jHt :: Int)
+ (srt_a5jHu :: CmmLit)
+ (layout_lit_a5jHv :: CmmLit) ->
+ case ds_d5k20 of wild_00
+ { (type_descr_a5jHr, closure_descr_a5jHs) ->
+ letrec {
+ prof_info_a5jHx :: [CmmLit]
+ [LclId]
+ prof_info_a5jHx
+ = let {
+ fail_d5k2j :: ghc-prim-0.6.1:GHC.Prim.Void# -> [CmmLit]
+ [LclId]
+ fail_d5k2j
+ = \ (ds_d5k2k [OS=OneShot] :: ghc-prim-0.6.1:GHC.Prim.Void#) ->
+ ghc-prim-0.6.1:GHC.Types.[] @ CmmLit } in
+ case sccProfilingEnabled dflags_a5jHq of wild_00 {
+ False -> fail_d5k2j ghc-prim-0.6.1:GHC.Prim.void#;
+ True ->
+ GHC.Base.build
+ @ CmmLit
+ (\ (@ a_d5k2a)
+ (c_d5k2b :: CmmLit -> a_d5k2a -> a_d5k2a)
+ (n_d5k2c :: a_d5k2a) ->
+ c_d5k2b type_descr_a5jHr (c_d5k2b closure_descr_a5jHs n_d5k2c))
+ }; } in
+ letrec {
+ platform_a5jHw :: Platform
+ [LclId]
+ platform_a5jHw = targetPlatform dflags_a5jHq; } in
+ letrec {
+ tag_a5jHy :: CmmLit
+ [LclId]
+ tag_a5jHy
+ = GHC.Cmm.Expr.$WCmmInt
+ (fromIntegral
+ @ Int @ Integer $dIntegral_a5jRr $dNum_a5jRs cl_type_a5jHt)
+ (halfWordWidth platform_a5jHw); } in
+ ++
+ @ CmmLit
+ prof_info_a5jHx
+ (GHC.Base.build
+ @ CmmLit
+ (\ (@ a_d5k23)
+ (c_d5k24 :: CmmLit -> a_d5k23 -> a_d5k23)
+ (n_d5k25 :: a_d5k23) ->
+ c_d5k24
+ layout_lit_a5jHv (c_d5k24 tag_a5jHy (c_d5k24 srt_a5jHu n_d5k25))))
+ }
+
+-- RHS size: {terms: 103, types: 99, coercions: 0, joins: 0/10}
+mkLivenessBits
+ :: DynFlags -> Liveness -> UniqSM (CmmLit, [RawCmmDecl])
+[LclIdX]
+mkLivenessBits
+ = \ (dflags_a5jHf :: DynFlags) (liveness_a5jHg :: Liveness) ->
+ letrec {
+ n_bits_a5jHi :: Int
+ [LclId]
+ n_bits_a5jHi
+ = length @ [] $dFoldable_a5jRE @ Bool liveness_a5jHg; } in
+ letrec {
+ platform_a5jHh :: Platform
+ [LclId]
+ platform_a5jHh = targetPlatform dflags_a5jHf; } in
+ letrec {
+ bitmap_a5jHj :: Bitmap
+ [LclId]
+ bitmap_a5jHj = mkBitmap platform_a5jHh liveness_a5jHg; } in
+ letrec {
+ small_bitmap_a5jHk :: StgWord
+ [LclId]
+ small_bitmap_a5jHk
+ = let {
+ ds_d5k2w :: [StgWord]
+ [LclId]
+ ds_d5k2w = bitmap_a5jHj } in
+ let {
+ fail_d5k2S :: ghc-prim-0.6.1:GHC.Prim.Void# -> StgWord
+ [LclId]
+ fail_d5k2S
+ = \ (ds_d5k2T [OS=OneShot] :: ghc-prim-0.6.1:GHC.Prim.Void#) ->
+ panic
+ @ StgWord
+ (ghc-prim-0.6.1:GHC.CString.unpackCString# "mkLiveness"#) } in
+ case ds_d5k2w of wild_00 {
+ [] -> toStgWord platform_a5jHh 0;
+ : b_a5jHn ds_d5k2R ->
+ case ds_d5k2R of wild_00 {
+ __DEFAULT -> fail_d5k2S ghc-prim-0.6.1:GHC.Prim.void#;
+ [] -> b_a5jHn
+ }
+ }; } in
+ letrec {
+ bitmap_word_a5jHl :: StgWord
+ [LclId]
+ bitmap_word_a5jHl
+ = .|.
+ @ StgWord
+ $dBits_a5jRY
+ (toStgWord
+ platform_a5jHh
+ (fromIntegral
+ @ Int @ Integer $dIntegral_a5jS1 $dNum_a5jS2 n_bits_a5jHi))
+ (shiftL
+ @ StgWord
+ $dBits_a5jS4
+ small_bitmap_a5jHk
+ (pc_BITMAP_BITS_SHIFT (platformConstants platform_a5jHh))); } in
+ letrec {
+ lits_a5jHm :: [CmmLit]
+ [LclId]
+ lits_a5jHm
+ = ghc-prim-0.6.1:GHC.Types.:
+ @ CmmLit
+ (mkWordCLit
+ platform_a5jHh
+ (fromIntegral
+ @ Int @ Integer $dIntegral_a5jSc $dNum_a5jSd n_bits_a5jHi))
+ (map
+ @ StgWord
+ @ CmmLit
+ (mkStgWordCLit platform_a5jHh)
+ bitmap_a5jHj); } in
+ let {
+ fail_d5k2u
+ :: ghc-prim-0.6.1:GHC.Prim.Void# -> UniqSM (CmmLit, [RawCmmDecl])
+ [LclId]
+ fail_d5k2u
+ = \ (ds_d5k2v [OS=OneShot] :: ghc-prim-0.6.1:GHC.Prim.Void#) ->
+ return
+ @ UniqSM
+ $dMonad_a5jSG
+ @ (CmmLit, [RawCmmDecl])
+ (mkStgWordCLit platform_a5jHh bitmap_word_a5jHl,
+ ghc-prim-0.6.1:GHC.Types.[] @ RawCmmDecl) } in
+ case > @ Int
+ $dOrd_a5jSj
+ n_bits_a5jHi
+ (mAX_SMALL_BITMAP_SIZE platform_a5jHh)
+ of wild_00 {
+ False -> fail_d5k2u ghc-prim-0.6.1:GHC.Prim.void#;
+ True ->
+ >>=
+ @ UniqSM
+ $dMonad_a5jSn
+ @ GHC.Types.Unique.Unique
+ @ (CmmLit, [RawCmmDecl])
+ (getUniqueM @ UniqSM $dMonadUnique_a5jSr)
+ (\ (uniq_a5jHo :: GHC.Types.Unique.Unique) ->
+ letrec {
+ bitmap_lbl_a5jHp :: CLabel
+ [LclId]
+ bitmap_lbl_a5jHp = mkBitmapLabel uniq_a5jHo; } in
+ return
+ @ UniqSM
+ $dMonad_a5jSx
+ @ (CmmLit,
+ [GenCmmDecl
+ (GenCmmStatics 'True)
+ (GHC.Cmm.Dataflow.Label.LabelMap RawCmmStatics)
+ CmmGraph])
+ (GHC.Cmm.Expr.CmmLabel bitmap_lbl_a5jHp,
+ GHC.Base.build
+ @ (GenCmmDecl
+ (GenCmmStatics 'True)
+ (GHC.Cmm.Dataflow.Label.LabelMap RawCmmStatics)
+ CmmGraph)
+ (\ (@ a_d5k2l)
+ (c_d5k2m
+ :: GenCmmDecl
+ (GenCmmStatics 'True)
+ (GHC.Cmm.Dataflow.Label.LabelMap RawCmmStatics)
+ CmmGraph
+ -> a_d5k2l -> a_d5k2l)
+ (n_d5k2n :: a_d5k2l) ->
+ c_d5k2m
+ (mkRODataLits
+ @ 'True
+ @ (GHC.Cmm.Dataflow.Label.LabelMap RawCmmStatics)
+ @ CmmGraph
+ bitmap_lbl_a5jHp
+ lits_a5jHm)
+ n_d5k2n)))
+ }
+
+-- RHS size: {terms: 34, types: 12, coercions: 0, joins: 0/2}
+makeRelativeRefTo :: Platform -> CLabel -> CmmLit -> CmmLit
+[LclIdX]
+makeRelativeRefTo
+ = \ (platform_a5jH9 :: Platform)
+ (info_lbl_a5jHa :: CLabel)
+ (lit_a5jHb :: CmmLit) ->
+ case platformTablesNextToCode platform_a5jH9 of wild_00 {
+ False -> lit_a5jHb;
+ True ->
+ let {
+ ds_d5k2U :: CmmLit
+ [LclId]
+ ds_d5k2U = lit_a5jHb } in
+ let {
+ fail_d5k3r :: ghc-prim-0.6.1:GHC.Prim.Void# -> CmmLit
+ [LclId]
+ fail_d5k3r
+ = \ (ds_d5k3s [OS=OneShot] :: ghc-prim-0.6.1:GHC.Prim.Void#) ->
+ lit_a5jHb } in
+ case ds_d5k2U of wild_00 {
+ __DEFAULT -> fail_d5k3r ghc-prim-0.6.1:GHC.Prim.void#;
+ CmmLabel lbl_a5jHc ->
+ GHC.Cmm.Expr.CmmLabelDiffOff
+ lbl_a5jHc
+ info_lbl_a5jHa
+ (ghc-prim-0.6.1:GHC.Types.I# 0#)
+ (wordWidth platform_a5jH9);
+ CmmLabelOff lbl_a5jHd off_a5jHe ->
+ GHC.Cmm.Expr.CmmLabelDiffOff
+ lbl_a5jHd info_lbl_a5jHa off_a5jHe (wordWidth platform_a5jH9)
+ }
+ }
+
+-- RHS size: {terms: 9, types: 2, coercions: 0, joins: 0/0}
+inlineSRT :: Platform -> Bool
+[LclIdX]
+inlineSRT
+ = \ (platform_a5jH8 :: Platform) ->
+ &&
+ (==
+ @ Arch
+ $dEq_a5jSQ
+ (platformArch platform_a5jH8)
+ GHC.Platform.ArchOS.ArchX86_64)
+ (platformTablesNextToCode platform_a5jH8)
+
+-- RHS size: {terms: 50, types: 35, coercions: 0, joins: 0/4}
+mkSRTLit
+ :: Platform -> CLabel -> Maybe CLabel -> ([CmmLit], CmmLit)
+[LclIdX]
+mkSRTLit
+ = \ (platform_a5jH2 :: Platform)
+ (info_lbl_a5jH3 :: CLabel)
+ (ds_d5k3t :: Maybe CLabel) ->
+ let {
+ platform_a5jH5 :: Platform
+ [LclId]
+ platform_a5jH5 = platform_a5jH2 } in
+ let {
+ platform_a5jH6 :: Platform
+ [LclId]
+ platform_a5jH6 = platform_a5jH2 } in
+ case ds_d5k3t of wild_00 {
+ Nothing ->
+ (ghc-prim-0.6.1:GHC.Types.[] @ CmmLit,
+ GHC.Cmm.Expr.$WCmmInt 0 (halfWordWidth platform_a5jH5));
+ Just lbl_a5jH4 ->
+ let {
+ lbl_a5jH7 :: CLabel
+ [LclId]
+ lbl_a5jH7 = lbl_a5jH4 } in
+ let {
+ fail_d5k3O :: ghc-prim-0.6.1:GHC.Prim.Void# -> ([CmmLit], CmmLit)
+ [LclId]
+ fail_d5k3O
+ = \ (ds_d5k3P [OS=OneShot] :: ghc-prim-0.6.1:GHC.Prim.Void#) ->
+ (GHC.Base.build
+ @ CmmLit
+ (\ (@ a_d5k3A)
+ (c_d5k3B :: CmmLit -> a_d5k3A -> a_d5k3A)
+ (n_d5k3C :: a_d5k3A) ->
+ c_d5k3B (GHC.Cmm.Expr.CmmLabel lbl_a5jH7) n_d5k3C),
+ GHC.Cmm.Expr.$WCmmInt 1 (halfWordWidth platform_a5jH6)) } in
+ case inlineSRT platform_a5jH2 of wild_00 {
+ False -> fail_d5k3O ghc-prim-0.6.1:GHC.Prim.void#;
+ True ->
+ (ghc-prim-0.6.1:GHC.Types.[] @ CmmLit,
+ GHC.Cmm.Expr.CmmLabelDiffOff
+ lbl_a5jH4
+ info_lbl_a5jH3
+ (ghc-prim-0.6.1:GHC.Types.I# 0#)
+ (halfWordWidth platform_a5jH2))
+ }
+ }
+
+-- RHS size: {terms: 17, types: 7, coercions: 0, joins: 0/0}
+packIntsCLit :: Platform -> Int -> Int -> CmmLit
+[LclIdX]
+packIntsCLit
+ = \ (platform_a5jGZ :: Platform)
+ (a_a5jH0 :: Int)
+ (b_a5jH1 :: Int) ->
+ packHalfWordsCLit
+ platform_a5jGZ
+ (toStgHalfWord
+ platform_a5jGZ
+ (fromIntegral
+ @ Int @ Integer $dIntegral_a5jSX $dNum_a5jSY a_a5jH0))
+ (toStgHalfWord
+ platform_a5jGZ
+ (fromIntegral
+ @ Int @ Integer $dIntegral_a5jT1 $dNum_a5jT2 b_a5jH1))
+
+-- RHS size: {terms: 408, types: 606, coercions: 0, joins: 0/41}
+mkInfoTableContents
+ :: DynFlags
+ -> CmmInfoTable
+ -> Maybe Int
+ -> UniqSM ([RawCmmDecl], InfoTableContents)
+[LclIdX]
+mkInfoTableContents
+ = \ (dflags_a5jG3 :: DynFlags)
+ (info_a5jG4 :: CmmInfoTable)
+ (mb_rts_tag_a5jG9 :: Maybe Int) ->
+ let {
+ fail_d5k8y
+ :: ghc-prim-0.6.1:GHC.Prim.Void#
+ -> UniqSM ([RawCmmDecl], InfoTableContents)
+ [LclId]
+ fail_d5k8y
+ = \ (ds_d5k8z [OS=OneShot] :: ghc-prim-0.6.1:GHC.Prim.Void#) ->
+ panic
+ @ (UniqSM ([RawCmmDecl], InfoTableContents))
+ (ghc-prim-0.6.1:GHC.CString.unpackCString#
+ "mkInfoTableContents"#) } in
+ case info_a5jG4 of wild_00
+ { CmmInfoTable ds_d5k8t ds_d5k8u ds_d5k8v ds_d5k8w ds_d5k8x ->
+ let {
+ info_lbl_a5jG5 :: CLabel
+ [LclId]
+ info_lbl_a5jG5 = ds_d5k8t } in
+ let {
+ smrep_a5jG6 :: SMRep
+ [LclId]
+ smrep_a5jG6 = ds_d5k8u } in
+ let {
+ prof_a5jG7 :: ProfilingInfo
+ [LclId]
+ prof_a5jG7 = ds_d5k8v } in
+ let {
+ srt_a5jG8 :: Maybe CLabel
+ [LclId]
+ srt_a5jG8 = ds_d5k8w } in
+ letrec {
+ platform_a5jGa :: Platform
+ [LclId]
+ platform_a5jGa = targetPlatform dflags_a5jG3; } in
+ letrec {
+ mk_pieces_a5jGb
+ :: ClosureTypeInfo
+ -> [CmmLit]
+ -> UniqSM (Maybe CmmLit, Maybe CmmLit, [CmmLit], [RawCmmDecl])
+ [LclId]
+ mk_pieces_a5jGb
+ = \ (ds_d5k8E :: ClosureTypeInfo) (_no_srt_a5jGe :: [CmmLit]) ->
+ let {
+ other_a5jGz :: ClosureTypeInfo
+ [LclId]
+ other_a5jGz = ds_d5k8E } in
+ let {
+ fail_d5k9N
+ :: ghc-prim-0.6.1:GHC.Prim.Void#
+ -> UniqSM (Maybe CmmLit, Maybe CmmLit, [CmmLit], [RawCmmDecl])
+ [LclId]
+ fail_d5k9N
+ = \ (ds_d5k9O [OS=OneShot] :: ghc-prim-0.6.1:GHC.Prim.Void#) ->
+ pprPanic
+ @ (UniqSM (Maybe CmmLit, Maybe CmmLit, [CmmLit], [RawCmmDecl]))
+ $dIP_a5jV3
+ (ghc-prim-0.6.1:GHC.CString.unpackCString# "mk_pieces"#)
+ (ppr @ ClosureTypeInfo $dOutputable_a5jV5 other_a5jGz) } in
+ case ds_d5k8E of wild_00 {
+ __DEFAULT -> fail_d5k9N ghc-prim-0.6.1:GHC.Prim.void#;
+ Constr con_tag_a5jGc con_descr_a5jGd ->
+ >>=
+ @ UniqSM
+ $dMonad_a5jTk
+ @ (CmmLit,
+ GenCmmDecl
+ RawCmmStatics
+ (GHC.Cmm.Dataflow.Label.LabelMap RawCmmStatics)
+ CmmGraph)
+ @ (Maybe CmmLit, Maybe CmmLit, [CmmLit], [RawCmmDecl])
+ (newStringLit
+ @ (GHC.Cmm.Dataflow.Label.LabelMap RawCmmStatics)
+ @ CmmGraph
+ con_descr_a5jGd)
+ (\ (ds_d5k8N
+ :: (CmmLit,
+ GenCmmDecl
+ RawCmmStatics
+ (GHC.Cmm.Dataflow.Label.LabelMap RawCmmStatics)
+ CmmGraph)) ->
+ case ds_d5k8N of wild_00 { (descr_lit_a5jGf, decl_a5jGg) ->
+ return
+ @ UniqSM
+ $dMonad_a5jTq
+ @ (Maybe CmmLit, Maybe CmmLit, [CmmLit],
+ [GenCmmDecl
+ RawCmmStatics
+ (GHC.Cmm.Dataflow.Label.LabelMap RawCmmStatics)
+ CmmGraph])
+ (GHC.Maybe.Just
+ @ CmmLit
+ (GHC.Cmm.Expr.$WCmmInt
+ (fromIntegral
+ @ GHC.Types.Basic.ConTagZ
+ @ Integer
+ $dIntegral_a5jTz
+ $dNum_a5jTA
+ con_tag_a5jGc)
+ (halfWordWidth platform_a5jGa)),
+ GHC.Maybe.Nothing @ CmmLit,
+ GHC.Base.build
+ @ CmmLit
+ (\ (@ a_d5k8K)
+ (c_d5k8L :: CmmLit -> a_d5k8K -> a_d5k8K)
+ (n_d5k8M :: a_d5k8K) ->
+ c_d5k8L descr_lit_a5jGf n_d5k8M),
+ GHC.Base.build
+ @ (GenCmmDecl
+ RawCmmStatics
+ (GHC.Cmm.Dataflow.Label.LabelMap RawCmmStatics)
+ CmmGraph)
+ (\ (@ a_d5k8H)
+ (c_d5k8I
+ :: GenCmmDecl
+ RawCmmStatics
+ (GHC.Cmm.Dataflow.Label.LabelMap RawCmmStatics)
+ CmmGraph
+ -> a_d5k8H -> a_d5k8H)
+ (n_d5k8J :: a_d5k8H) ->
+ c_d5k8I decl_a5jGg n_d5k8J))
+ });
+ Fun arity_a5jGk ds_d5k9M ->
+ let {
+ arity_a5jGo :: GHC.Runtime.Heap.Layout.FunArity
+ [LclId]
+ arity_a5jGo = arity_a5jGk } in
+ case ds_d5k9M of wild_00 {
+ __DEFAULT -> fail_d5k9N ghc-prim-0.6.1:GHC.Prim.void#;
+ ArgSpec fun_type_a5jGl ->
+ let {
+ srt_label_a5jGm :: [CmmLit]
+ [LclId]
+ srt_label_a5jGm = _no_srt_a5jGe } in
+ letrec {
+ extra_bits_a5jGn :: [CmmLit]
+ [LclId]
+ extra_bits_a5jGn
+ = ghc-prim-0.6.1:GHC.Types.:
+ @ CmmLit
+ (packIntsCLit platform_a5jGa fun_type_a5jGl arity_a5jGk)
+ srt_label_a5jGm; } in
+ return
+ @ UniqSM
+ $dMonad_a5jUa
+ @ (Maybe CmmLit, Maybe CmmLit, [CmmLit], [RawCmmDecl])
+ (GHC.Maybe.Nothing @ CmmLit, GHC.Maybe.Nothing @ CmmLit,
+ extra_bits_a5jGn, ghc-prim-0.6.1:GHC.Types.[] @ RawCmmDecl);
+ ArgGen arg_bits_a5jGp ->
+ let {
+ srt_label_a5jGq :: [CmmLit]
+ [LclId]
+ srt_label_a5jGq = _no_srt_a5jGe } in
+ letrec {
+ srt_lit_a5jGs :: CmmLit
+ [LclId]
+ srt_lit_a5jGs
+ = let {
+ ds_d5k9P :: [CmmLit]
+ [LclId]
+ ds_d5k9P = srt_label_a5jGq } in
+ case ds_d5k9P of wild_00 {
+ [] -> mkIntCLit platform_a5jGa (ghc-prim-0.6.1:GHC.Types.I# 0#);
+ : lit_a5jGt _rest_a5jGu ->
+ case &&
+ debugIsOn
+ (not (null @ [] $dFoldable_a5jUq @ CmmLit _rest_a5jGu))
+ of wild_00 {
+ False -> lit_a5jGt;
+ True ->
+ assertPanic
+ @ CmmLit
+ (ghc-prim-0.6.1:GHC.CString.unpackCString#
+ "E:\\\\ghc_inferTags\\\\compiler\\\\GHC\\\\Cmm\\\\Info.hs"#)
+ (ghc-prim-0.6.1:GHC.Types.I# 262#)
+ }
+ }; } in
+ letrec {
+ slow_entry_a5jGr :: CmmLit
+ [LclId]
+ slow_entry_a5jGr
+ = GHC.Cmm.Expr.CmmLabel
+ (toSlowEntryLbl platform_a5jGa info_lbl_a5jG5); } in
+ >>=
+ @ UniqSM
+ $dMonad_a5jUB
+ @ (CmmLit, [RawCmmDecl])
+ @ (Maybe CmmLit, Maybe CmmLit, [CmmLit], [RawCmmDecl])
+ (mkLivenessBits dflags_a5jG3 arg_bits_a5jGp)
+ (\ (ds_d5k9n :: (CmmLit, [RawCmmDecl])) ->
+ case ds_d5k9n of wild_00
+ { (liveness_lit_a5jGv, liveness_data_a5jGw) ->
+ letrec {
+ fun_type_a5jGx :: Int
+ [LclId]
+ fun_type_a5jGx
+ = let {
+ fail_d5k9l :: ghc-prim-0.6.1:GHC.Prim.Void# -> Int
+ [LclId]
+ fail_d5k9l
+ = \ (ds_d5k9m [OS=OneShot] :: ghc-prim-0.6.1:GHC.Prim.Void#) ->
+ aRG_GEN_BIG } in
+ case null @ [] $dFoldable_a5jUJ @ RawCmmDecl liveness_data_a5jGw
+ of wild_00 {
+ False -> fail_d5k9l ghc-prim-0.6.1:GHC.Prim.void#;
+ True -> aRG_GEN
+ }; } in
+ letrec {
+ extra_bits_a5jGy :: [CmmLit]
+ [LclId]
+ extra_bits_a5jGy
+ = ++
+ @ CmmLit
+ (GHC.Base.build
+ @ CmmLit
+ (\ (@ a_d5k96)
+ (c_d5k97 :: CmmLit -> a_d5k96 -> a_d5k96)
+ (n_d5k98 :: a_d5k96) ->
+ c_d5k97
+ (packIntsCLit platform_a5jGa fun_type_a5jGx arity_a5jGo)
+ n_d5k98))
+ (++
+ @ CmmLit
+ (case inlineSRT platform_a5jGa of wild_00 {
+ False ->
+ GHC.Base.build
+ @ CmmLit
+ (\ (@ a_d5k99)
+ (c_d5k9a :: CmmLit -> a_d5k99 -> a_d5k99)
+ (n_d5k9b :: a_d5k99) ->
+ c_d5k9a srt_lit_a5jGs n_d5k9b);
+ True -> ghc-prim-0.6.1:GHC.Types.[] @ CmmLit
+ })
+ (GHC.Base.build
+ @ CmmLit
+ (\ (@ a_d5k9c)
+ (c_d5k9d :: CmmLit -> a_d5k9c -> a_d5k9c)
+ (n_d5k9e :: a_d5k9c) ->
+ c_d5k9d
+ liveness_lit_a5jGv
+ (c_d5k9d slow_entry_a5jGr n_d5k9e)))); } in
+ return
+ @ UniqSM
+ $dMonad_a5jUU
+ @ (Maybe CmmLit, Maybe CmmLit, [CmmLit], [RawCmmDecl])
+ (GHC.Maybe.Nothing @ CmmLit, GHC.Maybe.Nothing @ CmmLit,
+ extra_bits_a5jGy, liveness_data_a5jGw)
+ })
+ };
+ Thunk ->
+ let {
+ srt_label_a5jGh :: [CmmLit]
+ [LclId]
+ srt_label_a5jGh = _no_srt_a5jGe } in
+ return
+ @ UniqSM
+ $dMonad_a5jTF
+ @ (Maybe CmmLit, Maybe CmmLit, [CmmLit], [RawCmmDecl])
+ (GHC.Maybe.Nothing @ CmmLit, GHC.Maybe.Nothing @ CmmLit,
+ srt_label_a5jGh, ghc-prim-0.6.1:GHC.Types.[] @ RawCmmDecl);
+ ThunkSelector offset_a5jGi ->
+ let {
+ _no_srt_a5jGj :: [CmmLit]
+ [LclId]
+ _no_srt_a5jGj = _no_srt_a5jGe } in
+ return
+ @ UniqSM
+ $dMonad_a5jTP
+ @ (Maybe CmmLit, Maybe CmmLit, [CmmLit], [RawCmmDecl])
+ (GHC.Maybe.Just
+ @ CmmLit (GHC.Cmm.Expr.$WCmmInt 0 (halfWordWidth platform_a5jGa)),
+ GHC.Maybe.Just
+ @ CmmLit
+ (mkWordCLit
+ platform_a5jGa
+ (fromIntegral
+ @ GHC.Runtime.Heap.Layout.SelectorOffset
+ @ Integer
+ $dIntegral_a5jTZ
+ $dNum_a5jU0
+ offset_a5jGi)),
+ ghc-prim-0.6.1:GHC.Types.[] @ CmmLit,
+ ghc-prim-0.6.1:GHC.Types.[] @ RawCmmDecl)
+ }; } in
+ let {
+ fail_d5k8C
+ :: ghc-prim-0.6.1:GHC.Prim.Void#
+ -> UniqSM ([RawCmmDecl], InfoTableContents)
+ [LclId]
+ fail_d5k8C
+ = \ (ds_d5k8D [OS=OneShot] :: ghc-prim-0.6.1:GHC.Prim.Void#) ->
+ let {
+ fail_d5k8A
+ :: ghc-prim-0.6.1:GHC.Prim.Void#
+ -> UniqSM ([RawCmmDecl], InfoTableContents)
+ [LclId]
+ fail_d5k8A
+ = \ (ds_d5k8B [OS=OneShot] :: ghc-prim-0.6.1:GHC.Prim.Void#) ->
+ let {
+ ds_d5k6x :: SMRep
+ [LclId]
+ ds_d5k6x = smrep_a5jG6 } in
+ case ds_d5k6x of wild_00 {
+ __DEFAULT -> fail_d5k8y ghc-prim-0.6.1:GHC.Prim.void#;
+ HeapRep ds_d5k7E ptrs_a5jGM nonptrs_a5jGN closure_type_a5jGO ->
+ letrec {
+ layout_a5jGP :: CmmLit
+ [LclId]
+ layout_a5jGP
+ = packIntsCLit platform_a5jGa ptrs_a5jGM nonptrs_a5jGN; } in
+ >>=
+ @ UniqSM
+ $dMonad_a5jW9
+ @ ((CmmLit, CmmLit), [RawCmmDecl])
+ @ ([RawCmmDecl], InfoTableContents)
+ (mkProfLits platform_a5jGa prof_a5jG7)
+ (\ (ds_d5k6P :: ((CmmLit, CmmLit), [RawCmmDecl])) ->
+ case ds_d5k6P of wild_00 { (prof_lits_a5jGQ, prof_data_a5jGR) ->
+ letrec {
+ ds_d5k6G :: ([CmmLit], CmmLit)
+ [LclId]
+ ds_d5k6G = mkSRTLit platform_a5jGa info_lbl_a5jG5 srt_a5jG8;
+ srt_label_a5jGS :: [CmmLit]
+ [LclId]
+ srt_label_a5jGS
+ = case ds_d5k6G of wild_00
+ { (srt_label_a5jGS, srt_bitmap_a5jGT) ->
+ srt_label_a5jGS
+ };
+ srt_bitmap_a5jGT :: CmmLit
+ [LclId]
+ srt_bitmap_a5jGT
+ = case ds_d5k6G of wild_00
+ { (srt_label_a5jGS, srt_bitmap_a5jGT) ->
+ srt_bitmap_a5jGT
+ }; } in
+ >>=
+ @ UniqSM
+ $dMonad_a5jWm
+ @ (Maybe CmmLit, Maybe CmmLit, [CmmLit], [RawCmmDecl])
+ @ ([RawCmmDecl], InfoTableContents)
+ (mk_pieces_a5jGb closure_type_a5jGO srt_label_a5jGS)
+ (\ (ds_d5k6B
+ :: (Maybe CmmLit, Maybe CmmLit, [CmmLit], [RawCmmDecl])) ->
+ case ds_d5k6B of wild_00
+ { (mb_srt_field_a5jGU, mb_layout_a5jGV, extra_bits_a5jGW,
+ ct_data_a5jGX) ->
+ letrec {
+ std_info_a5jGY :: [CmmLit]
+ [LclId]
+ std_info_a5jGY
+ = mkStdInfoTable
+ dflags_a5jG3
+ prof_lits_a5jGQ
+ (orElse
+ @ Int mb_rts_tag_a5jG9 (rtsClosureType smrep_a5jG6))
+ (orElse @ CmmLit mb_srt_field_a5jGU srt_bitmap_a5jGT)
+ (orElse @ CmmLit mb_layout_a5jGV layout_a5jGP); } in
+ return
+ @ UniqSM
+ $dMonad_a5jWx
+ @ ([RawCmmDecl], ([CmmLit], [CmmLit]))
+ (++ @ RawCmmDecl prof_data_a5jGR ct_data_a5jGX,
+ (std_info_a5jGY, extra_bits_a5jGW))
+ })
+ })
+ } } in
+ let {
+ ds_d5k4Y :: SMRep
+ [LclId]
+ ds_d5k4Y = smrep_a5jG6 } in
+ case ds_d5k4Y of wild_00 {
+ __DEFAULT -> fail_d5k8A ghc-prim-0.6.1:GHC.Prim.void#;
+ StackRep frame_a5jGC ->
+ >>=
+ @ UniqSM
+ $dMonad_a5jVo
+ @ ((CmmLit, CmmLit), [RawCmmDecl])
+ @ ([RawCmmDecl], InfoTableContents)
+ (mkProfLits platform_a5jGa prof_a5jG7)
+ (\ (ds_d5k5C :: ((CmmLit, CmmLit), [RawCmmDecl])) ->
+ case ds_d5k5C of wild_00 { (prof_lits_a5jGD, prof_data_a5jGE) ->
+ letrec {
+ ds_d5k5t :: ([CmmLit], CmmLit)
+ [LclId]
+ ds_d5k5t = mkSRTLit platform_a5jGa info_lbl_a5jG5 srt_a5jG8;
+ srt_label_a5jGF :: [CmmLit]
+ [LclId]
+ srt_label_a5jGF
+ = case ds_d5k5t of wild_00 { (srt_label_a5jGF, srt_bitmap_a5jGG) ->
+ srt_label_a5jGF
+ };
+ srt_bitmap_a5jGG :: CmmLit
+ [LclId]
+ srt_bitmap_a5jGG
+ = case ds_d5k5t of wild_00 { (srt_label_a5jGF, srt_bitmap_a5jGG) ->
+ srt_bitmap_a5jGG
+ }; } in
+ >>=
+ @ UniqSM
+ $dMonad_a5jVB
+ @ (CmmLit, [RawCmmDecl])
+ @ ([RawCmmDecl], InfoTableContents)
+ (mkLivenessBits dflags_a5jG3 frame_a5jGC)
+ (\ (ds_d5k5o :: (CmmLit, [RawCmmDecl])) ->
+ case ds_d5k5o of wild_00
+ { (liveness_lit_a5jGH, liveness_data_a5jGI) ->
+ letrec {
+ rts_tag_a5jGK :: Int
+ [LclId]
+ rts_tag_a5jGK
+ = let {
+ fail_d5k5m :: ghc-prim-0.6.1:GHC.Prim.Void# -> Int
+ [LclId]
+ fail_d5k5m
+ = \ (ds_d5k5n [OS=OneShot]
+ :: ghc-prim-0.6.1:GHC.Prim.Void#) ->
+ let {
+ fail_d5k5k :: ghc-prim-0.6.1:GHC.Prim.Void# -> Int
+ [LclId]
+ fail_d5k5k
+ = \ (ds_d5k5l [OS=OneShot]
+ :: ghc-prim-0.6.1:GHC.Prim.Void#) ->
+ rET_BIG } in
+ case null
+ @ []
+ $dFoldable_a5jVL
+ @ RawCmmDecl
+ liveness_data_a5jGI
+ of wild_00 {
+ False -> fail_d5k5k ghc-prim-0.6.1:GHC.Prim.void#;
+ True -> rET_SMALL
+ } } in
+ let {
+ ds_d5k51 :: Maybe Int
+ [LclId]
+ ds_d5k51 = mb_rts_tag_a5jG9 } in
+ case ds_d5k51 of wild_00 {
+ __DEFAULT -> fail_d5k5m ghc-prim-0.6.1:GHC.Prim.void#;
+ Just tag_a5jGL -> tag_a5jGL
+ }; } in
+ letrec {
+ std_info_a5jGJ :: [CmmLit]
+ [LclId]
+ std_info_a5jGJ
+ = mkStdInfoTable
+ dflags_a5jG3
+ prof_lits_a5jGD
+ rts_tag_a5jGK
+ srt_bitmap_a5jGG
+ liveness_lit_a5jGH; } in
+ return
+ @ UniqSM
+ $dMonad_a5jVT
+ @ ([RawCmmDecl], ([CmmLit], [CmmLit]))
+ (++ @ RawCmmDecl prof_data_a5jGE liveness_data_a5jGI,
+ (std_info_a5jGJ, srt_label_a5jGF))
+ })
+ })
+ } } in
+ let {
+ ds_d5k3T :: SMRep
+ [LclId]
+ ds_d5k3T = smrep_a5jG6 } in
+ case ds_d5k3T of wild_00 {
+ __DEFAULT -> fail_d5k8C ghc-prim-0.6.1:GHC.Prim.void#;
+ RTSRep rts_tag_a5jGA rep_a5jGB ->
+ mkInfoTableContents
+ dflags_a5jG3
+ (let {
+ ds_d5k3W :: SMRep
+ [LclId]
+ ds_d5k3W = rep_a5jGB } in
+ let {
+ ds_d5k42 :: CmmInfoTable
+ [LclId]
+ ds_d5k42 = info_a5jG4 } in
+ case ds_d5k42 of wild_00
+ { CmmInfoTable ds_d5k3X ds_d5k3Y ds_d5k3Z ds_d5k40 ds_d5k41 ->
+ GHC.Cmm.CmmInfoTable ds_d5k3X ds_d5k3W ds_d5k3Z ds_d5k40 ds_d5k41
+ })
+ (GHC.Maybe.Just @ Int rts_tag_a5jGA)
+ }
+ }
+
+-- RHS size: {terms: 196, types: 354, coercions: 12, joins: 0/12}
+mkInfoTable :: DynFlags -> CmmDeclSRTs -> UniqSM [RawCmmDecl]
+[LclIdX]
+mkInfoTable
+ = \ (ds_d5ka0 :: DynFlags)
+ (ds_d5ka1 :: GenCmmDecl RawCmmStatics CmmTopInfo CmmGraph) ->
+ let {
+ dflags_a5jFE :: DynFlags
+ [LclId]
+ dflags_a5jFE = ds_d5ka0 } in
+ let {
+ proc_a5jFF :: CmmDeclSRTs
+ [LclId]
+ proc_a5jFF = ds_d5ka1 } in
+ case ds_d5ka1 of wild_00 {
+ CmmProc infos_a5jFG entry_lbl_a5jFH live_a5jFI blocks_a5jFJ ->
+ letrec {
+ platform_a5jFK :: Platform
+ [LclId]
+ platform_a5jFK = targetPlatform dflags_a5jFE; } in
+ letrec {
+ do_one_info_a5jFL
+ :: (GHC.Cmm.Dataflow.Label.Label, CmmInfoTable)
+ -> UniqSM
+ ([RawCmmDecl], (GHC.Cmm.Dataflow.Label.Label, GenCmmStatics 'True))
+ [LclId]
+ do_one_info_a5jFL
+ = \ (ds_d5kbk :: (GHC.Cmm.Dataflow.Label.Label, CmmInfoTable)) ->
+ case ds_d5kbk of wild_00 { (lbl_a5jFM, itbl_a5jFN) ->
+ >>=
+ @ UniqSM
+ $dMonad_a5jX1
+ @ ([RawCmmDecl], InfoTableContents)
+ @ ([RawCmmDecl],
+ (GHC.Cmm.Dataflow.Label.Label, GenCmmStatics 'True))
+ (mkInfoTableContents
+ dflags_a5jFE itbl_a5jFN (GHC.Maybe.Nothing @ Int))
+ (\ (ds_d5kbn :: ([RawCmmDecl], InfoTableContents)) ->
+ case ds_d5kbn of wild_00 { (top_decls_a5jFO, ds_d5kbx) ->
+ case ds_d5kbx of wild_00 { (std_info_a5jFP, extra_bits_a5jFQ) ->
+ letrec {
+ info_lbl_a5jFR :: CLabel
+ [LclId]
+ info_lbl_a5jFR = cit_lbl itbl_a5jFN; } in
+ letrec {
+ rel_std_info_a5jFS :: [CmmLit]
+ [LclId]
+ rel_std_info_a5jFS
+ = map
+ @ CmmLit
+ @ CmmLit
+ (makeRelativeRefTo platform_a5jFK info_lbl_a5jFR)
+ std_info_a5jFP; } in
+ letrec {
+ rel_extra_bits_a5jFT :: [CmmLit]
+ [LclId]
+ rel_extra_bits_a5jFT
+ = map
+ @ CmmLit
+ @ CmmLit
+ (makeRelativeRefTo platform_a5jFK info_lbl_a5jFR)
+ extra_bits_a5jFQ; } in
+ return
+ @ UniqSM
+ $dMonad_a5jXn
+ @ ([RawCmmDecl],
+ (GHC.Cmm.Dataflow.Label.Label, GenCmmStatics 'True))
+ (top_decls_a5jFO,
+ (lbl_a5jFM,
+ $ @ 'ghc-prim-0.6.1:GHC.Types.LiftedRep
+ @ [CmmStatic]
+ @ (GenCmmStatics 'True)
+ (GHC.Cmm.CmmStaticsRaw @ 'True info_lbl_a5jFR)
+ ($ @ 'ghc-prim-0.6.1:GHC.Types.LiftedRep
+ @ [CmmLit]
+ @ [CmmStatic]
+ (map @ CmmLit @ CmmStatic GHC.Cmm.CmmStaticLit)
+ (++
+ @ CmmLit
+ (reverse @ CmmLit rel_extra_bits_a5jFT)
+ rel_std_info_a5jFS))))
+ }
+ })
+ }; } in
+ let {
+ fail_d5kbi :: ghc-prim-0.6.1:GHC.Prim.Void# -> UniqSM [RawCmmDecl]
+ [LclId]
+ fail_d5kbi
+ = \ (ds_d5kbj [OS=OneShot] :: ghc-prim-0.6.1:GHC.Prim.Void#) ->
+ >>=
+ @ UniqSM
+ $dMonad_a5jYv
+ @ ([[RawCmmDecl]],
+ [(GHC.Cmm.Dataflow.Label.Label, GenCmmStatics 'True)])
+ @ [RawCmmDecl]
+ (fmap
+ @ UniqSM
+ $dFunctor_a5jYz
+ @ [([RawCmmDecl],
+ (GHC.Cmm.Dataflow.Label.Label, GenCmmStatics 'True))]
+ @ ([[RawCmmDecl]],
+ [(GHC.Cmm.Dataflow.Label.Label, GenCmmStatics 'True)])
+ (unzip
+ @ [RawCmmDecl]
+ @ (GHC.Cmm.Dataflow.Label.Label, GenCmmStatics 'True))
+ (mapM
+ @ []
+ $dTraversable_a5jYF
+ @ UniqSM
+ @ (GHC.Cmm.Dataflow.Label.Label, CmmInfoTable)
+ @ ([RawCmmDecl],
+ (GHC.Cmm.Dataflow.Label.Label, GenCmmStatics 'True))
+ $dMonad_a5jYJ
+ do_one_info_a5jFL
+ ((mapToList
+ @ GHC.Cmm.Dataflow.Label.LabelMap
+ $dIsMap_a5jYM
+ @ CmmInfoTable
+ (info_tbls infos_a5jFG))
+ `cast` (([((,)
+ (Sub (GHC.Cmm.Dataflow.Label.D:R:KeyOfLabelMap[0]))
+ <CmmInfoTable>_R)_R])_R
+ :: [(KeyOf GHC.Cmm.Dataflow.Label.LabelMap, CmmInfoTable)]
+ ~R# [(GHC.Cmm.Dataflow.Label.Label, CmmInfoTable)]))))
+ (\ (ds_d5kaZ
+ :: ([[RawCmmDecl]],
+ [(GHC.Cmm.Dataflow.Label.Label, GenCmmStatics 'True)])) ->
+ case ds_d5kaZ of wild_00 { (top_declss_a5jG1, raw_infos_a5jG2) ->
+ return
+ @ UniqSM
+ $dMonad_a5jYQ
+ @ [RawCmmDecl]
+ (++
+ @ RawCmmDecl
+ (concat @ [] @ RawCmmDecl $dFoldable_a5jYV top_declss_a5jG1)
+ (GHC.Base.build
+ @ RawCmmDecl
+ (\ (@ a_d5kaW)
+ (c_d5kaX :: RawCmmDecl -> a_d5kaW -> a_d5kaW)
+ (n_d5kaY :: a_d5kaW) ->
+ c_d5kaX
+ (GHC.Cmm.CmmProc
+ @ RawCmmStatics
+ @ (GHC.Cmm.Dataflow.Label.LabelMap (GenCmmStatics 'True))
+ @ CmmGraph
+ (mapFromList
+ @ GHC.Cmm.Dataflow.Label.LabelMap
+ $dIsMap_a5jZ1
+ @ (GenCmmStatics 'True)
+ (raw_infos_a5jG2
+ `cast` (([((,)
+ (Sub (Sym (GHC.Cmm.Dataflow.Label.D:R:KeyOfLabelMap[0])))
+ <GenCmmStatics 'True>_R)_R])_R
+ :: [(GHC.Cmm.Dataflow.Label.Label,
+ GenCmmStatics 'True)]
+ ~R# [(KeyOf GHC.Cmm.Dataflow.Label.LabelMap,
+ GenCmmStatics 'True)])))
+ entry_lbl_a5jFH
+ live_a5jFI
+ blocks_a5jFJ)
+ n_d5kaY)))
+ }) } in
+ case not (platformTablesNextToCode (targetPlatform dflags_a5jFE))
+ of wild_00 {
+ False -> fail_d5kbi ghc-prim-0.6.1:GHC.Prim.void#;
+ True ->
+ let {
+ ds_d5ka9 :: Maybe CmmInfoTable
+ [LclId]
+ ds_d5ka9 = topInfoTable @ RawCmmStatics @ CmmNode proc_a5jFF } in
+ case ds_d5ka9 of wild_00 {
+ Nothing ->
+ return
+ @ UniqSM
+ $dMonad_a5jXK
+ @ [GenCmmDecl
+ RawCmmStatics
+ (GHC.Cmm.Dataflow.Label.LabelMap RawCmmStatics)
+ CmmGraph]
+ (GHC.Base.build
+ @ (GenCmmDecl
+ RawCmmStatics
+ (GHC.Cmm.Dataflow.Label.LabelMap RawCmmStatics)
+ CmmGraph)
+ (\ (@ a_d5kad)
+ (c_d5kae
+ :: GenCmmDecl
+ RawCmmStatics
+ (GHC.Cmm.Dataflow.Label.LabelMap RawCmmStatics)
+ CmmGraph
+ -> a_d5kad -> a_d5kad)
+ (n_d5kaf :: a_d5kad) ->
+ c_d5kae
+ (GHC.Cmm.CmmProc
+ @ RawCmmStatics
+ @ (GHC.Cmm.Dataflow.Label.LabelMap RawCmmStatics)
+ @ CmmGraph
+ (mapEmpty
+ @ GHC.Cmm.Dataflow.Label.LabelMap $dIsMap_a5jXS @ RawCmmStatics)
+ entry_lbl_a5jFH
+ live_a5jFI
+ blocks_a5jFJ)
+ n_d5kaf));
+ Just info_a5jFU ->
+ case info_a5jFU of wild_00
+ { CmmInfoTable ds_d5kaR ds_d5kaS ds_d5kaT ds_d5kaU ds_d5kaV ->
+ let {
+ info_lbl_a5jFV :: CLabel
+ [LclId]
+ info_lbl_a5jFV = ds_d5kaR } in
+ >>=
+ @ UniqSM
+ $dMonad_a5jXX
+ @ ([RawCmmDecl], InfoTableContents)
+ @ [RawCmmDecl]
+ (mkInfoTableContents
+ dflags_a5jFE info_a5jFU (GHC.Maybe.Nothing @ Int))
+ (\ (ds_d5kas :: ([RawCmmDecl], InfoTableContents)) ->
+ case ds_d5kas of wild_00 { (top_decls_a5jFW, ds_d5kaC) ->
+ case ds_d5kaC of wild_00 { (std_info_a5jFX, extra_bits_a5jFY) ->
+ letrec {
+ rel_extra_bits_a5jG0 :: [CmmLit]
+ [LclId]
+ rel_extra_bits_a5jG0
+ = map
+ @ CmmLit
+ @ CmmLit
+ (makeRelativeRefTo platform_a5jFK info_lbl_a5jFV)
+ extra_bits_a5jFY; } in
+ letrec {
+ rel_std_info_a5jFZ :: [CmmLit]
+ [LclId]
+ rel_std_info_a5jFZ
+ = map
+ @ CmmLit
+ @ CmmLit
+ (makeRelativeRefTo platform_a5jFK info_lbl_a5jFV)
+ std_info_a5jFX; } in
+ return
+ @ UniqSM
+ $dMonad_a5jYe
+ @ [RawCmmDecl]
+ (++
+ @ RawCmmDecl
+ top_decls_a5jFW
+ (GHC.Base.build
+ @ RawCmmDecl
+ (\ (@ a_d5kap)
+ (c_d5kaq :: RawCmmDecl -> a_d5kap -> a_d5kap)
+ (n_d5kar :: a_d5kap) ->
+ c_d5kaq
+ (GHC.Cmm.CmmProc
+ @ RawCmmStatics
+ @ (GHC.Cmm.Dataflow.Label.LabelMap RawCmmStatics)
+ @ CmmGraph
+ (mapEmpty
+ @ GHC.Cmm.Dataflow.Label.LabelMap
+ $dIsMap_a5jYl
+ @ RawCmmStatics)
+ entry_lbl_a5jFH
+ live_a5jFI
+ blocks_a5jFJ)
+ (c_d5kaq
+ (mkRODataLits
+ @ 'True
+ @ (GHC.Cmm.Dataflow.Label.LabelMap RawCmmStatics)
+ @ CmmGraph
+ info_lbl_a5jFV
+ (ghc-prim-0.6.1:GHC.Types.:
+ @ CmmLit
+ (GHC.Cmm.Expr.CmmLabel entry_lbl_a5jFH)
+ (++ @ CmmLit rel_std_info_a5jFZ rel_extra_bits_a5jG0)))
+ n_d5kar))))
+ }
+ })
+ }
+ }
+ };
+ CmmData sec_a5jFC dat_a5jFD ->
+ return
+ @ UniqSM
+ $dMonad_a5jWH
+ @ [GenCmmDecl
+ RawCmmStatics
+ (GHC.Cmm.Dataflow.Label.LabelMap RawCmmStatics)
+ CmmGraph]
+ (GHC.Base.build
+ @ (GenCmmDecl
+ RawCmmStatics
+ (GHC.Cmm.Dataflow.Label.LabelMap RawCmmStatics)
+ CmmGraph)
+ (\ (@ a_d5ka4)
+ (c_d5ka5
+ :: GenCmmDecl
+ RawCmmStatics
+ (GHC.Cmm.Dataflow.Label.LabelMap RawCmmStatics)
+ CmmGraph
+ -> a_d5ka4 -> a_d5ka4)
+ (n_d5ka6 :: a_d5ka4) ->
+ c_d5ka5
+ (GHC.Cmm.CmmData
+ @ RawCmmStatics
+ @ (GHC.Cmm.Dataflow.Label.LabelMap RawCmmStatics)
+ @ CmmGraph
+ sec_a5jFC
+ dat_a5jFD)
+ n_d5ka6))
+ }
+
+-- RHS size: {terms: 91, types: 171, coercions: 0, joins: 0/13}
+cmmToRawCmm
+ :: forall a.
+ DynFlags
+ -> Stream IO CmmGroupSRTs a -> IO (Stream IO RawCmmGroup a)
+[LclIdX]
+cmmToRawCmm
+ = \ (@ a_a5jZ4) ->
+ let {
+ $dMonad_a5k0a :: Monad UniqSM
+ [LclId]
+ $dMonad_a5k0a = $dMonad_a5jQG } in
+ let {
+ $dFoldable_a5k01 :: Foldable []
+ [LclId]
+ $dFoldable_a5k01 = $dFoldable_a5jRE } in
+ let {
+ $dMonadIO_a5jZX :: MonadIO IO
+ [LclId]
+ $dMonadIO_a5jZX = Control.Monad.IO.Class.$fMonadIOIO } in
+ let {
+ $dMonad_a5jZG :: Monad IO
+ [LclId]
+ $dMonad_a5jZG = GHC.Base.$fMonadIO } in
+ let {
+ $dMonad_a5k0d :: Monad IO
+ [LclId]
+ $dMonad_a5k0d = $dMonad_a5jZG } in
+ let {
+ $dMonad_a5k0i :: Monad IO
+ [LclId]
+ $dMonad_a5k0i = $dMonad_a5jZG } in
+ let {
+ $dFunctor_a5k0n :: Functor (Stream IO [RawCmmDecl])
+ [LclId]
+ $dFunctor_a5k0n
+ = GHC.Data.Stream.$fFunctorStream
+ @ IO @ [RawCmmDecl] $dMonad_a5jZG } in
+ let {
+ $dMonad_a5k0A :: Monad IO
+ [LclId]
+ $dMonad_a5k0A = $dMonad_a5jZG } in
+ \ (dflags_a5jFp :: DynFlags)
+ (cmms_a5jFq :: Stream IO CmmGroupSRTs a_a5jZ4) ->
+ letrec {
+ forceRes_a5jFr
+ :: forall (t :: * -> *) a a. Foldable t => (a, t a) -> ()
+ [LclId]
+ forceRes_a5jFr
+ = \ (@ (t_a5jZg :: * -> *))
+ (@ a_a5jZe)
+ (@ a_a5jZl)
+ ($dFoldable_a5jZr :: Foldable t_a5jZg) ->
+ let {
+ $dFoldable_a5jZh :: Foldable t_a5jZg
+ [LclId]
+ $dFoldable_a5jZh = $dFoldable_a5jZr } in
+ letrec {
+ forceRes_a5jZp :: (a_a5jZe, t_a5jZg a_a5jZl) -> ()
+ [LclId]
+ forceRes_a5jZp
+ = \ (ds_d5kbN :: (a_a5jZe, t_a5jZg a_a5jZl)) ->
+ case ds_d5kbN of wild_00 { (uniqs_a5jFs, rawcmms_a5jFt) ->
+ case uniqs_a5jFs of uniqs_a5jFs { __DEFAULT ->
+ foldr
+ @ t_a5jZg
+ $dFoldable_a5jZh
+ @ a_a5jZl
+ @ ()
+ (\ (decl_a5jFu :: a_a5jZl) (r_a5jFv :: ()) ->
+ case decl_a5jFu of decl_a5jFu { __DEFAULT -> r_a5jFv })
+ ghc-prim-0.6.1:GHC.Tuple.()
+ rawcmms_a5jFt
+ }
+ }; } in
+ forceRes_a5jZp; } in
+ >>=
+ @ IO
+ $dMonad_a5jZG
+ @ UniqSupply
+ @ (Stream IO RawCmmGroup a_a5jZ4)
+ (mkSplitUniqSupply (ghc-prim-0.6.1:GHC.Types.C# 'i'#))
+ (\ (uniqs_a5jFw :: UniqSupply) ->
+ letrec {
+ do_one_a5jFx
+ :: UniqSupply -> [CmmDeclSRTs] -> IO (UniqSupply, [RawCmmDecl])
+ [LclId]
+ do_one_a5jFx
+ = \ (uniqs_a5jFy :: UniqSupply) (cmm_a5jFz :: [CmmDeclSRTs]) ->
+ $ @ 'ghc-prim-0.6.1:GHC.Types.LiftedRep
+ @ (IO (UniqSupply, [RawCmmDecl]))
+ @ (IO (UniqSupply, [RawCmmDecl]))
+ (withTimingSilent
+ @ IO
+ @ (UniqSupply, [RawCmmDecl])
+ $dMonadIO_a5jZX
+ dflags_a5jFp
+ (text
+ (ghc-prim-0.6.1:GHC.CString.unpackCString# "Cmm -> Raw Cmm"#))
+ (forceRes_a5jFr @ [] @ UniqSupply @ RawCmmDecl $dFoldable_a5k01))
+ (let {
+ ds_d5kbC :: ([RawCmmDecl], UniqSupply)
+ [LclId]
+ ds_d5kbC
+ = $ @ 'ghc-prim-0.6.1:GHC.Types.LiftedRep
+ @ (UniqSM [RawCmmDecl])
+ @ ([RawCmmDecl], UniqSupply)
+ (initUs @ [RawCmmDecl] uniqs_a5jFy)
+ (concatMapM
+ @ UniqSM
+ @ CmmDeclSRTs
+ @ RawCmmDecl
+ $dMonad_a5k0a
+ (mkInfoTable dflags_a5jFp)
+ cmm_a5jFz) } in
+ case ds_d5kbC of wild_00 { (b_a5jFA, uniqs'_a5jFB) ->
+ return
+ @ IO
+ $dMonad_a5k0d
+ @ (UniqSupply, [RawCmmDecl])
+ (uniqs'_a5jFB, b_a5jFA)
+ }); } in
+ return
+ @ IO
+ $dMonad_a5k0i
+ @ (Stream IO [RawCmmDecl] a_a5jZ4)
+ (<$>
+ @ (Stream IO [RawCmmDecl])
+ @ (UniqSupply, a_a5jZ4)
+ @ a_a5jZ4
+ $dFunctor_a5k0n
+ (snd @ UniqSupply @ a_a5jZ4)
+ (Stream.mapAccumL_
+ @ IO
+ @ UniqSupply
+ @ [CmmDeclSRTs]
+ @ [RawCmmDecl]
+ @ a_a5jZ4
+ $dMonad_a5k0A
+ do_one_a5jFx
+ uniqs_a5jFw
+ cmms_a5jFq)))
+
+-- RHS size: {terms: 8, types: 6, coercions: 0, joins: 0/0}
+mkEmptyContInfoTable :: CLabel -> CmmInfoTable
+[LclIdX]
+mkEmptyContInfoTable
+ = \ (info_lbl_a5jFo :: CLabel) ->
+ GHC.Cmm.CmmInfoTable
+ info_lbl_a5jFo
+ (mkStackRep (ghc-prim-0.6.1:GHC.Types.[] @ Bool))
+ GHC.Cmm.NoProfilingInfo
+ (GHC.Maybe.Nothing @ CLabel)
+ (GHC.Maybe.Nothing
+ @ (GHC.Types.Var.Id, GHC.Types.CostCentre.CostCentreStack))
+
+-- RHS size: {terms: 7, types: 5, coercions: 0, joins: 0/1}
+po_profile :: PtrOpts -> Profile
+[LclIdX[[RecSel]]]
+po_profile
+ = \ (ds_d5kbU :: PtrOpts) ->
+ case ds_d5kbU of wild_00 { PtrOpts ds_d5kbV ds_d5kbW ->
+ let {
+ po_profile_B1 :: Profile
+ [LclId]
+ po_profile_B1 = ds_d5kbV } in
+ po_profile_B1
+ }
+
+-- RHS size: {terms: 7, types: 5, coercions: 0, joins: 0/1}
+po_align_check :: PtrOpts -> Bool
+[LclIdX[[RecSel]]]
+po_align_check
+ = \ (ds_d5kbX :: PtrOpts) ->
+ case ds_d5kbX of wild_00 { PtrOpts ds_d5kbY ds_d5kbZ ->
+ let {
+ po_align_check_B1 :: Bool
+ [LclId]
+ po_align_check_B1 = ds_d5kbZ } in
+ po_align_check_B1
+ }
+end Rec }
+
+
diff --git a/compiler/GHC/Cmm/Info.hs b/compiler/GHC/Cmm/Info.hs
index fa7602057f..e8f8c29595 100644
--- a/compiler/GHC/Cmm/Info.hs
+++ b/compiler/GHC/Cmm/Info.hs
@@ -1,4 +1,6 @@
{-# LANGUAGE CPP #-}
+
+
module GHC.Cmm.Info (
mkEmptyContInfoTable,
cmmToRawCmm,
diff --git a/compiler/GHC/Cmm/Utils.dump-ds b/compiler/GHC/Cmm/Utils.dump-ds
new file mode 100644
index 0000000000..446e12abbc
--- /dev/null
+++ b/compiler/GHC/Cmm/Utils.dump-ds
@@ -0,0 +1,3978 @@
+
+==================== Desugar (after optimization) ====================
+2020-11-24 12:41:53.3740878 UTC
+
+Result size of Desugar (after optimization)
+ = {terms: 1,627, types: 1,401, coercions: 43, joins: 9/24}
+
+-- RHS size: {terms: 16, types: 3, coercions: 0, joins: 0/0}
+slotCmmType :: Platform -> SlotTy -> CmmType
+[LclIdX,
+ Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
+ WorkFree=True, Expandable=True, Guidance=IF_ARGS [0 80] 90 0}]
+slotCmmType
+ = \ (platform_a18g4 :: Platform) (ds_d19ap :: SlotTy) ->
+ case ds_d19ap of {
+ PtrSlot -> gcWord platform_a18g4;
+ WordSlot -> bWord platform_a18g4;
+ Word64Slot -> b64;
+ FloatSlot -> f32;
+ DoubleSlot -> f64
+ }
+
+-- RHS size: {terms: 23, types: 2, coercions: 0, joins: 0/0}
+primElemRepCmmType :: PrimElemRep -> CmmType
+[LclIdX,
+ Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
+ WorkFree=True, Expandable=True, Guidance=IF_ARGS [110] 100 0}]
+primElemRepCmmType
+ = \ (ds_d19a0 :: PrimElemRep) ->
+ case ds_d19a0 of {
+ Int8ElemRep -> b8;
+ Int16ElemRep -> b16;
+ Int32ElemRep -> b32;
+ Int64ElemRep -> b64;
+ Word8ElemRep -> b8;
+ Word16ElemRep -> b16;
+ Word32ElemRep -> b32;
+ Word64ElemRep -> b64;
+ FloatElemRep -> f32;
+ DoubleElemRep -> f64
+ }
+
+-- RHS size: {terms: 48, types: 6, coercions: 0, joins: 0/0}
+primRepCmmType :: Platform -> PrimRep -> CmmType
+[LclIdX,
+ Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
+ WorkFree=True, Expandable=True, Guidance=IF_ARGS [0 330] 430 0}]
+primRepCmmType
+ = \ (platform_a18g1 :: Platform) (ds_d19aE :: PrimRep) ->
+ case ds_d19aE of {
+ VoidRep ->
+ panic
+ @ CmmType
+ (ghc-prim-0.6.1:GHC.CString.unpackCString#
+ "primRepCmmType:VoidRep"#);
+ LiftedRep -> gcWord platform_a18g1;
+ UnliftedRep -> gcWord platform_a18g1;
+ Int8Rep -> b8;
+ Int16Rep -> b16;
+ Int32Rep -> b32;
+ Int64Rep -> b64;
+ IntRep -> bWord platform_a18g1;
+ Word8Rep -> b8;
+ Word16Rep -> b16;
+ Word32Rep -> b32;
+ Word64Rep -> b64;
+ WordRep -> bWord platform_a18g1;
+ AddrRep -> bWord platform_a18g1;
+ FloatRep -> f32;
+ DoubleRep -> f64;
+ VecRep len_a18g2 rep_a18g3 ->
+ vec len_a18g2 (primElemRepCmmType rep_a18g3)
+ }
+
+-- RHS size: {terms: 39, types: 5, coercions: 0, joins: 0/0}
+primRepForeignHint :: PrimRep -> ForeignHint
+[LclIdX,
+ Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
+ WorkFree=True, Expandable=True, Guidance=IF_ARGS [180] 290 160}]
+primRepForeignHint
+ = \ (ds_d199f :: PrimRep) ->
+ case ds_d199f of {
+ VoidRep ->
+ panic
+ @ ForeignHint
+ (ghc-prim-0.6.1:GHC.CString.unpackCString#
+ "primRepForeignHint:VoidRep"#);
+ LiftedRep -> GHC.Cmm.Type.AddrHint;
+ UnliftedRep -> GHC.Cmm.Type.AddrHint;
+ Int8Rep -> GHC.Cmm.Type.SignedHint;
+ Int16Rep -> GHC.Cmm.Type.SignedHint;
+ Int32Rep -> GHC.Cmm.Type.SignedHint;
+ Int64Rep -> GHC.Cmm.Type.SignedHint;
+ IntRep -> GHC.Cmm.Type.SignedHint;
+ Word8Rep -> GHC.Cmm.Type.NoHint;
+ Word16Rep -> GHC.Cmm.Type.NoHint;
+ Word32Rep -> GHC.Cmm.Type.NoHint;
+ Word64Rep -> GHC.Cmm.Type.NoHint;
+ WordRep -> GHC.Cmm.Type.NoHint;
+ AddrRep -> GHC.Cmm.Type.AddrHint;
+ FloatRep -> GHC.Cmm.Type.NoHint;
+ DoubleRep -> GHC.Cmm.Type.NoHint;
+ VecRep _ [Occ=Dead] _ [Occ=Dead] -> GHC.Cmm.Type.NoHint
+ }
+
+-- RHS size: {terms: 13, types: 2, coercions: 0, joins: 0/0}
+slotForeignHint :: SlotTy -> ForeignHint
+[LclIdX,
+ Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
+ WorkFree=True, Expandable=True, Guidance=IF_ARGS [60] 50 50}]
+slotForeignHint
+ = \ (ds_d1990 :: SlotTy) ->
+ case ds_d1990 of {
+ PtrSlot -> GHC.Cmm.Type.AddrHint;
+ WordSlot -> GHC.Cmm.Type.NoHint;
+ Word64Slot -> GHC.Cmm.Type.NoHint;
+ FloatSlot -> GHC.Cmm.Type.NoHint;
+ DoubleSlot -> GHC.Cmm.Type.NoHint
+ }
+
+-- RHS size: {terms: 5, types: 1, coercions: 0, joins: 0/0}
+zeroCLit :: Platform -> CmmLit
+[LclIdX,
+ Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
+ WorkFree=True, Expandable=True, Guidance=IF_ARGS [0] 150 0}]
+zeroCLit
+ = \ (platform_a18gb :: Platform) ->
+ GHC.Cmm.Expr.$WCmmInt 0 (wordWidth platform_a18gb)
+
+-- RHS size: {terms: 4, types: 1, coercions: 0, joins: 0/0}
+zeroExpr :: Platform -> CmmExpr
+[LclIdX,
+ Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
+ WorkFree=True, Expandable=True, Guidance=IF_ARGS [0] 30 20}]
+zeroExpr
+ = \ (platform_a18gc :: Platform) ->
+ GHC.Cmm.Expr.CmmLit (zeroCLit platform_a18gc)
+
+-- RHS size: {terms: 6, types: 2, coercions: 0, joins: 0/0}
+mkWordCLit :: Platform -> Integer -> CmmLit
+[LclIdX,
+ Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
+ WorkFree=True, Expandable=True, Guidance=IF_ARGS [0 0] 50 0}]
+mkWordCLit
+ = \ (platform_a18gd :: Platform) (wd_a18ge :: Integer) ->
+ GHC.Cmm.Expr.$WCmmInt wd_a18ge (wordWidth platform_a18gd)
+
+-- RHS size: {terms: 32, types: 35, coercions: 0, joins: 0/0}
+mkByteStringCLit
+ :: forall (raw :: Bool) info stmt.
+ CLabel
+ -> ByteString -> (CmmLit, GenCmmDecl (GenCmmStatics raw) info stmt)
+[LclIdX,
+ Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
+ WorkFree=True, Expandable=True, Guidance=IF_ARGS [0 0] 320 30}]
+mkByteStringCLit
+ = \ (@ (raw_a18Hg :: Bool))
+ (@ info_a18Hh)
+ (@ stmt_a18Hi)
+ (lbl_a18gf :: CLabel)
+ (bytes_a18gg :: ByteString) ->
+ (GHC.Cmm.Expr.CmmLabel lbl_a18gf,
+ $ @ 'ghc-prim-0.6.1:GHC.Types.LiftedRep
+ @ (GenCmmStatics raw_a18Hg)
+ @ (GenCmmDecl (GenCmmStatics raw_a18Hg) info_a18Hh stmt_a18Hi)
+ (GHC.Cmm.CmmData
+ @ (GenCmmStatics raw_a18Hg)
+ @ info_a18Hh
+ @ stmt_a18Hi
+ (GHC.Cmm.Section
+ (case BS.elem
+ (fromInteger @ GHC.Word.Word8 GHC.Word.$fNumWord8 0) bytes_a18gg
+ of {
+ False -> GHC.Cmm.CString;
+ True -> GHC.Cmm.ReadOnlyData
+ })
+ lbl_a18gf))
+ (GHC.Cmm.CmmStaticsRaw
+ @ raw_a18Hg
+ lbl_a18gf
+ (GHC.Base.build
+ @ CmmStatic
+ (\ (@ a_d195Z)
+ (c_d1960 :: CmmStatic -> a_d195Z -> a_d195Z)
+ (n_d1961 :: a_d195Z) ->
+ c_d1960 (GHC.Cmm.CmmString bytes_a18gg) n_d1961))))
+
+-- RHS size: {terms: 22, types: 25, coercions: 0, joins: 0/0}
+mkFileEmbedLit
+ :: forall (raw :: Bool) info stmt.
+ CLabel
+ -> FilePath -> (CmmLit, GenCmmDecl (GenCmmStatics raw) info stmt)
+[LclIdX,
+ Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
+ WorkFree=True, Expandable=True, Guidance=IF_ARGS [0 0] 110 30}]
+mkFileEmbedLit
+ = \ (@ (raw_a18H8 :: Bool))
+ (@ info_a18H9)
+ (@ stmt_a18Ha)
+ (lbl_a18gi :: CLabel)
+ (path_a18gj :: FilePath) ->
+ (GHC.Cmm.Expr.CmmLabel lbl_a18gi,
+ GHC.Cmm.CmmData
+ @ (GenCmmStatics raw_a18H8)
+ @ info_a18H9
+ @ stmt_a18Ha
+ (GHC.Cmm.Section GHC.Cmm.ReadOnlyData lbl_a18gi)
+ (GHC.Cmm.CmmStaticsRaw
+ @ raw_a18H8
+ lbl_a18gi
+ (GHC.Base.build
+ @ CmmStatic
+ (\ (@ a_d195W)
+ (c_d195X :: CmmStatic -> a_d195W -> a_d195W)
+ (n_d195Y :: a_d195W) ->
+ c_d195X (GHC.Cmm.CmmFileEmbed path_a18gj) n_d195Y))))
+
+-- RHS size: {terms: 14, types: 21, coercions: 0, joins: 0/0}
+mkDataLits
+ :: forall (raw :: Bool) info stmt.
+ Section
+ -> CLabel -> [CmmLit] -> GenCmmDecl (GenCmmStatics raw) info stmt
+[LclIdX,
+ Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
+ WorkFree=True, Expandable=True, Guidance=IF_ARGS [0 0 0] 80 30}]
+mkDataLits
+ = \ (@ (raw_a18Gf :: Bool))
+ (@ info_a18Gg)
+ (@ stmt_a18Gh)
+ (section_a18gk :: Section)
+ (lbl_a18gl :: CLabel)
+ (lits_a18gm :: [CmmLit]) ->
+ GHC.Cmm.CmmData
+ @ (GenCmmStatics raw_a18Gf)
+ @ info_a18Gg
+ @ stmt_a18Gh
+ section_a18gk
+ ($ @ 'ghc-prim-0.6.1:GHC.Types.LiftedRep
+ @ [CmmStatic]
+ @ (GenCmmStatics raw_a18Gf)
+ (GHC.Cmm.CmmStaticsRaw @ raw_a18Gf lbl_a18gl)
+ (map @ CmmLit @ CmmStatic GHC.Cmm.CmmStaticLit lits_a18gm))
+
+-- RHS size: {terms: 7, types: 2, coercions: 0, joins: 0/0}
+mkStgWordCLit :: Platform -> StgWord -> CmmLit
+[LclIdX,
+ Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
+ WorkFree=True, Expandable=True, Guidance=IF_ARGS [0 0] 70 0}]
+mkStgWordCLit
+ = \ (platform_a18gr :: Platform) (wd_a18gs :: StgWord) ->
+ GHC.Cmm.Expr.$WCmmInt
+ (fromStgWord wd_a18gs) (wordWidth platform_a18gr)
+
+-- RHS size: {terms: 4, types: 1, coercions: 0, joins: 0/0}
+mkLblExpr :: CLabel -> CmmExpr
+[LclIdX,
+ Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
+ WorkFree=True, Expandable=True,
+ Guidance=ALWAYS_IF(arity=1,unsat_ok=True,boring_ok=True)}]
+mkLblExpr
+ = \ (lbl_a18gy :: CLabel) ->
+ GHC.Cmm.Expr.CmmLit (GHC.Cmm.Expr.CmmLabel lbl_a18gy)
+
+-- RHS size: {terms: 14, types: 5, coercions: 0, joins: 0/0}
+cmmRegOff :: CmmReg -> Int -> CmmExpr
+[LclIdX,
+ Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
+ WorkFree=True, Expandable=True, Guidance=IF_ARGS [0 20] 80 0}]
+cmmRegOff
+ = \ (reg_a18gV :: CmmReg) (ds_d18ZX :: Int) ->
+ case ds_d18ZX of { ghc-prim-0.6.1:GHC.Types.I# ds_d1904 ->
+ case ds_d1904 of {
+ __DEFAULT -> GHC.Cmm.Expr.$WCmmRegOff reg_a18gV ds_d18ZX;
+ 0# -> GHC.Cmm.Expr.$WCmmReg reg_a18gV
+ }
+ }
+
+-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
+cmmRegOffB :: CmmReg -> ByteOff -> CmmExpr
+[LclIdX,
+ Unf=Unf{Src=<vanilla>, TopLvl=True, Value=False, ConLike=False,
+ WorkFree=True, Expandable=True,
+ Guidance=ALWAYS_IF(arity=0,unsat_ok=True,boring_ok=True)}]
+cmmRegOffB = cmmRegOff
+
+-- RHS size: {terms: 14, types: 5, coercions: 0, joins: 0/0}
+cmmLabelOff :: CLabel -> Int -> CmmLit
+[LclIdX,
+ Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
+ WorkFree=True, Expandable=True, Guidance=IF_ARGS [0 20] 50 50}]
+cmmLabelOff
+ = \ (lbl_a18hc :: CLabel) (ds_d18YT :: Int) ->
+ case ds_d18YT of { ghc-prim-0.6.1:GHC.Types.I# ds_d18Z0 ->
+ case ds_d18Z0 of {
+ __DEFAULT -> GHC.Cmm.Expr.CmmLabelOff lbl_a18hc ds_d18YT;
+ 0# -> GHC.Cmm.Expr.CmmLabel lbl_a18hc
+ }
+ }
+
+-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
+cmmLabelOffB :: CLabel -> ByteOff -> CmmLit
+[LclIdX,
+ Unf=Unf{Src=<vanilla>, TopLvl=True, Value=False, ConLike=False,
+ WorkFree=True, Expandable=True,
+ Guidance=ALWAYS_IF(arity=0,unsat_ok=True,boring_ok=True)}]
+cmmLabelOffB = cmmLabelOff
+
+-- RHS size: {terms: 15, types: 10, coercions: 0, joins: 0/0}
+cmmOrWord :: Platform -> CmmExpr -> CmmExpr -> CmmExpr
+[LclIdX,
+ Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
+ WorkFree=True, Expandable=True, Guidance=IF_ARGS [0 0 0] 110 30}]
+cmmOrWord
+ = \ (platform_a18hT :: Platform)
+ (e1_a18hU :: CmmExpr)
+ (e2_a18hV :: CmmExpr) ->
+ GHC.Cmm.Expr.CmmMachOp
+ (mo_wordOr platform_a18hT)
+ (GHC.Base.build
+ @ CmmExpr
+ (\ (@ a_d18YQ)
+ (c_d18YR :: CmmExpr -> a_d18YQ -> a_d18YQ)
+ (n_d18YS :: a_d18YQ) ->
+ c_d18YR e1_a18hU (c_d18YR e2_a18hV n_d18YS)))
+
+-- RHS size: {terms: 15, types: 10, coercions: 0, joins: 0/0}
+cmmAndWord :: Platform -> CmmExpr -> CmmExpr -> CmmExpr
+[LclIdX,
+ Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
+ WorkFree=True, Expandable=True, Guidance=IF_ARGS [0 0 0] 110 30}]
+cmmAndWord
+ = \ (platform_a18hW :: Platform)
+ (e1_a18hX :: CmmExpr)
+ (e2_a18hY :: CmmExpr) ->
+ GHC.Cmm.Expr.CmmMachOp
+ (mo_wordAnd platform_a18hW)
+ (GHC.Base.build
+ @ CmmExpr
+ (\ (@ a_d18YN)
+ (c_d18YO :: CmmExpr -> a_d18YN -> a_d18YN)
+ (n_d18YP :: a_d18YN) ->
+ c_d18YO e1_a18hX (c_d18YO e2_a18hY n_d18YP)))
+
+-- RHS size: {terms: 15, types: 10, coercions: 0, joins: 0/0}
+cmmNeWord :: Platform -> CmmExpr -> CmmExpr -> CmmExpr
+[LclIdX,
+ Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
+ WorkFree=True, Expandable=True, Guidance=IF_ARGS [0 0 0] 110 30}]
+cmmNeWord
+ = \ (platform_a18hZ :: Platform)
+ (e1_a18i0 :: CmmExpr)
+ (e2_a18i1 :: CmmExpr) ->
+ GHC.Cmm.Expr.CmmMachOp
+ (mo_wordNe platform_a18hZ)
+ (GHC.Base.build
+ @ CmmExpr
+ (\ (@ a_d18YK)
+ (c_d18YL :: CmmExpr -> a_d18YK -> a_d18YK)
+ (n_d18YM :: a_d18YK) ->
+ c_d18YL e1_a18i0 (c_d18YL e2_a18i1 n_d18YM)))
+
+-- RHS size: {terms: 15, types: 10, coercions: 0, joins: 0/0}
+cmmEqWord :: Platform -> CmmExpr -> CmmExpr -> CmmExpr
+[LclIdX,
+ Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
+ WorkFree=True, Expandable=True, Guidance=IF_ARGS [0 0 0] 110 30}]
+cmmEqWord
+ = \ (platform_a18i2 :: Platform)
+ (e1_a18i3 :: CmmExpr)
+ (e2_a18i4 :: CmmExpr) ->
+ GHC.Cmm.Expr.CmmMachOp
+ (mo_wordEq platform_a18i2)
+ (GHC.Base.build
+ @ CmmExpr
+ (\ (@ a_d18YH)
+ (c_d18YI :: CmmExpr -> a_d18YH -> a_d18YH)
+ (n_d18YJ :: a_d18YH) ->
+ c_d18YI e1_a18i3 (c_d18YI e2_a18i4 n_d18YJ)))
+
+-- RHS size: {terms: 15, types: 10, coercions: 0, joins: 0/0}
+cmmULtWord :: Platform -> CmmExpr -> CmmExpr -> CmmExpr
+[LclIdX,
+ Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
+ WorkFree=True, Expandable=True, Guidance=IF_ARGS [0 0 0] 110 30}]
+cmmULtWord
+ = \ (platform_a18i5 :: Platform)
+ (e1_a18i6 :: CmmExpr)
+ (e2_a18i7 :: CmmExpr) ->
+ GHC.Cmm.Expr.CmmMachOp
+ (mo_wordULt platform_a18i5)
+ (GHC.Base.build
+ @ CmmExpr
+ (\ (@ a_d18YE)
+ (c_d18YF :: CmmExpr -> a_d18YE -> a_d18YE)
+ (n_d18YG :: a_d18YE) ->
+ c_d18YF e1_a18i6 (c_d18YF e2_a18i7 n_d18YG)))
+
+-- RHS size: {terms: 15, types: 10, coercions: 0, joins: 0/0}
+cmmUGeWord :: Platform -> CmmExpr -> CmmExpr -> CmmExpr
+[LclIdX,
+ Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
+ WorkFree=True, Expandable=True, Guidance=IF_ARGS [0 0 0] 110 30}]
+cmmUGeWord
+ = \ (platform_a18i8 :: Platform)
+ (e1_a18i9 :: CmmExpr)
+ (e2_a18ia :: CmmExpr) ->
+ GHC.Cmm.Expr.CmmMachOp
+ (mo_wordUGe platform_a18i8)
+ (GHC.Base.build
+ @ CmmExpr
+ (\ (@ a_d18YB)
+ (c_d18YC :: CmmExpr -> a_d18YB -> a_d18YB)
+ (n_d18YD :: a_d18YB) ->
+ c_d18YC e1_a18i9 (c_d18YC e2_a18ia n_d18YD)))
+
+-- RHS size: {terms: 15, types: 10, coercions: 0, joins: 0/0}
+cmmUGtWord :: Platform -> CmmExpr -> CmmExpr -> CmmExpr
+[LclIdX,
+ Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
+ WorkFree=True, Expandable=True, Guidance=IF_ARGS [0 0 0] 110 30}]
+cmmUGtWord
+ = \ (platform_a18ib :: Platform)
+ (e1_a18ic :: CmmExpr)
+ (e2_a18id :: CmmExpr) ->
+ GHC.Cmm.Expr.CmmMachOp
+ (mo_wordUGt platform_a18ib)
+ (GHC.Base.build
+ @ CmmExpr
+ (\ (@ a_d18Yy)
+ (c_d18Yz :: CmmExpr -> a_d18Yy -> a_d18Yy)
+ (n_d18YA :: a_d18Yy) ->
+ c_d18Yz e1_a18ic (c_d18Yz e2_a18id n_d18YA)))
+
+-- RHS size: {terms: 15, types: 10, coercions: 0, joins: 0/0}
+cmmSLtWord :: Platform -> CmmExpr -> CmmExpr -> CmmExpr
+[LclIdX,
+ Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
+ WorkFree=True, Expandable=True, Guidance=IF_ARGS [0 0 0] 110 30}]
+cmmSLtWord
+ = \ (platform_a18ie :: Platform)
+ (e1_a18if :: CmmExpr)
+ (e2_a18ig :: CmmExpr) ->
+ GHC.Cmm.Expr.CmmMachOp
+ (mo_wordSLt platform_a18ie)
+ (GHC.Base.build
+ @ CmmExpr
+ (\ (@ a_d18Yv)
+ (c_d18Yw :: CmmExpr -> a_d18Yv -> a_d18Yv)
+ (n_d18Yx :: a_d18Yv) ->
+ c_d18Yw e1_a18if (c_d18Yw e2_a18ig n_d18Yx)))
+
+-- RHS size: {terms: 15, types: 10, coercions: 0, joins: 0/0}
+cmmUShrWord :: Platform -> CmmExpr -> CmmExpr -> CmmExpr
+[LclIdX,
+ Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
+ WorkFree=True, Expandable=True, Guidance=IF_ARGS [0 0 0] 110 30}]
+cmmUShrWord
+ = \ (platform_a18ih :: Platform)
+ (e1_a18ii :: CmmExpr)
+ (e2_a18ij :: CmmExpr) ->
+ GHC.Cmm.Expr.CmmMachOp
+ (mo_wordUShr platform_a18ih)
+ (GHC.Base.build
+ @ CmmExpr
+ (\ (@ a_d18Ys)
+ (c_d18Yt :: CmmExpr -> a_d18Ys -> a_d18Ys)
+ (n_d18Yu :: a_d18Ys) ->
+ c_d18Yt e1_a18ii (c_d18Yt e2_a18ij n_d18Yu)))
+
+-- RHS size: {terms: 15, types: 10, coercions: 0, joins: 0/0}
+cmmAddWord :: Platform -> CmmExpr -> CmmExpr -> CmmExpr
+[LclIdX,
+ Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
+ WorkFree=True, Expandable=True, Guidance=IF_ARGS [0 0 0] 110 30}]
+cmmAddWord
+ = \ (platform_a18ik :: Platform)
+ (e1_a18il :: CmmExpr)
+ (e2_a18im :: CmmExpr) ->
+ GHC.Cmm.Expr.CmmMachOp
+ (mo_wordAdd platform_a18ik)
+ (GHC.Base.build
+ @ CmmExpr
+ (\ (@ a_d18Yp)
+ (c_d18Yq :: CmmExpr -> a_d18Yp -> a_d18Yp)
+ (n_d18Yr :: a_d18Yp) ->
+ c_d18Yq e1_a18il (c_d18Yq e2_a18im n_d18Yr)))
+
+-- RHS size: {terms: 15, types: 10, coercions: 0, joins: 0/0}
+cmmSubWord :: Platform -> CmmExpr -> CmmExpr -> CmmExpr
+[LclIdX,
+ Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
+ WorkFree=True, Expandable=True, Guidance=IF_ARGS [0 0 0] 110 30}]
+cmmSubWord
+ = \ (platform_a18in :: Platform)
+ (e1_a18io :: CmmExpr)
+ (e2_a18ip :: CmmExpr) ->
+ GHC.Cmm.Expr.CmmMachOp
+ (mo_wordSub platform_a18in)
+ (GHC.Base.build
+ @ CmmExpr
+ (\ (@ a_d18Ym)
+ (c_d18Yn :: CmmExpr -> a_d18Ym -> a_d18Ym)
+ (n_d18Yo :: a_d18Ym) ->
+ c_d18Yn e1_a18io (c_d18Yn e2_a18ip n_d18Yo)))
+
+-- RHS size: {terms: 15, types: 10, coercions: 0, joins: 0/0}
+cmmMulWord :: Platform -> CmmExpr -> CmmExpr -> CmmExpr
+[LclIdX,
+ Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
+ WorkFree=True, Expandable=True, Guidance=IF_ARGS [0 0 0] 110 30}]
+cmmMulWord
+ = \ (platform_a18iq :: Platform)
+ (e1_a18ir :: CmmExpr)
+ (e2_a18is :: CmmExpr) ->
+ GHC.Cmm.Expr.CmmMachOp
+ (mo_wordMul platform_a18iq)
+ (GHC.Base.build
+ @ CmmExpr
+ (\ (@ a_d18Yj)
+ (c_d18Yk :: CmmExpr -> a_d18Yj -> a_d18Yj)
+ (n_d18Yl :: a_d18Yj) ->
+ c_d18Yk e1_a18ir (c_d18Yk e2_a18is n_d18Yl)))
+
+-- RHS size: {terms: 15, types: 10, coercions: 0, joins: 0/0}
+cmmQuotWord :: Platform -> CmmExpr -> CmmExpr -> CmmExpr
+[LclIdX,
+ Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
+ WorkFree=True, Expandable=True, Guidance=IF_ARGS [0 0 0] 110 30}]
+cmmQuotWord
+ = \ (platform_a18it :: Platform)
+ (e1_a18iu :: CmmExpr)
+ (e2_a18iv :: CmmExpr) ->
+ GHC.Cmm.Expr.CmmMachOp
+ (mo_wordUQuot platform_a18it)
+ (GHC.Base.build
+ @ CmmExpr
+ (\ (@ a_d18Yg)
+ (c_d18Yh :: CmmExpr -> a_d18Yg -> a_d18Yg)
+ (n_d18Yi :: a_d18Yg) ->
+ c_d18Yh e1_a18iu (c_d18Yh e2_a18iv n_d18Yi)))
+
+-- RHS size: {terms: 19, types: 9, coercions: 0, joins: 0/1}
+cmmMkAssign
+ :: Platform -> CmmExpr -> Unique -> (CmmNode O O, CmmExpr)
+[LclIdX,
+ Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
+ WorkFree=True, Expandable=True, Guidance=IF_ARGS [0 0 0] 160 30}]
+cmmMkAssign
+ = \ (platform_a18iE :: Platform)
+ (expr_a18iF :: CmmExpr)
+ (uq_a18iG :: Unique) ->
+ case cmmExprType platform_a18iE expr_a18iF of ty_a18iH
+ { __DEFAULT ->
+ let {
+ reg_a18iI :: CmmReg
+ [LclId,
+ Unf=Unf{Src=<vanilla>, TopLvl=False, Value=False, ConLike=False,
+ WorkFree=False, Expandable=False, Guidance=IF_ARGS [] 50 0}]
+ reg_a18iI
+ = GHC.Cmm.Expr.$WCmmLocal
+ (GHC.Cmm.Expr.$WLocalReg uq_a18iG ty_a18iH) } in
+ (GHC.Cmm.Node.$WCmmAssign reg_a18iI expr_a18iF,
+ GHC.Cmm.Expr.$WCmmReg reg_a18iI)
+ }
+
+-- RHS size: {terms: 17, types: 14, coercions: 0, joins: 0/0}
+isTrivialCmmExpr :: CmmExpr -> Bool
+[LclIdX,
+ Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
+ WorkFree=True, Expandable=True, Guidance=IF_ARGS [70] 190 50}]
+isTrivialCmmExpr
+ = \ (ds_d18UZ :: CmmExpr) ->
+ case ds_d18UZ of {
+ CmmLit _ [Occ=Dead] -> ghc-prim-0.6.1:GHC.Types.True;
+ CmmLoad _ [Occ=Dead] _ [Occ=Dead] ->
+ ghc-prim-0.6.1:GHC.Types.False;
+ CmmReg _ [Occ=Dead] -> ghc-prim-0.6.1:GHC.Types.True;
+ CmmMachOp _ [Occ=Dead] _ [Occ=Dead] ->
+ ghc-prim-0.6.1:GHC.Types.False;
+ CmmStackSlot _ [Occ=Dead] _ [Occ=Dead] ->
+ panic
+ @ Bool
+ (ghc-prim-0.6.1:GHC.CString.unpackCString#
+ "isTrivialCmmExpr CmmStackSlot"#);
+ CmmRegOff _ [Occ=Dead] _ [Occ=Dead] ->
+ ghc-prim-0.6.1:GHC.Types.True
+ }
+
+-- RHS size: {terms: 7, types: 3, coercions: 0, joins: 0/0}
+isLit :: CmmExpr -> Bool
+[LclIdX,
+ Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
+ WorkFree=True, Expandable=True,
+ Guidance=ALWAYS_IF(arity=1,unsat_ok=True,boring_ok=True)}]
+isLit
+ = \ (ds_d18Rl :: CmmExpr) ->
+ case ds_d18Rl of {
+ __DEFAULT -> ghc-prim-0.6.1:GHC.Types.False;
+ CmmLit _ [Occ=Dead] -> ghc-prim-0.6.1:GHC.Types.True
+ }
+
+-- RHS size: {terms: 8, types: 5, coercions: 0, joins: 0/0}
+isComparisonExpr :: CmmExpr -> Bool
+[LclIdX,
+ Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
+ WorkFree=True, Expandable=True, Guidance=IF_ARGS [30] 40 10}]
+isComparisonExpr
+ = \ (ds_d18R8 :: CmmExpr) ->
+ case ds_d18R8 of {
+ __DEFAULT -> ghc-prim-0.6.1:GHC.Types.False;
+ CmmMachOp op_a18iL _ [Occ=Dead] -> isComparisonMachOp op_a18iL
+ }
+
+-- RHS size: {terms: 10, types: 19, coercions: 0, joins: 0/0}
+modifyGraph
+ :: forall (n :: Extensibility -> Extensibility -> *)
+ (n' :: Extensibility -> Extensibility -> *).
+ (Graph n C C -> Graph n' C C) -> GenCmmGraph n -> GenCmmGraph n'
+[LclIdX,
+ Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
+ WorkFree=True, Expandable=True, Guidance=IF_ARGS [60 0] 70 30}]
+modifyGraph
+ = \ (@ (n_a18Cl :: Extensibility -> Extensibility -> *))
+ (@ (n'_a18Cm :: Extensibility -> Extensibility -> *))
+ (f_a18jm :: Graph n_a18Cl C C -> Graph n'_a18Cm C C)
+ (g_a18jn :: GenCmmGraph n_a18Cl) ->
+ GHC.Cmm.CmmGraph
+ @ n'_a18Cm
+ (g_entry @ n_a18Cl g_a18jn)
+ (f_a18jm (g_graph @ n_a18Cl g_a18jn))
+
+-- RHS size: {terms: 4, types: 14, coercions: 0, joins: 0/0}
+mapGraphNodes1
+ :: (forall (e :: Extensibility) (x :: Extensibility).
+ CmmNode e x -> CmmNode e x)
+ -> CmmGraph -> CmmGraph
+[LclIdX,
+ Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
+ WorkFree=True, Expandable=True, Guidance=IF_ARGS [0] 40 0}]
+mapGraphNodes1
+ = \ (f_a18jS
+ :: forall (e :: Extensibility) (x :: Extensibility).
+ CmmNode e x -> CmmNode e x) ->
+ modifyGraph
+ @ CmmNode @ CmmNode (mapGraph @ CmmNode @ CmmNode @ C @ C f_a18jS)
+
+-- RHS size: {terms: 27, types: 57, coercions: 0, joins: 1/1}
+toBlockMap :: CmmGraph -> LabelMap CmmBlock
+[LclIdX,
+ Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
+ WorkFree=True, Expandable=True, Guidance=IF_ARGS [20] 292 0}]
+toBlockMap
+ = \ (ds_d18JV :: GenCmmGraph CmmNode) ->
+ join {
+ fail_d18LC :: ghc-prim-0.6.1:GHC.Prim.Void# -> LabelMap CmmBlock
+ [LclId[JoinId(1)],
+ Str=<L,U>,
+ Unf=Unf{Src=<vanilla>, TopLvl=False, Value=True, ConLike=True,
+ WorkFree=True, Expandable=True, Guidance=IF_ARGS [0] 210 0}]
+ fail_d18LC _ [Occ=Dead, OS=OneShot]
+ = Control.Exception.Base.patError
+ @ 'ghc-prim-0.6.1:GHC.Types.LiftedRep
+ @ (LabelMap CmmBlock)
+ "E:\\ghc_inferTags\\compiler\\GHC\\Cmm\\Utils.hs:525:1-67|function toBlockMap"# } in
+ case ds_d18JV of { CmmGraph _ [Occ=Dead] ds_d18Lz ->
+ case ds_d18Lz of {
+ __DEFAULT -> jump fail_d18LC ghc-prim-0.6.1:GHC.Prim.void#;
+ GMany ds_d18LA body_a18jo ds_d18LB ->
+ case ds_d18LA of {
+ __DEFAULT -> jump fail_d18LC ghc-prim-0.6.1:GHC.Prim.void#;
+ NothingO co_a18zq ->
+ case ds_d18LB of {
+ __DEFAULT -> jump fail_d18LC ghc-prim-0.6.1:GHC.Prim.void#;
+ NothingO co_a18zr -> body_a18jo
+ }
+ }
+ }
+ }
+
+-- RHS size: {terms: 8, types: 16, coercions: 0, joins: 0/0}
+ofBlockMap :: BlockId -> LabelMap CmmBlock -> CmmGraph
+[LclIdX,
+ Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
+ WorkFree=True, Expandable=True, Guidance=IF_ARGS [0 0] 50 30}]
+ofBlockMap
+ = \ (entry_a18jp :: BlockId)
+ (bodyMap_a18jq :: LabelMap CmmBlock) ->
+ GHC.Cmm.CmmGraph
+ @ CmmNode
+ entry_a18jp
+ (GHC.Cmm.Dataflow.Graph.$WGMany
+ @ 'Closed
+ @ Block
+ @ CmmNode
+ @ 'Closed
+ (GHC.Cmm.Dataflow.Block.$WNothingO @ (Block CmmNode O C))
+ bodyMap_a18jq
+ (GHC.Cmm.Dataflow.Block.$WNothingO @ (Block CmmNode C O)))
+
+-- RHS size: {terms: 18, types: 38, coercions: 17, joins: 0/0}
+blockTicks :: Block CmmNode C C -> [CmmTickish]
+[LclIdX,
+ Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
+ WorkFree=True, Expandable=True, Guidance=IF_ARGS [0] 120 0}]
+blockTicks
+ = \ (b_a18jX :: Block CmmNode C C) ->
+ $ @ 'ghc-prim-0.6.1:GHC.Types.LiftedRep
+ @ [CmmTickish]
+ @ [CmmTickish]
+ (reverse @ CmmTickish)
+ ((foldBlockNodesF
+ @ CmmNode
+ @ [CmmTickish]
+ (\ (@ (e_a18yn :: Extensibility))
+ (@ (x_a18yo :: Extensibility))
+ (ds_d18J1 :: CmmNode e_a18yn x_a18yo)
+ (ts_a18k2 :: [CmmTickish]) ->
+ case ds_d18J1 of {
+ __DEFAULT -> ts_a18k2;
+ CmmTick co_a18y3 co_a18y4 t_a18k1 ->
+ ghc-prim-0.6.1:GHC.Types.: @ CmmTickish t_a18k1 ts_a18k2
+ })
+ @ C
+ @ C
+ b_a18jX
+ ((ghc-prim-0.6.1:GHC.Types.[] @ CmmTickish)
+ `cast` (Sub (Sym (GHC.Cmm.Dataflow.Block.D:R:IndexedCOkCloseda_b[0]
+ <*>_N <[CmmTickish]>_N <[CmmTickish]>_N))
+ :: [CmmTickish] ~R# IndexedCO C [CmmTickish] [CmmTickish])))
+ `cast` (Sub (GHC.Cmm.Dataflow.Block.D:R:IndexedCOkCloseda_b[0]
+ <*>_N <[CmmTickish]>_N <[CmmTickish]>_N)
+ :: IndexedCO C [CmmTickish] [CmmTickish] ~R# [CmmTickish]))
+
+-- RHS size: {terms: 2, types: 0, coercions: 0, joins: 0/0}
+baseExpr :: CmmExpr
+[LclIdX,
+ Unf=Unf{Src=<vanilla>, TopLvl=True, Value=False, ConLike=False,
+ WorkFree=False, Expandable=False, Guidance=IF_ARGS [] 20 0}]
+baseExpr = GHC.Cmm.Expr.$WCmmReg baseReg
+
+-- RHS size: {terms: 2, types: 0, coercions: 0, joins: 0/0}
+spExpr :: CmmExpr
+[LclIdX,
+ Unf=Unf{Src=<vanilla>, TopLvl=True, Value=False, ConLike=False,
+ WorkFree=False, Expandable=False, Guidance=IF_ARGS [] 20 0}]
+spExpr = GHC.Cmm.Expr.$WCmmReg spReg
+
+-- RHS size: {terms: 2, types: 0, coercions: 0, joins: 0/0}
+spLimExpr :: CmmExpr
+[LclIdX,
+ Unf=Unf{Src=<vanilla>, TopLvl=True, Value=False, ConLike=False,
+ WorkFree=False, Expandable=False, Guidance=IF_ARGS [] 20 0}]
+spLimExpr = GHC.Cmm.Expr.$WCmmReg spLimReg
+
+-- RHS size: {terms: 2, types: 0, coercions: 0, joins: 0/0}
+hpExpr :: CmmExpr
+[LclIdX,
+ Unf=Unf{Src=<vanilla>, TopLvl=True, Value=False, ConLike=False,
+ WorkFree=False, Expandable=False, Guidance=IF_ARGS [] 20 0}]
+hpExpr = GHC.Cmm.Expr.$WCmmReg hpReg
+
+-- RHS size: {terms: 2, types: 0, coercions: 0, joins: 0/0}
+hpLimExpr :: CmmExpr
+[LclIdX,
+ Unf=Unf{Src=<vanilla>, TopLvl=True, Value=False, ConLike=False,
+ WorkFree=False, Expandable=False, Guidance=IF_ARGS [] 20 0}]
+hpLimExpr = GHC.Cmm.Expr.$WCmmReg hpLimReg
+
+-- RHS size: {terms: 2, types: 0, coercions: 0, joins: 0/0}
+currentTSOExpr :: CmmExpr
+[LclIdX,
+ Unf=Unf{Src=<vanilla>, TopLvl=True, Value=False, ConLike=False,
+ WorkFree=False, Expandable=False, Guidance=IF_ARGS [] 20 0}]
+currentTSOExpr = GHC.Cmm.Expr.$WCmmReg currentTSOReg
+
+-- RHS size: {terms: 2, types: 0, coercions: 0, joins: 0/0}
+currentNurseryExpr :: CmmExpr
+[LclIdX,
+ Unf=Unf{Src=<vanilla>, TopLvl=True, Value=False, ConLike=False,
+ WorkFree=False, Expandable=False, Guidance=IF_ARGS [] 20 0}]
+currentNurseryExpr = GHC.Cmm.Expr.$WCmmReg currentNurseryReg
+
+-- RHS size: {terms: 2, types: 0, coercions: 0, joins: 0/0}
+cccsExpr :: CmmExpr
+[LclIdX,
+ Unf=Unf{Src=<vanilla>, TopLvl=True, Value=False, ConLike=False,
+ WorkFree=False, Expandable=False, Guidance=IF_ARGS [] 20 0}]
+cccsExpr = GHC.Cmm.Expr.$WCmmReg cccsReg
+
+-- RHS size: {terms: 5, types: 0, coercions: 0, joins: 0/0}
+GHC.Cmm.Utils.$trModule :: ghc-prim-0.6.1:GHC.Types.Module
+[LclIdX,
+ Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
+ WorkFree=True, Expandable=True, Guidance=IF_ARGS [] 100 30}]
+GHC.Cmm.Utils.$trModule
+ = ghc-prim-0.6.1:GHC.Types.Module
+ (ghc-prim-0.6.1:GHC.Types.TrNameS "ghc"#)
+ (ghc-prim-0.6.1:GHC.Types.TrNameS "GHC.Cmm.Utils"#)
+
+-- RHS size: {terms: 34, types: 10, coercions: 0, joins: 0/2}
+packHalfWordsCLit
+ :: Platform -> StgHalfWord -> StgHalfWord -> CmmLit
+[LclIdX,
+ Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
+ WorkFree=True, Expandable=True, Guidance=IF_ARGS [0 0 0] 360 0}]
+packHalfWordsCLit
+ = \ (platform_a18gt :: Platform)
+ (lower_half_word_a18gu :: StgHalfWord)
+ (upper_half_word_a18gv :: StgHalfWord) ->
+ let {
+ u_a18gx :: Integer
+ [LclId,
+ Unf=Unf{Src=<vanilla>, TopLvl=False, Value=False, ConLike=False,
+ WorkFree=False, Expandable=False, Guidance=IF_ARGS [] 20 0}]
+ u_a18gx = fromStgHalfWord upper_half_word_a18gv } in
+ let {
+ l_a18gw :: Integer
+ [LclId,
+ Unf=Unf{Src=<vanilla>, TopLvl=False, Value=False, ConLike=False,
+ WorkFree=False, Expandable=False, Guidance=IF_ARGS [] 20 0}]
+ l_a18gw = fromStgHalfWord lower_half_word_a18gu } in
+ case platformByteOrder platform_a18gt of {
+ BigEndian ->
+ mkWordCLit
+ platform_a18gt
+ (.|.
+ @ Integer
+ Data.Bits.$fBitsInteger
+ (shiftL
+ @ Integer
+ Data.Bits.$fBitsInteger
+ l_a18gw
+ (halfWordSizeInBits platform_a18gt))
+ u_a18gx);
+ LittleEndian ->
+ mkWordCLit
+ platform_a18gt
+ (.|.
+ @ Integer
+ Data.Bits.$fBitsInteger
+ l_a18gw
+ (shiftL
+ @ Integer
+ Data.Bits.$fBitsInteger
+ u_a18gx
+ (halfWordSizeInBits platform_a18gt)))
+ }
+
+-- RHS size: {terms: 20, types: 3, coercions: 11, joins: 0/0}
+$dIP_a18Fh :: GHC.Stack.Types.HasCallStack
+[LclId,
+ Unf=Unf{Src=<vanilla>, TopLvl=True, Value=False, ConLike=False,
+ WorkFree=False, Expandable=False, Guidance=IF_ARGS [] 390 0}]
+$dIP_a18Fh
+ = (GHC.Stack.Types.pushCallStack
+ (ghc-prim-0.6.1:GHC.CString.unpackCString# "pprPanic"#,
+ GHC.Stack.Types.SrcLoc
+ (ghc-prim-0.6.1:GHC.CString.unpackCString# "ghc"#)
+ (ghc-prim-0.6.1:GHC.CString.unpackCString# "GHC.Cmm.Utils"#)
+ (ghc-prim-0.6.1:GHC.CString.unpackCString#
+ "E:\\ghc_inferTags\\compiler\\GHC\\Cmm\\Utils.hs"#)
+ (ghc-prim-0.6.1:GHC.Types.I# 284#)
+ (ghc-prim-0.6.1:GHC.Types.I# 43#)
+ (ghc-prim-0.6.1:GHC.Types.I# 284#)
+ (ghc-prim-0.6.1:GHC.Types.I# 81#))
+ ((GHC.Stack.Types.emptyCallStack
+ `cast` (Sym (ghc-prim-0.6.1:GHC.Classes.N:IP[0]
+ <"callStack">_N <GHC.Stack.Types.CallStack>_N)
+ :: GHC.Stack.Types.CallStack
+ ~R# (?callStack::GHC.Stack.Types.CallStack)))
+ `cast` (ghc-prim-0.6.1:GHC.Classes.N:IP[0]
+ <"callStack">_N <GHC.Stack.Types.CallStack>_N
+ :: (?callStack::GHC.Stack.Types.CallStack)
+ ~R# GHC.Stack.Types.CallStack)))
+ `cast` (Sym (ghc-prim-0.6.1:GHC.Classes.N:IP[0]
+ <"callStack">_N <GHC.Stack.Types.CallStack>_N)
+ :: GHC.Stack.Types.CallStack
+ ~R# (?callStack::GHC.Stack.Types.CallStack))
+
+-- RHS size: {terms: 34, types: 18, coercions: 0, joins: 1/1}
+cmmNegate :: Platform -> CmmExpr -> CmmExpr
+[LclIdX,
+ Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
+ WorkFree=True, Expandable=True, Guidance=IF_ARGS [0 34] 218 20}]
+cmmNegate
+ = \ (platform_a18iw :: Platform) (ds_d18Xo :: CmmExpr) ->
+ join {
+ fail_d18Ye :: ghc-prim-0.6.1:GHC.Prim.Void# -> CmmExpr
+ [LclId[JoinId(1)],
+ Str=<L,U>,
+ Unf=Unf{Src=<vanilla>, TopLvl=False, Value=True, ConLike=True,
+ WorkFree=True, Expandable=True, Guidance=IF_ARGS [0] 100 30}]
+ fail_d18Ye _ [Occ=Dead, OS=OneShot]
+ = GHC.Cmm.Expr.CmmMachOp
+ (GHC.Cmm.MachOp.MO_S_Neg (cmmExprWidth platform_a18iw ds_d18Xo))
+ (GHC.Base.build
+ @ CmmExpr
+ (\ (@ a_d18Xu)
+ (c_d18Xv :: CmmExpr -> a_d18Xu -> a_d18Xu)
+ (n_d18Xw :: a_d18Xu) ->
+ c_d18Xv ds_d18Xo n_d18Xw)) } in
+ case ds_d18Xo of {
+ __DEFAULT -> jump fail_d18Ye ghc-prim-0.6.1:GHC.Prim.void#;
+ CmmLit ds_d18Yd ->
+ case ds_d18Yd of {
+ __DEFAULT -> jump fail_d18Ye ghc-prim-0.6.1:GHC.Prim.void#;
+ CmmInt n_a18ix rep_a18iy ->
+ GHC.Cmm.Expr.CmmLit
+ (GHC.Cmm.Expr.$WCmmInt
+ (negate @ Integer GHC.Num.$fNumInteger n_a18ix) rep_a18iy)
+ }
+ }
+
+-- RHS size: {terms: 28, types: 13, coercions: 0, joins: 0/2}
+cmmToWord :: Platform -> CmmExpr -> CmmExpr
+[LclIdX,
+ Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
+ WorkFree=True, Expandable=True, Guidance=IF_ARGS [0 0] 200 30}]
+cmmToWord
+ = \ (platform_a18iA :: Platform) (e_a18iB :: CmmExpr) ->
+ let {
+ word_a18iD :: Width
+ [LclId,
+ Unf=Unf{Src=<vanilla>, TopLvl=False, Value=False, ConLike=False,
+ WorkFree=False, Expandable=False, Guidance=IF_ARGS [] 20 0}]
+ word_a18iD = wordWidth platform_a18iA } in
+ let {
+ w_a18iC :: Width
+ [LclId,
+ Unf=Unf{Src=<vanilla>, TopLvl=False, Value=False, ConLike=False,
+ WorkFree=False, Expandable=False, Guidance=IF_ARGS [] 30 0}]
+ w_a18iC = cmmExprWidth platform_a18iA e_a18iB } in
+ case == @ Width GHC.Cmm.Type.$fEqWidth w_a18iC word_a18iD of {
+ False ->
+ GHC.Cmm.Expr.CmmMachOp
+ (GHC.Cmm.MachOp.MO_UU_Conv w_a18iC word_a18iD)
+ (GHC.Base.build
+ @ CmmExpr
+ (\ (@ a_d18Xd)
+ (c_d18Xe :: CmmExpr -> a_d18Xd -> a_d18Xd)
+ (n_d18Xf :: a_d18Xd) ->
+ c_d18Xe e_a18iB n_d18Xf));
+ True -> e_a18iB
+ }
+
+-- RHS size: {terms: 47, types: 19, coercions: 0, joins: 1/1}
+regsOverlap :: Platform -> CmmReg -> CmmReg -> Bool
+[LclIdX,
+ Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
+ WorkFree=True, Expandable=True, Guidance=IF_ARGS [0 34 34] 260 10}]
+regsOverlap
+ = \ (platform_a18iY :: Platform)
+ (ds_d18Nd :: CmmReg)
+ (ds_d18Ne :: CmmReg) ->
+ join {
+ fail_d18OD :: ghc-prim-0.6.1:GHC.Prim.Void# -> Bool
+ [LclId[JoinId(1)],
+ Str=<L,U>,
+ Unf=Unf{Src=<vanilla>, TopLvl=False, Value=True, ConLike=True,
+ WorkFree=True, Expandable=True, Guidance=IF_ARGS [0] 40 0}]
+ fail_d18OD _ [Occ=Dead, OS=OneShot]
+ = == @ CmmReg GHC.Cmm.Expr.$fEqCmmReg ds_d18Nd ds_d18Ne } in
+ case ds_d18Nd of {
+ __DEFAULT -> jump fail_d18OD ghc-prim-0.6.1:GHC.Prim.void#;
+ CmmGlobal g_a18iZ ->
+ case ds_d18Ne of {
+ __DEFAULT -> jump fail_d18OD ghc-prim-0.6.1:GHC.Prim.void#;
+ CmmGlobal g'_a18j0 ->
+ case globalRegMaybe platform_a18iY g_a18iZ of {
+ __DEFAULT -> jump fail_d18OD ghc-prim-0.6.1:GHC.Prim.void#;
+ Just real_a18j1 ->
+ case globalRegMaybe platform_a18iY g'_a18j0 of {
+ __DEFAULT -> jump fail_d18OD ghc-prim-0.6.1:GHC.Prim.void#;
+ Just real'_a18j2 ->
+ case ==
+ @ GHC.Platform.Reg.RealReg
+ GHC.Platform.Reg.$fEqRealReg
+ real_a18j1
+ real'_a18j2
+ of {
+ False -> jump fail_d18OD ghc-prim-0.6.1:GHC.Prim.void#;
+ True -> ghc-prim-0.6.1:GHC.Types.True
+ }
+ }
+ }
+ }
+ }
+
+-- RHS size: {terms: 12, types: 3, coercions: 0, joins: 0/0}
+tAG_MASK :: Platform -> Int
+[LclIdX,
+ Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
+ WorkFree=True, Expandable=True, Guidance=IF_ARGS [0] 140 0}]
+tAG_MASK
+ = \ (platform_a18iM :: Platform) ->
+ - @ Int
+ GHC.Num.$fNumInt
+ (shiftL
+ @ Int
+ Data.Bits.$fBitsInt
+ (ghc-prim-0.6.1:GHC.Types.I# 1#)
+ (pc_TAG_BITS (platformConstants platform_a18iM)))
+ (ghc-prim-0.6.1:GHC.Types.I# 1#)
+
+-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
+mAX_PTR_TAG :: Platform -> Int
+[LclIdX,
+ Unf=Unf{Src=<vanilla>, TopLvl=True, Value=False, ConLike=False,
+ WorkFree=True, Expandable=True,
+ Guidance=ALWAYS_IF(arity=0,unsat_ok=True,boring_ok=True)}]
+mAX_PTR_TAG = tAG_MASK
+
+-- RHS size: {terms: 9, types: 4, coercions: 0, joins: 0/0}
+cmmLabelOffW :: Platform -> CLabel -> WordOff -> CmmLit
+[LclIdX,
+ Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
+ WorkFree=True, Expandable=True, Guidance=IF_ARGS [0 0 0] 70 0}]
+cmmLabelOffW
+ = \ (platform_a18hM :: Platform)
+ (lbl_a18hN :: CLabel)
+ (wd_off_a18hO :: WordOff) ->
+ cmmLabelOffB
+ lbl_a18hN
+ (wordsToBytes
+ @ WordOff GHC.Num.$fNumInt platform_a18hM wd_off_a18hO)
+
+-- RHS size: {terms: 9, types: 4, coercions: 0, joins: 0/0}
+cmmRegOffW :: Platform -> CmmReg -> WordOff -> CmmExpr
+[LclIdX,
+ Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
+ WorkFree=True, Expandable=True, Guidance=IF_ARGS [0 0 0] 70 0}]
+cmmRegOffW
+ = \ (platform_a18hG :: Platform)
+ (reg_a18hH :: CmmReg)
+ (wd_off_a18hI :: WordOff) ->
+ cmmRegOffB
+ reg_a18hH
+ (wordsToBytes
+ @ WordOff GHC.Num.$fNumInt platform_a18hG wd_off_a18hI)
+
+Rec {
+-- RHS size: {terms: 34, types: 18, coercions: 0, joins: 0/1}
+mkLiveness [Occ=LoopBreaker] :: Platform -> [LocalReg] -> Liveness
+[LclIdX,
+ Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
+ WorkFree=True, Expandable=True, Guidance=IF_ARGS [0 30] 400 10}]
+mkLiveness
+ = \ (ds_d18N1 :: Platform) (ds_d18N2 :: [LocalReg]) ->
+ case ds_d18N2 of {
+ [] -> ghc-prim-0.6.1:GHC.Types.[] @ Bool;
+ : reg_a18jg regs_a18jh ->
+ let {
+ word_size_a18ji :: Int
+ [LclId,
+ Unf=Unf{Src=<vanilla>, TopLvl=False, Value=False, ConLike=False,
+ WorkFree=False, Expandable=False, Guidance=IF_ARGS [] 20 0}]
+ word_size_a18ji = platformWordSizeInBytes ds_d18N1 } in
+ ++
+ @ Bool
+ (replicate
+ @ Bool
+ (quot
+ @ Int
+ GHC.Real.$fIntegralInt
+ (- @ Int
+ GHC.Num.$fNumInt
+ (+ @ Int
+ GHC.Num.$fNumInt
+ (widthInBytes (typeWidth (localRegType reg_a18jg)))
+ word_size_a18ji)
+ (ghc-prim-0.6.1:GHC.Types.I# 1#))
+ word_size_a18ji)
+ ($ @ 'ghc-prim-0.6.1:GHC.Types.LiftedRep
+ @ Bool
+ @ Bool
+ not
+ (isGcPtrType (localRegType reg_a18jg))))
+ (mkLiveness ds_d18N1 regs_a18jh)
+ }
+end Rec }
+
+-- RHS size: {terms: 42, types: 19, coercions: 0, joins: 0/0}
+cmmOffsetLit :: CmmLit -> Int -> CmmLit
+[LclIdX,
+ Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
+ WorkFree=True, Expandable=True, Guidance=IF_ARGS [320 0] 440 50}]
+cmmOffsetLit
+ = \ (ds_d18Z3 :: CmmLit) (byte_off_a18gZ :: Int) ->
+ case ds_d18Z3 of {
+ __DEFAULT ->
+ pprPanic
+ @ CmmLit
+ $dIP_a18Fh
+ (ghc-prim-0.6.1:GHC.CString.unpackCString# "cmmOffsetLit"#)
+ (ppr @ Int GHC.Utils.Outputable.$fOutputableInt byte_off_a18gZ);
+ CmmInt m_a18h8 rep_a18h9 ->
+ GHC.Cmm.Expr.$WCmmInt
+ (+ @ Integer
+ GHC.Num.$fNumInteger
+ m_a18h8
+ (fromIntegral
+ @ Int
+ @ Integer
+ GHC.Real.$fIntegralInt
+ GHC.Num.$fNumInteger
+ byte_off_a18gZ))
+ rep_a18h9;
+ CmmLabel l_a18gY -> cmmLabelOff l_a18gY byte_off_a18gZ;
+ CmmLabelOff l_a18h0 m_a18h1 ->
+ cmmLabelOff
+ l_a18h0 (+ @ Int GHC.Num.$fNumInt m_a18h1 byte_off_a18gZ);
+ CmmLabelDiffOff l1_a18h3 l2_a18h4 m_a18h5 w_a18h6 ->
+ GHC.Cmm.Expr.CmmLabelDiffOff
+ l1_a18h3
+ l2_a18h4
+ (+ @ Int GHC.Num.$fNumInt m_a18h5 byte_off_a18gZ)
+ w_a18h6
+ }
+
+-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
+cmmOffsetLitB :: CmmLit -> ByteOff -> CmmLit
+[LclIdX,
+ Unf=Unf{Src=<vanilla>, TopLvl=True, Value=False, ConLike=False,
+ WorkFree=True, Expandable=True,
+ Guidance=ALWAYS_IF(arity=0,unsat_ok=True,boring_ok=True)}]
+cmmOffsetLitB = cmmOffsetLit
+
+-- RHS size: {terms: 9, types: 4, coercions: 0, joins: 0/0}
+cmmOffsetLitW :: Platform -> CmmLit -> WordOff -> CmmLit
+[LclIdX,
+ Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
+ WorkFree=True, Expandable=True, Guidance=IF_ARGS [0 0 0] 70 0}]
+cmmOffsetLitW
+ = \ (platform_a18hJ :: Platform)
+ (lit_a18hK :: CmmLit)
+ (wd_off_a18hL :: WordOff) ->
+ cmmOffsetLitB
+ lit_a18hK
+ (wordsToBytes
+ @ WordOff GHC.Num.$fNumInt platform_a18hJ wd_off_a18hL)
+
+-- RHS size: {terms: 119, types: 58, coercions: 0, joins: 1/2}
+cmmOffset :: Platform -> CmmExpr -> Int -> CmmExpr
+[LclIdX,
+ Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
+ WorkFree=True, Expandable=True, Guidance=NEVER}]
+cmmOffset
+ = \ (_platform_a18gF :: Platform)
+ (e_a18gG :: CmmExpr)
+ (ds_d1907 :: Int) ->
+ case ds_d1907 of { ghc-prim-0.6.1:GHC.Types.I# ds_d1948 ->
+ case ds_d1948 of {
+ __DEFAULT ->
+ join {
+ fail_d1942 :: ghc-prim-0.6.1:GHC.Prim.Void# -> CmmExpr
+ [LclId[JoinId(1)],
+ Str=<L,U>,
+ Unf=Unf{Src=<vanilla>, TopLvl=False, Value=True, ConLike=True,
+ WorkFree=True, Expandable=True, Guidance=IF_ARGS [0] 210 30}]
+ fail_d1942 _ [Occ=Dead, OS=OneShot]
+ = let {
+ width_a18gU :: Width
+ [LclId,
+ Unf=Unf{Src=<vanilla>, TopLvl=False, Value=False, ConLike=False,
+ WorkFree=False, Expandable=False, Guidance=IF_ARGS [] 30 0}]
+ width_a18gU = cmmExprWidth _platform_a18gF e_a18gG } in
+ GHC.Cmm.Expr.CmmMachOp
+ (GHC.Cmm.MachOp.MO_Add width_a18gU)
+ (GHC.Base.build
+ @ CmmExpr
+ (\ (@ a_d190G)
+ (c_d190H :: CmmExpr -> a_d190G -> a_d190G)
+ (n_d190I :: a_d190G) ->
+ c_d190H
+ e_a18gG
+ (c_d190H
+ (GHC.Cmm.Expr.CmmLit
+ (GHC.Cmm.Expr.$WCmmInt
+ (toInteger @ Int GHC.Real.$fIntegralInt ds_d1907) width_a18gU))
+ n_d190I))) } in
+ case e_a18gG of {
+ __DEFAULT -> jump fail_d1942 ghc-prim-0.6.1:GHC.Prim.void#;
+ CmmLit lit_a18gN ->
+ GHC.Cmm.Expr.CmmLit (cmmOffsetLit lit_a18gN ds_d1907);
+ CmmReg reg_a18gK -> cmmRegOff reg_a18gK ds_d1907;
+ CmmMachOp ds_d193W ds_d193X ->
+ case ds_d193W of {
+ __DEFAULT -> jump fail_d1942 ghc-prim-0.6.1:GHC.Prim.void#;
+ MO_Add rep_a18gQ ->
+ case ds_d193X of {
+ __DEFAULT -> jump fail_d1942 ghc-prim-0.6.1:GHC.Prim.void#;
+ : expr_a18gR ds_d193Y ->
+ case ds_d193Y of {
+ __DEFAULT -> jump fail_d1942 ghc-prim-0.6.1:GHC.Prim.void#;
+ : ds_d193Z ds_d1940 ->
+ case ds_d193Z of {
+ __DEFAULT -> jump fail_d1942 ghc-prim-0.6.1:GHC.Prim.void#;
+ CmmLit ds_d1941 ->
+ case ds_d1941 of {
+ __DEFAULT -> jump fail_d1942 ghc-prim-0.6.1:GHC.Prim.void#;
+ CmmInt byte_off1_a18gS _ [Occ=Dead] ->
+ case ds_d1940 of {
+ __DEFAULT -> jump fail_d1942 ghc-prim-0.6.1:GHC.Prim.void#;
+ [] ->
+ GHC.Cmm.Expr.CmmMachOp
+ (GHC.Cmm.MachOp.MO_Add rep_a18gQ)
+ (GHC.Base.build
+ @ CmmExpr
+ (\ (@ a_d190D)
+ (c_d190E :: CmmExpr -> a_d190D -> a_d190D)
+ (n_d190F :: a_d190D) ->
+ c_d190E
+ expr_a18gR
+ (c_d190E
+ (GHC.Cmm.Expr.CmmLit
+ (GHC.Cmm.Expr.$WCmmInt
+ (+ @ Integer
+ GHC.Num.$fNumInteger
+ byte_off1_a18gS
+ (toInteger
+ @ Int
+ GHC.Real.$fIntegralInt
+ ds_d1907))
+ rep_a18gQ))
+ n_d190F)))
+ }
+ }
+ }
+ }
+ }
+ };
+ CmmStackSlot area_a18gO off_a18gP ->
+ GHC.Cmm.Expr.$WCmmStackSlot
+ area_a18gO (- @ Int GHC.Num.$fNumInt off_a18gP ds_d1907);
+ CmmRegOff reg_a18gL m_a18gM ->
+ cmmRegOff reg_a18gL (+ @ Int GHC.Num.$fNumInt m_a18gM ds_d1907)
+ };
+ 0# -> e_a18gG
+ }
+ }
+
+-- RHS size: {terms: 12, types: 5, coercions: 0, joins: 0/0}
+cmmIndex :: Platform -> Width -> CmmExpr -> Int -> CmmExpr
+[LclIdX,
+ Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
+ WorkFree=True, Expandable=True, Guidance=IF_ARGS [0 0 0 0] 100 0}]
+cmmIndex
+ = \ (platform_a18hf :: Platform)
+ (width_a18hg :: Width)
+ (base_a18hh :: CmmExpr)
+ (idx_a18hi :: Int) ->
+ cmmOffset
+ platform_a18hf
+ base_a18hh
+ (* @ Int GHC.Num.$fNumInt idx_a18hi (widthInBytes width_a18hg))
+
+-- RHS size: {terms: 12, types: 4, coercions: 0, joins: 0/0}
+cmmLoadIndex :: Platform -> CmmType -> CmmExpr -> Int -> CmmExpr
+[LclIdX,
+ Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
+ WorkFree=True, Expandable=True, Guidance=IF_ARGS [0 0 0 0] 100 0}]
+cmmLoadIndex
+ = \ (platform_a18ht :: Platform)
+ (ty_a18hu :: CmmType)
+ (expr_a18hv :: CmmExpr)
+ (ix_a18hw :: Int) ->
+ GHC.Cmm.Expr.$WCmmLoad
+ (cmmIndex platform_a18ht (typeWidth ty_a18hu) expr_a18hv ix_a18hw)
+ ty_a18hu
+
+-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
+cmmOffsetB :: Platform -> CmmExpr -> ByteOff -> CmmExpr
+[LclIdX,
+ Unf=Unf{Src=<vanilla>, TopLvl=True, Value=False, ConLike=False,
+ WorkFree=True, Expandable=True,
+ Guidance=ALWAYS_IF(arity=0,unsat_ok=True,boring_ok=True)}]
+cmmOffsetB = cmmOffset
+
+-- RHS size: {terms: 10, types: 4, coercions: 0, joins: 0/0}
+cmmOffsetW :: Platform -> CmmExpr -> WordOff -> CmmExpr
+[LclIdX,
+ Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
+ WorkFree=True, Expandable=True, Guidance=IF_ARGS [0 0 0] 80 0}]
+cmmOffsetW
+ = \ (platform_a18hD :: Platform)
+ (e_a18hE :: CmmExpr)
+ (n_a18hF :: WordOff) ->
+ cmmOffsetB
+ platform_a18hD
+ e_a18hE
+ (wordsToBytes @ WordOff GHC.Num.$fNumInt platform_a18hD n_a18hF)
+
+-- RHS size: {terms: 10, types: 4, coercions: 0, joins: 0/0}
+cmmLoadIndexW :: Platform -> CmmExpr -> Int -> CmmType -> CmmExpr
+[LclIdX,
+ Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
+ WorkFree=True, Expandable=True, Guidance=IF_ARGS [0 0 0 0] 70 0}]
+cmmLoadIndexW
+ = \ (platform_a18hP :: Platform)
+ (base_a18hQ :: CmmExpr)
+ (off_a18hR :: Int)
+ (ty_a18hS :: CmmType) ->
+ GHC.Cmm.Expr.$WCmmLoad
+ (cmmOffsetW platform_a18hP base_a18hQ off_a18hR) ty_a18hS
+
+-- RHS size: {terms: 37, types: 19, coercions: 0, joins: 1/1}
+cmmOffsetExpr :: Platform -> CmmExpr -> CmmExpr -> CmmExpr
+[LclIdX,
+ Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
+ WorkFree=True, Expandable=True, Guidance=IF_ARGS [0 0 34] 248 0}]
+cmmOffsetExpr
+ = \ (platform_a18gz :: Platform)
+ (e_a18gA :: CmmExpr)
+ (ds_d194b :: CmmExpr) ->
+ join {
+ fail_d1954 :: ghc-prim-0.6.1:GHC.Prim.Void# -> CmmExpr
+ [LclId[JoinId(1)],
+ Str=<L,U>,
+ Unf=Unf{Src=<vanilla>, TopLvl=False, Value=True, ConLike=True,
+ WorkFree=True, Expandable=True, Guidance=IF_ARGS [0] 130 30}]
+ fail_d1954 _ [Occ=Dead, OS=OneShot]
+ = GHC.Cmm.Expr.CmmMachOp
+ (GHC.Cmm.MachOp.MO_Add (cmmExprWidth platform_a18gz e_a18gA))
+ (GHC.Base.build
+ @ CmmExpr
+ (\ (@ a_d194i)
+ (c_d194j :: CmmExpr -> a_d194i -> a_d194i)
+ (n_d194k :: a_d194i) ->
+ c_d194j e_a18gA (c_d194j ds_d194b n_d194k))) } in
+ case ds_d194b of {
+ __DEFAULT -> jump fail_d1954 ghc-prim-0.6.1:GHC.Prim.void#;
+ CmmLit ds_d1952 ->
+ case ds_d1952 of {
+ __DEFAULT -> jump fail_d1954 ghc-prim-0.6.1:GHC.Prim.void#;
+ CmmInt n_a18gB _ [Occ=Dead] ->
+ cmmOffset
+ platform_a18gz e_a18gA (fromInteger @ Int GHC.Num.$fNumInt n_a18gB)
+ }
+ }
+
+-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
+cmmOffsetExprB :: Platform -> CmmExpr -> CmmExpr -> CmmExpr
+[LclIdX,
+ Unf=Unf{Src=<vanilla>, TopLvl=True, Value=False, ConLike=False,
+ WorkFree=True, Expandable=True,
+ Guidance=ALWAYS_IF(arity=0,unsat_ok=True,boring_ok=True)}]
+cmmOffsetExprB = cmmOffsetExpr
+
+-- RHS size: {terms: 8, types: 3, coercions: 0, joins: 0/0}
+mkIntCLit :: Platform -> Int -> CmmLit
+[LclIdX,
+ Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
+ WorkFree=True, Expandable=True, Guidance=IF_ARGS [0 0] 80 0}]
+mkIntCLit
+ = \ (platform_a18g7 :: Platform) (i_a18g8 :: Int) ->
+ GHC.Cmm.Expr.$WCmmInt
+ (toInteger @ Int GHC.Real.$fIntegralInt i_a18g8)
+ (wordWidth platform_a18g7)
+
+-- RHS size: {terms: 7, types: 5, coercions: 0, joins: 0/0}
+mkIntExpr :: Platform -> Int -> CmmExpr
+[LclIdX,
+ Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
+ WorkFree=True, Expandable=True, Guidance=IF_ARGS [0 0] 60 0}]
+mkIntExpr
+ = \ (platform_a18g9 :: Platform) (i_a18ga :: Int) ->
+ $!
+ @ 'ghc-prim-0.6.1:GHC.Types.LiftedRep
+ @ CmmLit
+ @ CmmExpr
+ GHC.Cmm.Expr.CmmLit
+ (mkIntCLit platform_a18g9 i_a18ga)
+
+-- RHS size: {terms: 47, types: 21, coercions: 0, joins: 1/2}
+cmmIndexExpr :: Platform -> Width -> CmmExpr -> CmmExpr -> CmmExpr
+[LclIdX,
+ Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
+ WorkFree=True, Expandable=True, Guidance=IF_ARGS [0 0 0 34] 358 0}]
+cmmIndexExpr
+ = \ (platform_a18hj :: Platform)
+ (width_a18hk :: Width)
+ (base_a18hl :: CmmExpr)
+ (ds_d196e :: CmmExpr) ->
+ join {
+ fail_d1977 :: ghc-prim-0.6.1:GHC.Prim.Void# -> CmmExpr
+ [LclId[JoinId(1)],
+ Str=<L,U>,
+ Unf=Unf{Src=<vanilla>, TopLvl=False, Value=True, ConLike=True,
+ WorkFree=True, Expandable=True, Guidance=IF_ARGS [0] 230 0}]
+ fail_d1977 _ [Occ=Dead, OS=OneShot]
+ = let {
+ idx_w_a18hr :: Width
+ [LclId,
+ Unf=Unf{Src=<vanilla>, TopLvl=False, Value=False, ConLike=False,
+ WorkFree=False, Expandable=False, Guidance=IF_ARGS [] 30 0}]
+ idx_w_a18hr = cmmExprWidth platform_a18hj ds_d196e } in
+ cmmOffsetExpr
+ platform_a18hj
+ base_a18hl
+ (GHC.Cmm.Expr.CmmMachOp
+ (GHC.Cmm.MachOp.MO_Shl idx_w_a18hr)
+ (GHC.Base.build
+ @ CmmExpr
+ (\ (@ a_d1974)
+ (c_d1975 :: CmmExpr -> a_d1974 -> a_d1974)
+ (n_d1976 :: a_d1974) ->
+ c_d1975
+ ds_d196e
+ (c_d1975
+ (mkIntExpr platform_a18hj (widthInLog width_a18hk))
+ n_d1976)))) } in
+ case ds_d196e of {
+ __DEFAULT -> jump fail_d1977 ghc-prim-0.6.1:GHC.Prim.void#;
+ CmmLit ds_d1972 ->
+ case ds_d1972 of {
+ __DEFAULT -> jump fail_d1977 ghc-prim-0.6.1:GHC.Prim.void#;
+ CmmInt n_a18hm _ [Occ=Dead] ->
+ cmmIndex
+ platform_a18hj
+ width_a18hk
+ base_a18hl
+ (fromInteger @ Int GHC.Num.$fNumInt n_a18hm)
+ }
+ }
+
+-- RHS size: {terms: 29, types: 12, coercions: 0, joins: 1/1}
+cmmOffsetExprW :: Platform -> CmmExpr -> CmmExpr -> CmmExpr
+[LclIdX,
+ Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
+ WorkFree=True, Expandable=True, Guidance=IF_ARGS [0 0 34] 188 0}]
+cmmOffsetExprW
+ = \ (platform_a18hx :: Platform)
+ (e_a18hy :: CmmExpr)
+ (ds_d1979 :: CmmExpr) ->
+ join {
+ fail_d197Z :: ghc-prim-0.6.1:GHC.Prim.Void# -> CmmExpr
+ [LclId[JoinId(1)],
+ Str=<L,U>,
+ Unf=Unf{Src=<vanilla>, TopLvl=False, Value=True, ConLike=True,
+ WorkFree=True, Expandable=True, Guidance=IF_ARGS [0] 70 0}]
+ fail_d197Z _ [Occ=Dead, OS=OneShot]
+ = cmmIndexExpr
+ platform_a18hx (wordWidth platform_a18hx) e_a18hy ds_d1979 } in
+ case ds_d1979 of {
+ __DEFAULT -> jump fail_d197Z ghc-prim-0.6.1:GHC.Prim.void#;
+ CmmLit ds_d197X ->
+ case ds_d197X of {
+ __DEFAULT -> jump fail_d197Z ghc-prim-0.6.1:GHC.Prim.void#;
+ CmmInt n_a18hz _ [Occ=Dead] ->
+ cmmOffsetW
+ platform_a18hx
+ e_a18hy
+ (fromInteger @ WordOff GHC.Num.$fNumInt n_a18hz)
+ }
+ }
+
+-- RHS size: {terms: 5, types: 1, coercions: 0, joins: 0/0}
+cmmTagMask :: Platform -> CmmExpr
+[LclIdX,
+ Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
+ WorkFree=True, Expandable=True, Guidance=IF_ARGS [0] 50 0}]
+cmmTagMask
+ = \ (platform_a18iN :: Platform) ->
+ mkIntExpr platform_a18iN (tAG_MASK platform_a18iN)
+
+-- RHS size: {terms: 11, types: 2, coercions: 0, joins: 0/0}
+cmmIsTagged :: Platform -> CmmExpr -> CmmExpr
+[LclIdX,
+ Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
+ WorkFree=True, Expandable=True, Guidance=IF_ARGS [0 0] 120 0}]
+cmmIsTagged
+ = \ (platform_a18iS :: Platform) (e_a18iT :: CmmExpr) ->
+ cmmNeWord
+ platform_a18iS
+ (cmmAndWord platform_a18iS e_a18iT (cmmTagMask platform_a18iS))
+ (zeroExpr platform_a18iS)
+
+-- RHS size: {terms: 11, types: 2, coercions: 0, joins: 0/0}
+cmmIsNotTagged :: Platform -> CmmExpr -> CmmExpr
+[LclIdX,
+ Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
+ WorkFree=True, Expandable=True, Guidance=IF_ARGS [0 0] 120 0}]
+cmmIsNotTagged
+ = \ (platform_a18iU :: Platform) (e_a18iV :: CmmExpr) ->
+ cmmEqWord
+ platform_a18iU
+ (cmmAndWord platform_a18iU e_a18iV (cmmTagMask platform_a18iU))
+ (zeroExpr platform_a18iU)
+
+-- RHS size: {terms: 7, types: 2, coercions: 0, joins: 0/0}
+cmmConstrTag1 :: Platform -> CmmExpr -> CmmExpr
+[LclIdX,
+ Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
+ WorkFree=True, Expandable=True, Guidance=IF_ARGS [0 0] 60 0}]
+cmmConstrTag1
+ = \ (platform_a18iW :: Platform) (e_a18iX :: CmmExpr) ->
+ cmmAndWord platform_a18iW e_a18iX (cmmTagMask platform_a18iW)
+
+-- RHS size: {terms: 7, types: 2, coercions: 0, joins: 0/0}
+cmmPointerMask :: Platform -> CmmExpr
+[LclIdX,
+ Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
+ WorkFree=True, Expandable=True, Guidance=IF_ARGS [0] 80 0}]
+cmmPointerMask
+ = \ (platform_a18iO :: Platform) ->
+ mkIntExpr
+ platform_a18iO
+ (complement @ Int Data.Bits.$fBitsInt (tAG_MASK platform_a18iO))
+
+-- RHS size: {terms: 22, types: 9, coercions: 0, joins: 1/1}
+cmmUntag :: Platform -> CmmExpr -> CmmExpr
+[LclIdX,
+ Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
+ WorkFree=True, Expandable=True, Guidance=IF_ARGS [0 34] 108 0}]
+cmmUntag
+ = \ (ds_d1981 :: Platform) (e_a18iP :: CmmExpr) ->
+ join {
+ fail_d198Y :: ghc-prim-0.6.1:GHC.Prim.Void# -> CmmExpr
+ [LclId[JoinId(1)],
+ Str=<L,U>,
+ Unf=Unf{Src=<vanilla>, TopLvl=False, Value=True, ConLike=True,
+ WorkFree=True, Expandable=True, Guidance=IF_ARGS [0] 60 0}]
+ fail_d198Y _ [Occ=Dead, OS=OneShot]
+ = cmmAndWord ds_d1981 e_a18iP (cmmPointerMask ds_d1981) } in
+ case e_a18iP of wild_00 {
+ __DEFAULT -> jump fail_d198Y ghc-prim-0.6.1:GHC.Prim.void#;
+ CmmLit ds_d198W ->
+ case ds_d198W of {
+ __DEFAULT -> jump fail_d198Y ghc-prim-0.6.1:GHC.Prim.void#;
+ CmmLabel _ [Occ=Dead] -> wild_00
+ }
+ }
+
+-- RHS size: {terms: 4, types: 3, coercions: 0, joins: 0/0}
+typeForeignHint :: UnaryType -> ForeignHint
+[LclIdX,
+ Unf=Unf{Src=<vanilla>, TopLvl=True, Value=False, ConLike=False,
+ WorkFree=False, Expandable=False, Guidance=IF_ARGS [] 50 0}]
+typeForeignHint
+ = . @ PrimRep
+ @ ForeignHint
+ @ UnaryType
+ primRepForeignHint
+ (typePrimRep1 ghc-prim-0.6.1:GHC.Classes.C:(%%))
+
+-- RHS size: {terms: 7, types: 2, coercions: 0, joins: 0/0}
+typeCmmType :: Platform -> UnaryType -> CmmType
+[LclIdX,
+ Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
+ WorkFree=True, Expandable=True, Guidance=IF_ARGS [0 0] 60 0}]
+typeCmmType
+ = \ (platform_a18g5 :: Platform) (ty_a18g6 :: UnaryType) ->
+ primRepCmmType
+ platform_a18g5
+ (typePrimRep1 ghc-prim-0.6.1:GHC.Classes.C:(%%) ty_a18g6)
+
+-- RHS size: {terms: 2, types: 1, coercions: 0, joins: 0/0}
+$dNonLocal_a18yU :: NonLocal (Block CmmNode)
+[LclId,
+ Unf=Unf{Src=<vanilla>, TopLvl=True, Value=False, ConLike=False,
+ WorkFree=False, Expandable=True, Guidance=IF_ARGS [] 20 0}]
+$dNonLocal_a18yU
+ = GHC.Cmm.Dataflow.Graph.$fNonLocalBlock
+ @ CmmNode GHC.Cmm.Node.$fNonLocalCmmNode
+
+-- RHS size: {terms: 7, types: 4, coercions: 0, joins: 0/0}
+revPostorder :: CmmGraph -> [CmmBlock]
+[LclIdX,
+ Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
+ WorkFree=True, Expandable=True, Guidance=IF_ARGS [0] 80 0}]
+revPostorder
+ = \ (g_a18jW :: CmmGraph) ->
+ revPostorderFrom
+ @ (Block CmmNode)
+ $dNonLocal_a18yU
+ (toBlockMap g_a18jW)
+ (g_entry @ CmmNode g_a18jW)
+
+-- RHS size: {terms: 14, types: 30, coercions: 0, joins: 0/0}
+ofBlockList :: BlockId -> [CmmBlock] -> CmmGraph
+[LclIdX,
+ Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
+ WorkFree=True, Expandable=True, Guidance=IF_ARGS [0 0] 130 30}]
+ofBlockList
+ = \ (entry_a18jL :: BlockId) (blocks_a18jM :: [CmmBlock]) ->
+ GHC.Cmm.CmmGraph
+ @ CmmNode
+ entry_a18jL
+ (GHC.Cmm.Dataflow.Graph.$WGMany
+ @ 'Closed
+ @ Block
+ @ CmmNode
+ @ 'Closed
+ (GHC.Cmm.Dataflow.Block.$WNothingO @ (Block CmmNode O C))
+ (foldr
+ @ []
+ Data.Foldable.$fFoldable[]
+ @ (Block CmmNode C C)
+ @ (LabelMap (Block CmmNode C C))
+ (addBlock
+ @ (Block CmmNode)
+ $dNonLocal_a18yU
+ ghc-prim-0.6.1:GHC.Classes.C:(%%))
+ (emptyBody @ Block @ CmmNode)
+ blocks_a18jM)
+ (GHC.Cmm.Dataflow.Block.$WNothingO @ (Block CmmNode C O)))
+
+-- RHS size: {terms: 29, types: 19, coercions: 0, joins: 0/0}
+mkRODataLits
+ :: forall (raw :: Bool) info stmt.
+ CLabel -> [CmmLit] -> GenCmmDecl (GenCmmStatics raw) info stmt
+[LclIdX,
+ Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
+ WorkFree=True, Expandable=True, Guidance=IF_ARGS [0 0] 160 0}]
+mkRODataLits
+ = \ (@ (raw_a18Gz :: Bool))
+ (@ info_a18GA)
+ (@ stmt_a18GB)
+ (lbl_a18gn :: CLabel)
+ (lits_a18go :: [CmmLit]) ->
+ mkDataLits
+ @ raw_a18Gz
+ @ info_a18GA
+ @ stmt_a18GB
+ (case any
+ @ []
+ @ CmmLit
+ Data.Foldable.$fFoldable[]
+ (\ (ds_d195e :: CmmLit) ->
+ case ds_d195e of {
+ __DEFAULT -> ghc-prim-0.6.1:GHC.Types.False;
+ CmmLabel _ [Occ=Dead] -> ghc-prim-0.6.1:GHC.Types.True;
+ CmmLabelOff _ [Occ=Dead] _ [Occ=Dead] ->
+ ghc-prim-0.6.1:GHC.Types.True
+ })
+ lits_a18go
+ of {
+ False -> GHC.Cmm.Section GHC.Cmm.ReadOnlyData lbl_a18gn;
+ True -> GHC.Cmm.Section GHC.Cmm.RelocatableReadOnlyData lbl_a18gn
+ })
+ lbl_a18gn
+ lits_a18go
+
+-- RHS size: {terms: 33, types: 21, coercions: 0, joins: 0/1}
+regUsedIn :: Platform -> CmmReg -> CmmExpr -> Bool
+[LclIdX,
+ Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
+ WorkFree=True, Expandable=True, Guidance=IF_ARGS [0] 280 0}]
+regUsedIn
+ = \ (platform_a18j5 :: Platform) ->
+ letrec {
+ regUsedIn__a18j6 [Occ=LoopBreaker] :: CmmReg -> CmmExpr -> Bool
+ [LclId,
+ Unf=Unf{Src=<vanilla>, TopLvl=False, Value=True, ConLike=True,
+ WorkFree=True, Expandable=True, Guidance=IF_ARGS [0 180] 250 20}]
+ regUsedIn__a18j6
+ = \ (ds_d18OF :: CmmReg) (ds_d18OG :: CmmExpr) ->
+ case ds_d18OG of {
+ CmmLit _ [Occ=Dead] -> ghc-prim-0.6.1:GHC.Types.False;
+ CmmLoad e_a18j8 _ [Occ=Dead] -> regUsedIn__a18j6 ds_d18OF e_a18j8;
+ CmmReg reg'_a18ja ->
+ regsOverlap platform_a18j5 ds_d18OF reg'_a18ja;
+ CmmMachOp _ [Occ=Dead] es_a18je ->
+ any
+ @ []
+ @ CmmExpr
+ Data.Foldable.$fFoldable[]
+ (\ (ds_d18OW :: CmmExpr) -> regUsedIn__a18j6 ds_d18OF ds_d18OW)
+ es_a18je;
+ CmmStackSlot _ [Occ=Dead] _ [Occ=Dead] ->
+ ghc-prim-0.6.1:GHC.Types.False;
+ CmmRegOff reg'_a18jc _ [Occ=Dead] ->
+ regsOverlap platform_a18j5 ds_d18OF reg'_a18jc
+ }; } in
+ regUsedIn__a18j6
+
+Rec {
+-- RHS size: {terms: 35, types: 20, coercions: 0, joins: 1/1}
+hasNoGlobalRegs [Occ=LoopBreaker] :: CmmExpr -> Bool
+[LclIdX,
+ Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
+ WorkFree=True, Expandable=True, Guidance=IF_ARGS [142] 172 30}]
+hasNoGlobalRegs
+ = \ (ds_d18RZ :: CmmExpr) ->
+ join {
+ fail_d18UX :: ghc-prim-0.6.1:GHC.Prim.Void# -> Bool
+ [LclId[JoinId(1)],
+ Str=<L,U>,
+ Unf=Unf{Src=<vanilla>, TopLvl=False, Value=True, ConLike=True,
+ WorkFree=True, Expandable=True,
+ Guidance=ALWAYS_IF(arity=1,unsat_ok=True,boring_ok=True)}]
+ fail_d18UX _ [Occ=Dead, OS=OneShot]
+ = ghc-prim-0.6.1:GHC.Types.False } in
+ case ds_d18RZ of {
+ __DEFAULT -> jump fail_d18UX ghc-prim-0.6.1:GHC.Prim.void#;
+ CmmLit _ [Occ=Dead] -> ghc-prim-0.6.1:GHC.Types.True;
+ CmmLoad e_a18iJ _ [Occ=Dead] -> hasNoGlobalRegs e_a18iJ;
+ CmmReg ds_d18US ->
+ case ds_d18US of {
+ __DEFAULT -> jump fail_d18UX ghc-prim-0.6.1:GHC.Prim.void#;
+ CmmLocal _ [Occ=Dead] -> ghc-prim-0.6.1:GHC.Types.True
+ };
+ CmmMachOp _ [Occ=Dead] es_a18iK ->
+ all
+ @ [] @ CmmExpr Data.Foldable.$fFoldable[] hasNoGlobalRegs es_a18iK;
+ CmmRegOff ds_d18UU _ [Occ=Dead] ->
+ case ds_d18UU of {
+ __DEFAULT -> jump fail_d18UX ghc-prim-0.6.1:GHC.Prim.void#;
+ CmmLocal _ [Occ=Dead] -> ghc-prim-0.6.1:GHC.Types.True
+ }
+ }
+end Rec }
+
+-- RHS size: {terms: 4, types: 7, coercions: 0, joins: 0/0}
+bodyToBlockList :: Body CmmNode -> [CmmBlock]
+[LclIdX,
+ Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
+ WorkFree=True, Expandable=True, Guidance=IF_ARGS [0] 30 0}]
+bodyToBlockList
+ = \ (body_a18jO :: Body CmmNode) ->
+ mapElems
+ @ LabelMap
+ GHC.Cmm.Dataflow.Label.$fIsMapLabelMap
+ @ (Block CmmNode C C)
+ body_a18jO
+
+-- RHS size: {terms: 11, types: 14, coercions: 0, joins: 0/0}
+foldlGraphBlocks
+ :: forall a. (a -> CmmBlock -> a) -> a -> CmmGraph -> a
+[LclIdX,
+ Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
+ WorkFree=True, Expandable=True, Guidance=IF_ARGS [0 0 0] 90 0}]
+foldlGraphBlocks
+ = \ (@ a_a18C5)
+ (k_a18jT :: a_a18C5 -> CmmBlock -> a_a18C5)
+ (z_a18jU :: a_a18C5)
+ (g_a18jV :: CmmGraph) ->
+ $ @ 'ghc-prim-0.6.1:GHC.Types.LiftedRep
+ @ (LabelMap CmmBlock)
+ @ a_a18C5
+ (mapFoldl
+ @ LabelMap
+ GHC.Cmm.Dataflow.Label.$fIsMapLabelMap
+ @ a_a18C5
+ @ CmmBlock
+ k_a18jT
+ z_a18jU)
+ (toBlockMap g_a18jV)
+
+-- RHS size: {terms: 6, types: 8, coercions: 0, joins: 0/0}
+toBlockList :: CmmGraph -> [CmmBlock]
+[LclIdX,
+ Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
+ WorkFree=True, Expandable=True, Guidance=IF_ARGS [0] 70 0}]
+toBlockList
+ = \ (g_a18jr :: CmmGraph) ->
+ $ @ 'ghc-prim-0.6.1:GHC.Types.LiftedRep
+ @ (LabelMap CmmBlock)
+ @ [CmmBlock]
+ (mapElems
+ @ LabelMap GHC.Cmm.Dataflow.Label.$fIsMapLabelMap @ CmmBlock)
+ (toBlockMap g_a18jr)
+
+-- RHS size: {terms: 41, types: 39, coercions: 3, joins: 0/2}
+toBlockListEntryFirst :: CmmGraph -> [CmmBlock]
+[LclIdX,
+ Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
+ WorkFree=True, Expandable=True, Guidance=IF_ARGS [0] 560 40}]
+toBlockListEntryFirst
+ = \ (g_a18js :: CmmGraph) ->
+ let {
+ entry_id_a18ju :: BlockId
+ [LclId,
+ Unf=Unf{Src=<vanilla>, TopLvl=False, Value=False, ConLike=False,
+ WorkFree=False, Expandable=True, Guidance=IF_ARGS [] 20 0}]
+ entry_id_a18ju = g_entry @ CmmNode g_a18js } in
+ let {
+ m_a18jt :: LabelMap CmmBlock
+ [LclId,
+ Unf=Unf{Src=<vanilla>, TopLvl=False, Value=False, ConLike=False,
+ WorkFree=False, Expandable=False, Guidance=IF_ARGS [] 20 0}]
+ m_a18jt = toBlockMap g_a18js } in
+ case mapNull
+ @ LabelMap
+ GHC.Cmm.Dataflow.Label.$fIsMapLabelMap
+ @ CmmBlock
+ m_a18jt
+ of {
+ False ->
+ ghc-prim-0.6.1:GHC.Types.:
+ @ CmmBlock
+ (case case mapLookup
+ @ LabelMap
+ GHC.Cmm.Dataflow.Label.$fIsMapLabelMap
+ @ CmmBlock
+ (entry_id_a18ju
+ `cast` (Sub (Sym (GHC.Cmm.Dataflow.Label.D:R:KeyOfLabelMap[0]))
+ :: Label ~R# KeyOf LabelMap))
+ m_a18jt
+ of {
+ __DEFAULT ->
+ Control.Exception.Base.patError
+ @ 'ghc-prim-0.6.1:GHC.Types.LiftedRep
+ @ (Unit CmmBlock)
+ "E:\\ghc_inferTags\\compiler\\GHC\\Cmm\\Utils.hs:541:5-43|Just entry_block"#;
+ Just entry_block_a18jv -> (entry_block_a18jv)
+ }
+ of
+ { (entry_block_a18jv) ->
+ entry_block_a18jv
+ })
+ (filter
+ @ (Block CmmNode C C)
+ (. @ BlockId
+ @ Bool
+ @ (Block CmmNode C C)
+ (\ (ds_d18LM :: BlockId) ->
+ /=
+ @ BlockId GHC.Cmm.Dataflow.Label.$fEqLabel ds_d18LM entry_id_a18ju)
+ (entryLabel @ (Block CmmNode) $dNonLocal_a18yU @ C))
+ (mapElems
+ @ LabelMap
+ GHC.Cmm.Dataflow.Label.$fIsMapLabelMap
+ @ CmmBlock
+ m_a18jt));
+ True -> ghc-prim-0.6.1:GHC.Types.[] @ CmmBlock
+ }
+
+-- RHS size: {terms: 85, types: 67, coercions: 12, joins: 0/4}
+toBlockListEntryFirstFalseFallthrough :: CmmGraph -> [CmmBlock]
+[LclIdX,
+ Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
+ WorkFree=True, Expandable=True, Guidance=NEVER}]
+toBlockListEntryFirstFalseFallthrough
+ = \ (g_a18jx :: CmmGraph) ->
+ let {
+ m_a18jy :: LabelMap CmmBlock
+ [LclId,
+ Unf=Unf{Src=<vanilla>, TopLvl=False, Value=False, ConLike=False,
+ WorkFree=False, Expandable=False, Guidance=IF_ARGS [] 20 0}]
+ m_a18jy = toBlockMap g_a18jx } in
+ let {
+ entry_block_a18jA :: CmmBlock
+ [LclId,
+ Unf=Unf{Src=<vanilla>, TopLvl=False, Value=False, ConLike=False,
+ WorkFree=False, Expandable=False, Guidance=IF_ARGS [] 300 0}]
+ entry_block_a18jA
+ = case case mapLookup
+ @ LabelMap
+ GHC.Cmm.Dataflow.Label.$fIsMapLabelMap
+ @ CmmBlock
+ ((g_entry @ CmmNode g_a18jx)
+ `cast` (Sub (Sym (GHC.Cmm.Dataflow.Label.D:R:KeyOfLabelMap[0]))
+ :: Label ~R# KeyOf LabelMap))
+ m_a18jy
+ of {
+ __DEFAULT ->
+ Control.Exception.Base.patError
+ @ 'ghc-prim-0.6.1:GHC.Types.LiftedRep
+ @ (Unit CmmBlock)
+ "E:\\ghc_inferTags\\compiler\\GHC\\Cmm\\Utils.hs:559:5-43|Just entry_block"#;
+ Just entry_block_a18jA -> (entry_block_a18jA)
+ }
+ of
+ { (entry_block_a18jA) ->
+ entry_block_a18jA
+ } } in
+ letrec {
+ dfs_a18jB [Occ=LoopBreaker] :: LabelSet -> [CmmBlock] -> [CmmBlock]
+ [LclId,
+ Unf=Unf{Src=<vanilla>, TopLvl=False, Value=True, ConLike=True,
+ WorkFree=True, Expandable=True, Guidance=IF_ARGS [0 30] 400 40}]
+ dfs_a18jB
+ = \ (ds_d18M9 :: LabelSet) (ds_d18Ma :: [CmmBlock]) ->
+ case ds_d18Ma of {
+ [] -> ghc-prim-0.6.1:GHC.Types.[] @ CmmBlock;
+ : block_a18jD bs_a18jE ->
+ let {
+ id_a18jF :: Label
+ [LclId,
+ Unf=Unf{Src=<vanilla>, TopLvl=False, Value=False, ConLike=False,
+ WorkFree=False, Expandable=False, Guidance=IF_ARGS [] 30 0}]
+ id_a18jF
+ = entryLabel
+ @ (Block CmmNode) $dNonLocal_a18yU @ C block_a18jD } in
+ case setMember
+ @ LabelSet
+ GHC.Cmm.Dataflow.Label.$fIsSetLabelSet
+ (id_a18jF
+ `cast` (Sub (Sym (GHC.Cmm.Dataflow.Label.D:R:ElemOfLabelSet[0]))
+ :: Label ~R# ElemOf LabelSet))
+ ds_d18M9
+ of {
+ False ->
+ ghc-prim-0.6.1:GHC.Types.:
+ @ CmmBlock
+ block_a18jD
+ (dfs_a18jB
+ (setInsert
+ @ LabelSet
+ GHC.Cmm.Dataflow.Label.$fIsSetLabelSet
+ (id_a18jF
+ `cast` (Sub (Sym (GHC.Cmm.Dataflow.Label.D:R:ElemOfLabelSet[0]))
+ :: Label ~R# ElemOf LabelSet))
+ ds_d18M9)
+ (foldr
+ @ []
+ Data.Foldable.$fFoldable[]
+ @ Label
+ @ [CmmBlock]
+ (\ (id_a18jI :: Label) (bs_a18jJ :: [CmmBlock]) ->
+ case mapLookup
+ @ LabelMap
+ GHC.Cmm.Dataflow.Label.$fIsMapLabelMap
+ @ CmmBlock
+ (id_a18jI
+ `cast` (Sub (Sym (GHC.Cmm.Dataflow.Label.D:R:KeyOfLabelMap[0]))
+ :: Label ~R# KeyOf LabelMap))
+ m_a18jy
+ of {
+ Nothing -> bs_a18jJ;
+ Just b_a18jK ->
+ ghc-prim-0.6.1:GHC.Types.: @ CmmBlock b_a18jK bs_a18jJ
+ })
+ bs_a18jE
+ (successors @ (Block CmmNode) $dNonLocal_a18yU @ C block_a18jD)));
+ True -> dfs_a18jB ds_d18M9 bs_a18jE
+ }
+ }; } in
+ case mapNull
+ @ LabelMap
+ GHC.Cmm.Dataflow.Label.$fIsMapLabelMap
+ @ CmmBlock
+ m_a18jy
+ of {
+ False ->
+ dfs_a18jB
+ (setEmpty @ LabelSet GHC.Cmm.Dataflow.Label.$fIsSetLabelSet)
+ (GHC.Base.build
+ @ CmmBlock
+ (\ (@ a_d18LY)
+ (c_d18LZ :: CmmBlock -> a_d18LY -> a_d18LY)
+ (n_d18M0 :: a_d18LY) ->
+ c_d18LZ entry_block_a18jA n_d18M0));
+ True -> ghc-prim-0.6.1:GHC.Types.[] @ CmmBlock
+ }
+
+-- RHS size: {terms: 23, types: 100, coercions: 0, joins: 0/0}
+mapGraphNodes
+ :: (CmmNode C O -> CmmNode C O, CmmNode O O -> CmmNode O O,
+ CmmNode O C -> CmmNode O C)
+ -> CmmGraph -> CmmGraph
+[LclIdX,
+ Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
+ WorkFree=True, Expandable=True, Guidance=IF_ARGS [20 0] 290 0}]
+mapGraphNodes
+ = \ (funs_a18jP
+ :: (CmmNode C O -> CmmNode C O, CmmNode O O -> CmmNode O O,
+ CmmNode O C -> CmmNode O C))
+ (g_a18jR :: CmmGraph) ->
+ case funs_a18jP of wild_00
+ { (mf_a18jQ, _ [Occ=Dead], _ [Occ=Dead]) ->
+ $ @ 'ghc-prim-0.6.1:GHC.Types.LiftedRep
+ @ (LabelMap CmmBlock)
+ @ CmmGraph
+ (ofBlockMap
+ ($ @ 'ghc-prim-0.6.1:GHC.Types.LiftedRep
+ @ (CmmNode C O)
+ @ Label
+ (entryLabel @ CmmNode GHC.Cmm.Node.$fNonLocalCmmNode @ O)
+ ($ @ 'ghc-prim-0.6.1:GHC.Types.LiftedRep
+ @ (CmmNode C O)
+ @ (CmmNode C O)
+ mf_a18jQ
+ (GHC.Cmm.Node.$WCmmEntry
+ (g_entry @ CmmNode g_a18jR) GHC.Cmm.Node.GlobalScope))))
+ ($ @ 'ghc-prim-0.6.1:GHC.Types.LiftedRep
+ @ (LabelMap (Block CmmNode C C))
+ @ (LabelMap (Block CmmNode C C))
+ (mapMap
+ @ LabelMap
+ GHC.Cmm.Dataflow.Label.$fIsMapLabelMap
+ @ (Block CmmNode C C)
+ @ (Block CmmNode C C)
+ (mapBlock3' @ CmmNode @ CmmNode @ C @ C wild_00))
+ (toBlockMap g_a18jR))
+ }
+
+
+
+==================== Desugar (after optimization) ====================
+2020-11-24 12:44:28.4624015 UTC
+
+Result size of Desugar (after optimization)
+ = {terms: 1,627, types: 1,401, coercions: 43, joins: 9/24}
+
+-- RHS size: {terms: 16, types: 3, coercions: 0, joins: 0/0}
+slotCmmType :: Platform -> SlotTy -> CmmType
+[LclIdX,
+ Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
+ WorkFree=True, Expandable=True, Guidance=IF_ARGS [0 80] 90 0}]
+slotCmmType
+ = \ (platform_a5gV1 :: Platform) (ds_d5hOU :: SlotTy) ->
+ case ds_d5hOU of {
+ PtrSlot -> gcWord platform_a5gV1;
+ WordSlot -> bWord platform_a5gV1;
+ Word64Slot -> b64;
+ FloatSlot -> f32;
+ DoubleSlot -> f64
+ }
+
+-- RHS size: {terms: 23, types: 2, coercions: 0, joins: 0/0}
+primElemRepCmmType :: PrimElemRep -> CmmType
+[LclIdX,
+ Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
+ WorkFree=True, Expandable=True, Guidance=IF_ARGS [110] 100 0}]
+primElemRepCmmType
+ = \ (ds_d5hOv :: PrimElemRep) ->
+ case ds_d5hOv of {
+ Int8ElemRep -> b8;
+ Int16ElemRep -> b16;
+ Int32ElemRep -> b32;
+ Int64ElemRep -> b64;
+ Word8ElemRep -> b8;
+ Word16ElemRep -> b16;
+ Word32ElemRep -> b32;
+ Word64ElemRep -> b64;
+ FloatElemRep -> f32;
+ DoubleElemRep -> f64
+ }
+
+-- RHS size: {terms: 48, types: 6, coercions: 0, joins: 0/0}
+primRepCmmType :: Platform -> PrimRep -> CmmType
+[LclIdX,
+ Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
+ WorkFree=True, Expandable=True, Guidance=IF_ARGS [0 330] 430 0}]
+primRepCmmType
+ = \ (platform_a5gUY :: Platform) (ds_d5hP9 :: PrimRep) ->
+ case ds_d5hP9 of {
+ VoidRep ->
+ panic
+ @ CmmType
+ (ghc-prim-0.6.1:GHC.CString.unpackCString#
+ "primRepCmmType:VoidRep"#);
+ LiftedRep -> gcWord platform_a5gUY;
+ UnliftedRep -> gcWord platform_a5gUY;
+ Int8Rep -> b8;
+ Int16Rep -> b16;
+ Int32Rep -> b32;
+ Int64Rep -> b64;
+ IntRep -> bWord platform_a5gUY;
+ Word8Rep -> b8;
+ Word16Rep -> b16;
+ Word32Rep -> b32;
+ Word64Rep -> b64;
+ WordRep -> bWord platform_a5gUY;
+ AddrRep -> bWord platform_a5gUY;
+ FloatRep -> f32;
+ DoubleRep -> f64;
+ VecRep len_a5gUZ rep_a5gV0 ->
+ vec len_a5gUZ (primElemRepCmmType rep_a5gV0)
+ }
+
+-- RHS size: {terms: 39, types: 5, coercions: 0, joins: 0/0}
+primRepForeignHint :: PrimRep -> ForeignHint
+[LclIdX,
+ Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
+ WorkFree=True, Expandable=True, Guidance=IF_ARGS [180] 290 160}]
+primRepForeignHint
+ = \ (ds_d5hNK :: PrimRep) ->
+ case ds_d5hNK of {
+ VoidRep ->
+ panic
+ @ ForeignHint
+ (ghc-prim-0.6.1:GHC.CString.unpackCString#
+ "primRepForeignHint:VoidRep"#);
+ LiftedRep -> GHC.Cmm.Type.AddrHint;
+ UnliftedRep -> GHC.Cmm.Type.AddrHint;
+ Int8Rep -> GHC.Cmm.Type.SignedHint;
+ Int16Rep -> GHC.Cmm.Type.SignedHint;
+ Int32Rep -> GHC.Cmm.Type.SignedHint;
+ Int64Rep -> GHC.Cmm.Type.SignedHint;
+ IntRep -> GHC.Cmm.Type.SignedHint;
+ Word8Rep -> GHC.Cmm.Type.NoHint;
+ Word16Rep -> GHC.Cmm.Type.NoHint;
+ Word32Rep -> GHC.Cmm.Type.NoHint;
+ Word64Rep -> GHC.Cmm.Type.NoHint;
+ WordRep -> GHC.Cmm.Type.NoHint;
+ AddrRep -> GHC.Cmm.Type.AddrHint;
+ FloatRep -> GHC.Cmm.Type.NoHint;
+ DoubleRep -> GHC.Cmm.Type.NoHint;
+ VecRep _ [Occ=Dead] _ [Occ=Dead] -> GHC.Cmm.Type.NoHint
+ }
+
+-- RHS size: {terms: 13, types: 2, coercions: 0, joins: 0/0}
+slotForeignHint :: SlotTy -> ForeignHint
+[LclIdX,
+ Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
+ WorkFree=True, Expandable=True, Guidance=IF_ARGS [60] 50 50}]
+slotForeignHint
+ = \ (ds_d5hNv :: SlotTy) ->
+ case ds_d5hNv of {
+ PtrSlot -> GHC.Cmm.Type.AddrHint;
+ WordSlot -> GHC.Cmm.Type.NoHint;
+ Word64Slot -> GHC.Cmm.Type.NoHint;
+ FloatSlot -> GHC.Cmm.Type.NoHint;
+ DoubleSlot -> GHC.Cmm.Type.NoHint
+ }
+
+-- RHS size: {terms: 5, types: 1, coercions: 0, joins: 0/0}
+zeroCLit :: Platform -> CmmLit
+[LclIdX,
+ Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
+ WorkFree=True, Expandable=True, Guidance=IF_ARGS [0] 150 0}]
+zeroCLit
+ = \ (platform_a5gV8 :: Platform) ->
+ GHC.Cmm.Expr.$WCmmInt 0 (wordWidth platform_a5gV8)
+
+-- RHS size: {terms: 4, types: 1, coercions: 0, joins: 0/0}
+zeroExpr :: Platform -> CmmExpr
+[LclIdX,
+ Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
+ WorkFree=True, Expandable=True, Guidance=IF_ARGS [0] 30 20}]
+zeroExpr
+ = \ (platform_a5gV9 :: Platform) ->
+ GHC.Cmm.Expr.CmmLit (zeroCLit platform_a5gV9)
+
+-- RHS size: {terms: 6, types: 2, coercions: 0, joins: 0/0}
+mkWordCLit :: Platform -> Integer -> CmmLit
+[LclIdX,
+ Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
+ WorkFree=True, Expandable=True, Guidance=IF_ARGS [0 0] 50 0}]
+mkWordCLit
+ = \ (platform_a5gVa :: Platform) (wd_a5gVb :: Integer) ->
+ GHC.Cmm.Expr.$WCmmInt wd_a5gVb (wordWidth platform_a5gVa)
+
+-- RHS size: {terms: 32, types: 35, coercions: 0, joins: 0/0}
+mkByteStringCLit
+ :: forall (raw :: Bool) info stmt.
+ CLabel
+ -> ByteString -> (CmmLit, GenCmmDecl (GenCmmStatics raw) info stmt)
+[LclIdX,
+ Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
+ WorkFree=True, Expandable=True, Guidance=IF_ARGS [0 0] 320 30}]
+mkByteStringCLit
+ = \ (@ (raw_a5hlM :: Bool))
+ (@ info_a5hlN)
+ (@ stmt_a5hlO)
+ (lbl_a5gVc :: CLabel)
+ (bytes_a5gVd :: ByteString) ->
+ (GHC.Cmm.Expr.CmmLabel lbl_a5gVc,
+ $ @ 'ghc-prim-0.6.1:GHC.Types.LiftedRep
+ @ (GenCmmStatics raw_a5hlM)
+ @ (GenCmmDecl (GenCmmStatics raw_a5hlM) info_a5hlN stmt_a5hlO)
+ (GHC.Cmm.CmmData
+ @ (GenCmmStatics raw_a5hlM)
+ @ info_a5hlN
+ @ stmt_a5hlO
+ (GHC.Cmm.Section
+ (case BS.elem
+ (fromInteger @ GHC.Word.Word8 GHC.Word.$fNumWord8 0) bytes_a5gVd
+ of {
+ False -> GHC.Cmm.CString;
+ True -> GHC.Cmm.ReadOnlyData
+ })
+ lbl_a5gVc))
+ (GHC.Cmm.CmmStaticsRaw
+ @ raw_a5hlM
+ lbl_a5gVc
+ (GHC.Base.build
+ @ CmmStatic
+ (\ (@ a_d5hKu)
+ (c_d5hKv :: CmmStatic -> a_d5hKu -> a_d5hKu)
+ (n_d5hKw :: a_d5hKu) ->
+ c_d5hKv (GHC.Cmm.CmmString bytes_a5gVd) n_d5hKw))))
+
+-- RHS size: {terms: 22, types: 25, coercions: 0, joins: 0/0}
+mkFileEmbedLit
+ :: forall (raw :: Bool) info stmt.
+ CLabel
+ -> FilePath -> (CmmLit, GenCmmDecl (GenCmmStatics raw) info stmt)
+[LclIdX,
+ Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
+ WorkFree=True, Expandable=True, Guidance=IF_ARGS [0 0] 110 30}]
+mkFileEmbedLit
+ = \ (@ (raw_a5hlE :: Bool))
+ (@ info_a5hlF)
+ (@ stmt_a5hlG)
+ (lbl_a5gVf :: CLabel)
+ (path_a5gVg :: FilePath) ->
+ (GHC.Cmm.Expr.CmmLabel lbl_a5gVf,
+ GHC.Cmm.CmmData
+ @ (GenCmmStatics raw_a5hlE)
+ @ info_a5hlF
+ @ stmt_a5hlG
+ (GHC.Cmm.Section GHC.Cmm.ReadOnlyData lbl_a5gVf)
+ (GHC.Cmm.CmmStaticsRaw
+ @ raw_a5hlE
+ lbl_a5gVf
+ (GHC.Base.build
+ @ CmmStatic
+ (\ (@ a_d5hKr)
+ (c_d5hKs :: CmmStatic -> a_d5hKr -> a_d5hKr)
+ (n_d5hKt :: a_d5hKr) ->
+ c_d5hKs (GHC.Cmm.CmmFileEmbed path_a5gVg) n_d5hKt))))
+
+-- RHS size: {terms: 14, types: 21, coercions: 0, joins: 0/0}
+mkDataLits
+ :: forall (raw :: Bool) info stmt.
+ Section
+ -> CLabel -> [CmmLit] -> GenCmmDecl (GenCmmStatics raw) info stmt
+[LclIdX,
+ Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
+ WorkFree=True, Expandable=True, Guidance=IF_ARGS [0 0 0] 80 30}]
+mkDataLits
+ = \ (@ (raw_a5hkX :: Bool))
+ (@ info_a5hkY)
+ (@ stmt_a5hkZ)
+ (section_a5gVh :: Section)
+ (lbl_a5gVi :: CLabel)
+ (lits_a5gVj :: [CmmLit]) ->
+ GHC.Cmm.CmmData
+ @ (GenCmmStatics raw_a5hkX)
+ @ info_a5hkY
+ @ stmt_a5hkZ
+ section_a5gVh
+ ($ @ 'ghc-prim-0.6.1:GHC.Types.LiftedRep
+ @ [CmmStatic]
+ @ (GenCmmStatics raw_a5hkX)
+ (GHC.Cmm.CmmStaticsRaw @ raw_a5hkX lbl_a5gVi)
+ (map @ CmmLit @ CmmStatic GHC.Cmm.CmmStaticLit lits_a5gVj))
+
+-- RHS size: {terms: 7, types: 2, coercions: 0, joins: 0/0}
+mkStgWordCLit :: Platform -> StgWord -> CmmLit
+[LclIdX,
+ Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
+ WorkFree=True, Expandable=True, Guidance=IF_ARGS [0 0] 70 0}]
+mkStgWordCLit
+ = \ (platform_a5gVo :: Platform) (wd_a5gVp :: StgWord) ->
+ GHC.Cmm.Expr.$WCmmInt
+ (fromStgWord wd_a5gVp) (wordWidth platform_a5gVo)
+
+-- RHS size: {terms: 4, types: 1, coercions: 0, joins: 0/0}
+mkLblExpr :: CLabel -> CmmExpr
+[LclIdX,
+ Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
+ WorkFree=True, Expandable=True,
+ Guidance=ALWAYS_IF(arity=1,unsat_ok=True,boring_ok=True)}]
+mkLblExpr
+ = \ (lbl_a5gVv :: CLabel) ->
+ GHC.Cmm.Expr.CmmLit (GHC.Cmm.Expr.CmmLabel lbl_a5gVv)
+
+-- RHS size: {terms: 14, types: 5, coercions: 0, joins: 0/0}
+cmmRegOff :: CmmReg -> Int -> CmmExpr
+[LclIdX,
+ Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
+ WorkFree=True, Expandable=True, Guidance=IF_ARGS [0 20] 80 0}]
+cmmRegOff
+ = \ (reg_a5gVS :: CmmReg) (ds_d5hEs :: Int) ->
+ case ds_d5hEs of { ghc-prim-0.6.1:GHC.Types.I# ds_d5hEz ->
+ case ds_d5hEz of {
+ __DEFAULT -> GHC.Cmm.Expr.$WCmmRegOff reg_a5gVS ds_d5hEs;
+ 0# -> GHC.Cmm.Expr.$WCmmReg reg_a5gVS
+ }
+ }
+
+-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
+cmmRegOffB :: CmmReg -> ByteOff -> CmmExpr
+[LclIdX,
+ Unf=Unf{Src=<vanilla>, TopLvl=True, Value=False, ConLike=False,
+ WorkFree=True, Expandable=True,
+ Guidance=ALWAYS_IF(arity=0,unsat_ok=True,boring_ok=True)}]
+cmmRegOffB = cmmRegOff
+
+-- RHS size: {terms: 14, types: 5, coercions: 0, joins: 0/0}
+cmmLabelOff :: CLabel -> Int -> CmmLit
+[LclIdX,
+ Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
+ WorkFree=True, Expandable=True, Guidance=IF_ARGS [0 20] 50 50}]
+cmmLabelOff
+ = \ (lbl_a5gW9 :: CLabel) (ds_d5hDo :: Int) ->
+ case ds_d5hDo of { ghc-prim-0.6.1:GHC.Types.I# ds_d5hDv ->
+ case ds_d5hDv of {
+ __DEFAULT -> GHC.Cmm.Expr.CmmLabelOff lbl_a5gW9 ds_d5hDo;
+ 0# -> GHC.Cmm.Expr.CmmLabel lbl_a5gW9
+ }
+ }
+
+-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
+cmmLabelOffB :: CLabel -> ByteOff -> CmmLit
+[LclIdX,
+ Unf=Unf{Src=<vanilla>, TopLvl=True, Value=False, ConLike=False,
+ WorkFree=True, Expandable=True,
+ Guidance=ALWAYS_IF(arity=0,unsat_ok=True,boring_ok=True)}]
+cmmLabelOffB = cmmLabelOff
+
+-- RHS size: {terms: 15, types: 10, coercions: 0, joins: 0/0}
+cmmOrWord :: Platform -> CmmExpr -> CmmExpr -> CmmExpr
+[LclIdX,
+ Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
+ WorkFree=True, Expandable=True, Guidance=IF_ARGS [0 0 0] 110 30}]
+cmmOrWord
+ = \ (platform_a5gWQ :: Platform)
+ (e1_a5gWR :: CmmExpr)
+ (e2_a5gWS :: CmmExpr) ->
+ GHC.Cmm.Expr.CmmMachOp
+ (mo_wordOr platform_a5gWQ)
+ (GHC.Base.build
+ @ CmmExpr
+ (\ (@ a_d5hDl)
+ (c_d5hDm :: CmmExpr -> a_d5hDl -> a_d5hDl)
+ (n_d5hDn :: a_d5hDl) ->
+ c_d5hDm e1_a5gWR (c_d5hDm e2_a5gWS n_d5hDn)))
+
+-- RHS size: {terms: 15, types: 10, coercions: 0, joins: 0/0}
+cmmAndWord :: Platform -> CmmExpr -> CmmExpr -> CmmExpr
+[LclIdX,
+ Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
+ WorkFree=True, Expandable=True, Guidance=IF_ARGS [0 0 0] 110 30}]
+cmmAndWord
+ = \ (platform_a5gWT :: Platform)
+ (e1_a5gWU :: CmmExpr)
+ (e2_a5gWV :: CmmExpr) ->
+ GHC.Cmm.Expr.CmmMachOp
+ (mo_wordAnd platform_a5gWT)
+ (GHC.Base.build
+ @ CmmExpr
+ (\ (@ a_d5hDi)
+ (c_d5hDj :: CmmExpr -> a_d5hDi -> a_d5hDi)
+ (n_d5hDk :: a_d5hDi) ->
+ c_d5hDj e1_a5gWU (c_d5hDj e2_a5gWV n_d5hDk)))
+
+-- RHS size: {terms: 15, types: 10, coercions: 0, joins: 0/0}
+cmmNeWord :: Platform -> CmmExpr -> CmmExpr -> CmmExpr
+[LclIdX,
+ Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
+ WorkFree=True, Expandable=True, Guidance=IF_ARGS [0 0 0] 110 30}]
+cmmNeWord
+ = \ (platform_a5gWW :: Platform)
+ (e1_a5gWX :: CmmExpr)
+ (e2_a5gWY :: CmmExpr) ->
+ GHC.Cmm.Expr.CmmMachOp
+ (mo_wordNe platform_a5gWW)
+ (GHC.Base.build
+ @ CmmExpr
+ (\ (@ a_d5hDf)
+ (c_d5hDg :: CmmExpr -> a_d5hDf -> a_d5hDf)
+ (n_d5hDh :: a_d5hDf) ->
+ c_d5hDg e1_a5gWX (c_d5hDg e2_a5gWY n_d5hDh)))
+
+-- RHS size: {terms: 15, types: 10, coercions: 0, joins: 0/0}
+cmmEqWord :: Platform -> CmmExpr -> CmmExpr -> CmmExpr
+[LclIdX,
+ Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
+ WorkFree=True, Expandable=True, Guidance=IF_ARGS [0 0 0] 110 30}]
+cmmEqWord
+ = \ (platform_a5gWZ :: Platform)
+ (e1_a5gX0 :: CmmExpr)
+ (e2_a5gX1 :: CmmExpr) ->
+ GHC.Cmm.Expr.CmmMachOp
+ (mo_wordEq platform_a5gWZ)
+ (GHC.Base.build
+ @ CmmExpr
+ (\ (@ a_d5hDc)
+ (c_d5hDd :: CmmExpr -> a_d5hDc -> a_d5hDc)
+ (n_d5hDe :: a_d5hDc) ->
+ c_d5hDd e1_a5gX0 (c_d5hDd e2_a5gX1 n_d5hDe)))
+
+-- RHS size: {terms: 15, types: 10, coercions: 0, joins: 0/0}
+cmmULtWord :: Platform -> CmmExpr -> CmmExpr -> CmmExpr
+[LclIdX,
+ Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
+ WorkFree=True, Expandable=True, Guidance=IF_ARGS [0 0 0] 110 30}]
+cmmULtWord
+ = \ (platform_a5gX2 :: Platform)
+ (e1_a5gX3 :: CmmExpr)
+ (e2_a5gX4 :: CmmExpr) ->
+ GHC.Cmm.Expr.CmmMachOp
+ (mo_wordULt platform_a5gX2)
+ (GHC.Base.build
+ @ CmmExpr
+ (\ (@ a_d5hD9)
+ (c_d5hDa :: CmmExpr -> a_d5hD9 -> a_d5hD9)
+ (n_d5hDb :: a_d5hD9) ->
+ c_d5hDa e1_a5gX3 (c_d5hDa e2_a5gX4 n_d5hDb)))
+
+-- RHS size: {terms: 15, types: 10, coercions: 0, joins: 0/0}
+cmmUGeWord :: Platform -> CmmExpr -> CmmExpr -> CmmExpr
+[LclIdX,
+ Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
+ WorkFree=True, Expandable=True, Guidance=IF_ARGS [0 0 0] 110 30}]
+cmmUGeWord
+ = \ (platform_a5gX5 :: Platform)
+ (e1_a5gX6 :: CmmExpr)
+ (e2_a5gX7 :: CmmExpr) ->
+ GHC.Cmm.Expr.CmmMachOp
+ (mo_wordUGe platform_a5gX5)
+ (GHC.Base.build
+ @ CmmExpr
+ (\ (@ a_d5hD6)
+ (c_d5hD7 :: CmmExpr -> a_d5hD6 -> a_d5hD6)
+ (n_d5hD8 :: a_d5hD6) ->
+ c_d5hD7 e1_a5gX6 (c_d5hD7 e2_a5gX7 n_d5hD8)))
+
+-- RHS size: {terms: 15, types: 10, coercions: 0, joins: 0/0}
+cmmUGtWord :: Platform -> CmmExpr -> CmmExpr -> CmmExpr
+[LclIdX,
+ Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
+ WorkFree=True, Expandable=True, Guidance=IF_ARGS [0 0 0] 110 30}]
+cmmUGtWord
+ = \ (platform_a5gX8 :: Platform)
+ (e1_a5gX9 :: CmmExpr)
+ (e2_a5gXa :: CmmExpr) ->
+ GHC.Cmm.Expr.CmmMachOp
+ (mo_wordUGt platform_a5gX8)
+ (GHC.Base.build
+ @ CmmExpr
+ (\ (@ a_d5hD3)
+ (c_d5hD4 :: CmmExpr -> a_d5hD3 -> a_d5hD3)
+ (n_d5hD5 :: a_d5hD3) ->
+ c_d5hD4 e1_a5gX9 (c_d5hD4 e2_a5gXa n_d5hD5)))
+
+-- RHS size: {terms: 15, types: 10, coercions: 0, joins: 0/0}
+cmmSLtWord :: Platform -> CmmExpr -> CmmExpr -> CmmExpr
+[LclIdX,
+ Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
+ WorkFree=True, Expandable=True, Guidance=IF_ARGS [0 0 0] 110 30}]
+cmmSLtWord
+ = \ (platform_a5gXb :: Platform)
+ (e1_a5gXc :: CmmExpr)
+ (e2_a5gXd :: CmmExpr) ->
+ GHC.Cmm.Expr.CmmMachOp
+ (mo_wordSLt platform_a5gXb)
+ (GHC.Base.build
+ @ CmmExpr
+ (\ (@ a_d5hD0)
+ (c_d5hD1 :: CmmExpr -> a_d5hD0 -> a_d5hD0)
+ (n_d5hD2 :: a_d5hD0) ->
+ c_d5hD1 e1_a5gXc (c_d5hD1 e2_a5gXd n_d5hD2)))
+
+-- RHS size: {terms: 15, types: 10, coercions: 0, joins: 0/0}
+cmmUShrWord :: Platform -> CmmExpr -> CmmExpr -> CmmExpr
+[LclIdX,
+ Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
+ WorkFree=True, Expandable=True, Guidance=IF_ARGS [0 0 0] 110 30}]
+cmmUShrWord
+ = \ (platform_a5gXe :: Platform)
+ (e1_a5gXf :: CmmExpr)
+ (e2_a5gXg :: CmmExpr) ->
+ GHC.Cmm.Expr.CmmMachOp
+ (mo_wordUShr platform_a5gXe)
+ (GHC.Base.build
+ @ CmmExpr
+ (\ (@ a_d5hCX)
+ (c_d5hCY :: CmmExpr -> a_d5hCX -> a_d5hCX)
+ (n_d5hCZ :: a_d5hCX) ->
+ c_d5hCY e1_a5gXf (c_d5hCY e2_a5gXg n_d5hCZ)))
+
+-- RHS size: {terms: 15, types: 10, coercions: 0, joins: 0/0}
+cmmAddWord :: Platform -> CmmExpr -> CmmExpr -> CmmExpr
+[LclIdX,
+ Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
+ WorkFree=True, Expandable=True, Guidance=IF_ARGS [0 0 0] 110 30}]
+cmmAddWord
+ = \ (platform_a5gXh :: Platform)
+ (e1_a5gXi :: CmmExpr)
+ (e2_a5gXj :: CmmExpr) ->
+ GHC.Cmm.Expr.CmmMachOp
+ (mo_wordAdd platform_a5gXh)
+ (GHC.Base.build
+ @ CmmExpr
+ (\ (@ a_d5hCU)
+ (c_d5hCV :: CmmExpr -> a_d5hCU -> a_d5hCU)
+ (n_d5hCW :: a_d5hCU) ->
+ c_d5hCV e1_a5gXi (c_d5hCV e2_a5gXj n_d5hCW)))
+
+-- RHS size: {terms: 15, types: 10, coercions: 0, joins: 0/0}
+cmmSubWord :: Platform -> CmmExpr -> CmmExpr -> CmmExpr
+[LclIdX,
+ Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
+ WorkFree=True, Expandable=True, Guidance=IF_ARGS [0 0 0] 110 30}]
+cmmSubWord
+ = \ (platform_a5gXk :: Platform)
+ (e1_a5gXl :: CmmExpr)
+ (e2_a5gXm :: CmmExpr) ->
+ GHC.Cmm.Expr.CmmMachOp
+ (mo_wordSub platform_a5gXk)
+ (GHC.Base.build
+ @ CmmExpr
+ (\ (@ a_d5hCR)
+ (c_d5hCS :: CmmExpr -> a_d5hCR -> a_d5hCR)
+ (n_d5hCT :: a_d5hCR) ->
+ c_d5hCS e1_a5gXl (c_d5hCS e2_a5gXm n_d5hCT)))
+
+-- RHS size: {terms: 15, types: 10, coercions: 0, joins: 0/0}
+cmmMulWord :: Platform -> CmmExpr -> CmmExpr -> CmmExpr
+[LclIdX,
+ Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
+ WorkFree=True, Expandable=True, Guidance=IF_ARGS [0 0 0] 110 30}]
+cmmMulWord
+ = \ (platform_a5gXn :: Platform)
+ (e1_a5gXo :: CmmExpr)
+ (e2_a5gXp :: CmmExpr) ->
+ GHC.Cmm.Expr.CmmMachOp
+ (mo_wordMul platform_a5gXn)
+ (GHC.Base.build
+ @ CmmExpr
+ (\ (@ a_d5hCO)
+ (c_d5hCP :: CmmExpr -> a_d5hCO -> a_d5hCO)
+ (n_d5hCQ :: a_d5hCO) ->
+ c_d5hCP e1_a5gXo (c_d5hCP e2_a5gXp n_d5hCQ)))
+
+-- RHS size: {terms: 15, types: 10, coercions: 0, joins: 0/0}
+cmmQuotWord :: Platform -> CmmExpr -> CmmExpr -> CmmExpr
+[LclIdX,
+ Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
+ WorkFree=True, Expandable=True, Guidance=IF_ARGS [0 0 0] 110 30}]
+cmmQuotWord
+ = \ (platform_a5gXq :: Platform)
+ (e1_a5gXr :: CmmExpr)
+ (e2_a5gXs :: CmmExpr) ->
+ GHC.Cmm.Expr.CmmMachOp
+ (mo_wordUQuot platform_a5gXq)
+ (GHC.Base.build
+ @ CmmExpr
+ (\ (@ a_d5hCL)
+ (c_d5hCM :: CmmExpr -> a_d5hCL -> a_d5hCL)
+ (n_d5hCN :: a_d5hCL) ->
+ c_d5hCM e1_a5gXr (c_d5hCM e2_a5gXs n_d5hCN)))
+
+-- RHS size: {terms: 19, types: 9, coercions: 0, joins: 0/1}
+cmmMkAssign
+ :: Platform -> CmmExpr -> Unique -> (CmmNode O O, CmmExpr)
+[LclIdX,
+ Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
+ WorkFree=True, Expandable=True, Guidance=IF_ARGS [0 0 0] 160 30}]
+cmmMkAssign
+ = \ (platform_a5gXB :: Platform)
+ (expr_a5gXC :: CmmExpr)
+ (uq_a5gXD :: Unique) ->
+ case cmmExprType platform_a5gXB expr_a5gXC of ty_a5gXE
+ { __DEFAULT ->
+ let {
+ reg_a5gXF :: CmmReg
+ [LclId,
+ Unf=Unf{Src=<vanilla>, TopLvl=False, Value=False, ConLike=False,
+ WorkFree=False, Expandable=False, Guidance=IF_ARGS [] 50 0}]
+ reg_a5gXF
+ = GHC.Cmm.Expr.$WCmmLocal
+ (GHC.Cmm.Expr.$WLocalReg uq_a5gXD ty_a5gXE) } in
+ (GHC.Cmm.Node.$WCmmAssign reg_a5gXF expr_a5gXC,
+ GHC.Cmm.Expr.$WCmmReg reg_a5gXF)
+ }
+
+-- RHS size: {terms: 17, types: 14, coercions: 0, joins: 0/0}
+isTrivialCmmExpr :: CmmExpr -> Bool
+[LclIdX,
+ Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
+ WorkFree=True, Expandable=True, Guidance=IF_ARGS [70] 190 50}]
+isTrivialCmmExpr
+ = \ (ds_d5hzu :: CmmExpr) ->
+ case ds_d5hzu of {
+ CmmLit _ [Occ=Dead] -> ghc-prim-0.6.1:GHC.Types.True;
+ CmmLoad _ [Occ=Dead] _ [Occ=Dead] ->
+ ghc-prim-0.6.1:GHC.Types.False;
+ CmmReg _ [Occ=Dead] -> ghc-prim-0.6.1:GHC.Types.True;
+ CmmMachOp _ [Occ=Dead] _ [Occ=Dead] ->
+ ghc-prim-0.6.1:GHC.Types.False;
+ CmmStackSlot _ [Occ=Dead] _ [Occ=Dead] ->
+ panic
+ @ Bool
+ (ghc-prim-0.6.1:GHC.CString.unpackCString#
+ "isTrivialCmmExpr CmmStackSlot"#);
+ CmmRegOff _ [Occ=Dead] _ [Occ=Dead] ->
+ ghc-prim-0.6.1:GHC.Types.True
+ }
+
+-- RHS size: {terms: 7, types: 3, coercions: 0, joins: 0/0}
+isLit :: CmmExpr -> Bool
+[LclIdX,
+ Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
+ WorkFree=True, Expandable=True,
+ Guidance=ALWAYS_IF(arity=1,unsat_ok=True,boring_ok=True)}]
+isLit
+ = \ (ds_d5hvQ :: CmmExpr) ->
+ case ds_d5hvQ of {
+ __DEFAULT -> ghc-prim-0.6.1:GHC.Types.False;
+ CmmLit _ [Occ=Dead] -> ghc-prim-0.6.1:GHC.Types.True
+ }
+
+-- RHS size: {terms: 8, types: 5, coercions: 0, joins: 0/0}
+isComparisonExpr :: CmmExpr -> Bool
+[LclIdX,
+ Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
+ WorkFree=True, Expandable=True, Guidance=IF_ARGS [30] 40 10}]
+isComparisonExpr
+ = \ (ds_d5hvD :: CmmExpr) ->
+ case ds_d5hvD of {
+ __DEFAULT -> ghc-prim-0.6.1:GHC.Types.False;
+ CmmMachOp op_a5gXI _ [Occ=Dead] -> isComparisonMachOp op_a5gXI
+ }
+
+-- RHS size: {terms: 10, types: 19, coercions: 0, joins: 0/0}
+modifyGraph
+ :: forall (n :: Extensibility -> Extensibility -> *)
+ (n' :: Extensibility -> Extensibility -> *).
+ (Graph n C C -> Graph n' C C) -> GenCmmGraph n -> GenCmmGraph n'
+[LclIdX,
+ Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
+ WorkFree=True, Expandable=True, Guidance=IF_ARGS [60 0] 70 30}]
+modifyGraph
+ = \ (@ (n_a5hh3 :: Extensibility -> Extensibility -> *))
+ (@ (n'_a5hh4 :: Extensibility -> Extensibility -> *))
+ (f_a5gYj :: Graph n_a5hh3 C C -> Graph n'_a5hh4 C C)
+ (g_a5gYk :: GenCmmGraph n_a5hh3) ->
+ GHC.Cmm.CmmGraph
+ @ n'_a5hh4
+ (g_entry @ n_a5hh3 g_a5gYk)
+ (f_a5gYj (g_graph @ n_a5hh3 g_a5gYk))
+
+-- RHS size: {terms: 4, types: 14, coercions: 0, joins: 0/0}
+mapGraphNodes1
+ :: (forall (e :: Extensibility) (x :: Extensibility).
+ CmmNode e x -> CmmNode e x)
+ -> CmmGraph -> CmmGraph
+[LclIdX,
+ Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
+ WorkFree=True, Expandable=True, Guidance=IF_ARGS [0] 40 0}]
+mapGraphNodes1
+ = \ (f_a5gYP
+ :: forall (e :: Extensibility) (x :: Extensibility).
+ CmmNode e x -> CmmNode e x) ->
+ modifyGraph
+ @ CmmNode @ CmmNode (mapGraph @ CmmNode @ CmmNode @ C @ C f_a5gYP)
+
+-- RHS size: {terms: 27, types: 57, coercions: 0, joins: 1/1}
+toBlockMap :: CmmGraph -> LabelMap CmmBlock
+[LclIdX,
+ Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
+ WorkFree=True, Expandable=True, Guidance=IF_ARGS [20] 292 0}]
+toBlockMap
+ = \ (ds_d5hoq :: GenCmmGraph CmmNode) ->
+ join {
+ fail_d5hq7 :: ghc-prim-0.6.1:GHC.Prim.Void# -> LabelMap CmmBlock
+ [LclId[JoinId(1)],
+ Str=<L,U>,
+ Unf=Unf{Src=<vanilla>, TopLvl=False, Value=True, ConLike=True,
+ WorkFree=True, Expandable=True, Guidance=IF_ARGS [0] 210 0}]
+ fail_d5hq7 _ [Occ=Dead, OS=OneShot]
+ = Control.Exception.Base.patError
+ @ 'ghc-prim-0.6.1:GHC.Types.LiftedRep
+ @ (LabelMap CmmBlock)
+ "E:\\ghc_inferTags\\compiler\\GHC\\Cmm\\Utils.hs:525:1-67|function toBlockMap"# } in
+ case ds_d5hoq of { CmmGraph _ [Occ=Dead] ds_d5hq4 ->
+ case ds_d5hq4 of {
+ __DEFAULT -> jump fail_d5hq7 ghc-prim-0.6.1:GHC.Prim.void#;
+ GMany ds_d5hq5 body_a5gYl ds_d5hq6 ->
+ case ds_d5hq5 of {
+ __DEFAULT -> jump fail_d5hq7 ghc-prim-0.6.1:GHC.Prim.void#;
+ NothingO co_a5heb ->
+ case ds_d5hq6 of {
+ __DEFAULT -> jump fail_d5hq7 ghc-prim-0.6.1:GHC.Prim.void#;
+ NothingO co_a5hec -> body_a5gYl
+ }
+ }
+ }
+ }
+
+-- RHS size: {terms: 8, types: 16, coercions: 0, joins: 0/0}
+ofBlockMap :: BlockId -> LabelMap CmmBlock -> CmmGraph
+[LclIdX,
+ Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
+ WorkFree=True, Expandable=True, Guidance=IF_ARGS [0 0] 50 30}]
+ofBlockMap
+ = \ (entry_a5gYm :: BlockId)
+ (bodyMap_a5gYn :: LabelMap CmmBlock) ->
+ GHC.Cmm.CmmGraph
+ @ CmmNode
+ entry_a5gYm
+ (GHC.Cmm.Dataflow.Graph.$WGMany
+ @ 'Closed
+ @ Block
+ @ CmmNode
+ @ 'Closed
+ (GHC.Cmm.Dataflow.Block.$WNothingO @ (Block CmmNode O C))
+ bodyMap_a5gYn
+ (GHC.Cmm.Dataflow.Block.$WNothingO @ (Block CmmNode C O)))
+
+-- RHS size: {terms: 18, types: 38, coercions: 17, joins: 0/0}
+blockTicks :: Block CmmNode C C -> [CmmTickish]
+[LclIdX,
+ Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
+ WorkFree=True, Expandable=True, Guidance=IF_ARGS [0] 120 0}]
+blockTicks
+ = \ (b_a5gYU :: Block CmmNode C C) ->
+ $ @ 'ghc-prim-0.6.1:GHC.Types.LiftedRep
+ @ [CmmTickish]
+ @ [CmmTickish]
+ (reverse @ CmmTickish)
+ ((foldBlockNodesF
+ @ CmmNode
+ @ [CmmTickish]
+ (\ (@ (e_a5hdd :: Extensibility))
+ (@ (x_a5hde :: Extensibility))
+ (ds_d5hnw :: CmmNode e_a5hdd x_a5hde)
+ (ts_a5gYZ :: [CmmTickish]) ->
+ case ds_d5hnw of {
+ __DEFAULT -> ts_a5gYZ;
+ CmmTick co_a5hcX co_a5hcY t_a5gYY ->
+ ghc-prim-0.6.1:GHC.Types.: @ CmmTickish t_a5gYY ts_a5gYZ
+ })
+ @ C
+ @ C
+ b_a5gYU
+ ((ghc-prim-0.6.1:GHC.Types.[] @ CmmTickish)
+ `cast` (Sub (Sym (GHC.Cmm.Dataflow.Block.D:R:IndexedCOkCloseda_b[0]
+ <*>_N <[CmmTickish]>_N <[CmmTickish]>_N))
+ :: [CmmTickish] ~R# IndexedCO C [CmmTickish] [CmmTickish])))
+ `cast` (Sub (GHC.Cmm.Dataflow.Block.D:R:IndexedCOkCloseda_b[0]
+ <*>_N <[CmmTickish]>_N <[CmmTickish]>_N)
+ :: IndexedCO C [CmmTickish] [CmmTickish] ~R# [CmmTickish]))
+
+-- RHS size: {terms: 2, types: 0, coercions: 0, joins: 0/0}
+baseExpr :: CmmExpr
+[LclIdX,
+ Unf=Unf{Src=<vanilla>, TopLvl=True, Value=False, ConLike=False,
+ WorkFree=False, Expandable=False, Guidance=IF_ARGS [] 20 0}]
+baseExpr = GHC.Cmm.Expr.$WCmmReg baseReg
+
+-- RHS size: {terms: 2, types: 0, coercions: 0, joins: 0/0}
+spExpr :: CmmExpr
+[LclIdX,
+ Unf=Unf{Src=<vanilla>, TopLvl=True, Value=False, ConLike=False,
+ WorkFree=False, Expandable=False, Guidance=IF_ARGS [] 20 0}]
+spExpr = GHC.Cmm.Expr.$WCmmReg spReg
+
+-- RHS size: {terms: 2, types: 0, coercions: 0, joins: 0/0}
+spLimExpr :: CmmExpr
+[LclIdX,
+ Unf=Unf{Src=<vanilla>, TopLvl=True, Value=False, ConLike=False,
+ WorkFree=False, Expandable=False, Guidance=IF_ARGS [] 20 0}]
+spLimExpr = GHC.Cmm.Expr.$WCmmReg spLimReg
+
+-- RHS size: {terms: 2, types: 0, coercions: 0, joins: 0/0}
+hpExpr :: CmmExpr
+[LclIdX,
+ Unf=Unf{Src=<vanilla>, TopLvl=True, Value=False, ConLike=False,
+ WorkFree=False, Expandable=False, Guidance=IF_ARGS [] 20 0}]
+hpExpr = GHC.Cmm.Expr.$WCmmReg hpReg
+
+-- RHS size: {terms: 2, types: 0, coercions: 0, joins: 0/0}
+hpLimExpr :: CmmExpr
+[LclIdX,
+ Unf=Unf{Src=<vanilla>, TopLvl=True, Value=False, ConLike=False,
+ WorkFree=False, Expandable=False, Guidance=IF_ARGS [] 20 0}]
+hpLimExpr = GHC.Cmm.Expr.$WCmmReg hpLimReg
+
+-- RHS size: {terms: 2, types: 0, coercions: 0, joins: 0/0}
+currentTSOExpr :: CmmExpr
+[LclIdX,
+ Unf=Unf{Src=<vanilla>, TopLvl=True, Value=False, ConLike=False,
+ WorkFree=False, Expandable=False, Guidance=IF_ARGS [] 20 0}]
+currentTSOExpr = GHC.Cmm.Expr.$WCmmReg currentTSOReg
+
+-- RHS size: {terms: 2, types: 0, coercions: 0, joins: 0/0}
+currentNurseryExpr :: CmmExpr
+[LclIdX,
+ Unf=Unf{Src=<vanilla>, TopLvl=True, Value=False, ConLike=False,
+ WorkFree=False, Expandable=False, Guidance=IF_ARGS [] 20 0}]
+currentNurseryExpr = GHC.Cmm.Expr.$WCmmReg currentNurseryReg
+
+-- RHS size: {terms: 2, types: 0, coercions: 0, joins: 0/0}
+cccsExpr :: CmmExpr
+[LclIdX,
+ Unf=Unf{Src=<vanilla>, TopLvl=True, Value=False, ConLike=False,
+ WorkFree=False, Expandable=False, Guidance=IF_ARGS [] 20 0}]
+cccsExpr = GHC.Cmm.Expr.$WCmmReg cccsReg
+
+-- RHS size: {terms: 5, types: 0, coercions: 0, joins: 0/0}
+GHC.Cmm.Utils.$trModule :: ghc-prim-0.6.1:GHC.Types.Module
+[LclIdX,
+ Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
+ WorkFree=True, Expandable=True, Guidance=IF_ARGS [] 100 30}]
+GHC.Cmm.Utils.$trModule
+ = ghc-prim-0.6.1:GHC.Types.Module
+ (ghc-prim-0.6.1:GHC.Types.TrNameS "ghc"#)
+ (ghc-prim-0.6.1:GHC.Types.TrNameS "GHC.Cmm.Utils"#)
+
+-- RHS size: {terms: 34, types: 10, coercions: 0, joins: 0/2}
+packHalfWordsCLit
+ :: Platform -> StgHalfWord -> StgHalfWord -> CmmLit
+[LclIdX,
+ Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
+ WorkFree=True, Expandable=True, Guidance=IF_ARGS [0 0 0] 360 0}]
+packHalfWordsCLit
+ = \ (platform_a5gVq :: Platform)
+ (lower_half_word_a5gVr :: StgHalfWord)
+ (upper_half_word_a5gVs :: StgHalfWord) ->
+ let {
+ u_a5gVu :: Integer
+ [LclId,
+ Unf=Unf{Src=<vanilla>, TopLvl=False, Value=False, ConLike=False,
+ WorkFree=False, Expandable=False, Guidance=IF_ARGS [] 20 0}]
+ u_a5gVu = fromStgHalfWord upper_half_word_a5gVs } in
+ let {
+ l_a5gVt :: Integer
+ [LclId,
+ Unf=Unf{Src=<vanilla>, TopLvl=False, Value=False, ConLike=False,
+ WorkFree=False, Expandable=False, Guidance=IF_ARGS [] 20 0}]
+ l_a5gVt = fromStgHalfWord lower_half_word_a5gVr } in
+ case platformByteOrder platform_a5gVq of {
+ BigEndian ->
+ mkWordCLit
+ platform_a5gVq
+ (.|.
+ @ Integer
+ Data.Bits.$fBitsInteger
+ (shiftL
+ @ Integer
+ Data.Bits.$fBitsInteger
+ l_a5gVt
+ (halfWordSizeInBits platform_a5gVq))
+ u_a5gVu);
+ LittleEndian ->
+ mkWordCLit
+ platform_a5gVq
+ (.|.
+ @ Integer
+ Data.Bits.$fBitsInteger
+ l_a5gVt
+ (shiftL
+ @ Integer
+ Data.Bits.$fBitsInteger
+ u_a5gVu
+ (halfWordSizeInBits platform_a5gVq)))
+ }
+
+-- RHS size: {terms: 20, types: 3, coercions: 11, joins: 0/0}
+$dIP_a5hjZ :: GHC.Stack.Types.HasCallStack
+[LclId,
+ Unf=Unf{Src=<vanilla>, TopLvl=True, Value=False, ConLike=False,
+ WorkFree=False, Expandable=False, Guidance=IF_ARGS [] 390 0}]
+$dIP_a5hjZ
+ = (GHC.Stack.Types.pushCallStack
+ (ghc-prim-0.6.1:GHC.CString.unpackCString# "pprPanic"#,
+ GHC.Stack.Types.SrcLoc
+ (ghc-prim-0.6.1:GHC.CString.unpackCString# "ghc"#)
+ (ghc-prim-0.6.1:GHC.CString.unpackCString# "GHC.Cmm.Utils"#)
+ (ghc-prim-0.6.1:GHC.CString.unpackCString#
+ "E:\\ghc_inferTags\\compiler\\GHC\\Cmm\\Utils.hs"#)
+ (ghc-prim-0.6.1:GHC.Types.I# 284#)
+ (ghc-prim-0.6.1:GHC.Types.I# 43#)
+ (ghc-prim-0.6.1:GHC.Types.I# 284#)
+ (ghc-prim-0.6.1:GHC.Types.I# 81#))
+ ((GHC.Stack.Types.emptyCallStack
+ `cast` (Sym (ghc-prim-0.6.1:GHC.Classes.N:IP[0]
+ <"callStack">_N <GHC.Stack.Types.CallStack>_N)
+ :: GHC.Stack.Types.CallStack
+ ~R# (?callStack::GHC.Stack.Types.CallStack)))
+ `cast` (ghc-prim-0.6.1:GHC.Classes.N:IP[0]
+ <"callStack">_N <GHC.Stack.Types.CallStack>_N
+ :: (?callStack::GHC.Stack.Types.CallStack)
+ ~R# GHC.Stack.Types.CallStack)))
+ `cast` (Sym (ghc-prim-0.6.1:GHC.Classes.N:IP[0]
+ <"callStack">_N <GHC.Stack.Types.CallStack>_N)
+ :: GHC.Stack.Types.CallStack
+ ~R# (?callStack::GHC.Stack.Types.CallStack))
+
+-- RHS size: {terms: 34, types: 18, coercions: 0, joins: 1/1}
+cmmNegate :: Platform -> CmmExpr -> CmmExpr
+[LclIdX,
+ Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
+ WorkFree=True, Expandable=True, Guidance=IF_ARGS [0 34] 218 20}]
+cmmNegate
+ = \ (platform_a5gXt :: Platform) (ds_d5hBT :: CmmExpr) ->
+ join {
+ fail_d5hCJ :: ghc-prim-0.6.1:GHC.Prim.Void# -> CmmExpr
+ [LclId[JoinId(1)],
+ Str=<L,U>,
+ Unf=Unf{Src=<vanilla>, TopLvl=False, Value=True, ConLike=True,
+ WorkFree=True, Expandable=True, Guidance=IF_ARGS [0] 100 30}]
+ fail_d5hCJ _ [Occ=Dead, OS=OneShot]
+ = GHC.Cmm.Expr.CmmMachOp
+ (GHC.Cmm.MachOp.MO_S_Neg (cmmExprWidth platform_a5gXt ds_d5hBT))
+ (GHC.Base.build
+ @ CmmExpr
+ (\ (@ a_d5hBZ)
+ (c_d5hC0 :: CmmExpr -> a_d5hBZ -> a_d5hBZ)
+ (n_d5hC1 :: a_d5hBZ) ->
+ c_d5hC0 ds_d5hBT n_d5hC1)) } in
+ case ds_d5hBT of {
+ __DEFAULT -> jump fail_d5hCJ ghc-prim-0.6.1:GHC.Prim.void#;
+ CmmLit ds_d5hCI ->
+ case ds_d5hCI of {
+ __DEFAULT -> jump fail_d5hCJ ghc-prim-0.6.1:GHC.Prim.void#;
+ CmmInt n_a5gXu rep_a5gXv ->
+ GHC.Cmm.Expr.CmmLit
+ (GHC.Cmm.Expr.$WCmmInt
+ (negate @ Integer GHC.Num.$fNumInteger n_a5gXu) rep_a5gXv)
+ }
+ }
+
+-- RHS size: {terms: 28, types: 13, coercions: 0, joins: 0/2}
+cmmToWord :: Platform -> CmmExpr -> CmmExpr
+[LclIdX,
+ Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
+ WorkFree=True, Expandable=True, Guidance=IF_ARGS [0 0] 200 30}]
+cmmToWord
+ = \ (platform_a5gXx :: Platform) (e_a5gXy :: CmmExpr) ->
+ let {
+ word_a5gXA :: Width
+ [LclId,
+ Unf=Unf{Src=<vanilla>, TopLvl=False, Value=False, ConLike=False,
+ WorkFree=False, Expandable=False, Guidance=IF_ARGS [] 20 0}]
+ word_a5gXA = wordWidth platform_a5gXx } in
+ let {
+ w_a5gXz :: Width
+ [LclId,
+ Unf=Unf{Src=<vanilla>, TopLvl=False, Value=False, ConLike=False,
+ WorkFree=False, Expandable=False, Guidance=IF_ARGS [] 30 0}]
+ w_a5gXz = cmmExprWidth platform_a5gXx e_a5gXy } in
+ case == @ Width GHC.Cmm.Type.$fEqWidth w_a5gXz word_a5gXA of {
+ False ->
+ GHC.Cmm.Expr.CmmMachOp
+ (GHC.Cmm.MachOp.MO_UU_Conv w_a5gXz word_a5gXA)
+ (GHC.Base.build
+ @ CmmExpr
+ (\ (@ a_d5hBI)
+ (c_d5hBJ :: CmmExpr -> a_d5hBI -> a_d5hBI)
+ (n_d5hBK :: a_d5hBI) ->
+ c_d5hBJ e_a5gXy n_d5hBK));
+ True -> e_a5gXy
+ }
+
+-- RHS size: {terms: 47, types: 19, coercions: 0, joins: 1/1}
+regsOverlap :: Platform -> CmmReg -> CmmReg -> Bool
+[LclIdX,
+ Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
+ WorkFree=True, Expandable=True, Guidance=IF_ARGS [0 34 34] 260 10}]
+regsOverlap
+ = \ (platform_a5gXV :: Platform)
+ (ds_d5hrI :: CmmReg)
+ (ds_d5hrJ :: CmmReg) ->
+ join {
+ fail_d5ht8 :: ghc-prim-0.6.1:GHC.Prim.Void# -> Bool
+ [LclId[JoinId(1)],
+ Str=<L,U>,
+ Unf=Unf{Src=<vanilla>, TopLvl=False, Value=True, ConLike=True,
+ WorkFree=True, Expandable=True, Guidance=IF_ARGS [0] 40 0}]
+ fail_d5ht8 _ [Occ=Dead, OS=OneShot]
+ = == @ CmmReg GHC.Cmm.Expr.$fEqCmmReg ds_d5hrI ds_d5hrJ } in
+ case ds_d5hrI of {
+ __DEFAULT -> jump fail_d5ht8 ghc-prim-0.6.1:GHC.Prim.void#;
+ CmmGlobal g_a5gXW ->
+ case ds_d5hrJ of {
+ __DEFAULT -> jump fail_d5ht8 ghc-prim-0.6.1:GHC.Prim.void#;
+ CmmGlobal g'_a5gXX ->
+ case globalRegMaybe platform_a5gXV g_a5gXW of {
+ __DEFAULT -> jump fail_d5ht8 ghc-prim-0.6.1:GHC.Prim.void#;
+ Just real_a5gXY ->
+ case globalRegMaybe platform_a5gXV g'_a5gXX of {
+ __DEFAULT -> jump fail_d5ht8 ghc-prim-0.6.1:GHC.Prim.void#;
+ Just real'_a5gXZ ->
+ case ==
+ @ GHC.Platform.Reg.RealReg
+ GHC.Platform.Reg.$fEqRealReg
+ real_a5gXY
+ real'_a5gXZ
+ of {
+ False -> jump fail_d5ht8 ghc-prim-0.6.1:GHC.Prim.void#;
+ True -> ghc-prim-0.6.1:GHC.Types.True
+ }
+ }
+ }
+ }
+ }
+
+-- RHS size: {terms: 12, types: 3, coercions: 0, joins: 0/0}
+tAG_MASK :: Platform -> Int
+[LclIdX,
+ Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
+ WorkFree=True, Expandable=True, Guidance=IF_ARGS [0] 140 0}]
+tAG_MASK
+ = \ (platform_a5gXJ :: Platform) ->
+ - @ Int
+ GHC.Num.$fNumInt
+ (shiftL
+ @ Int
+ Data.Bits.$fBitsInt
+ (ghc-prim-0.6.1:GHC.Types.I# 1#)
+ (pc_TAG_BITS (platformConstants platform_a5gXJ)))
+ (ghc-prim-0.6.1:GHC.Types.I# 1#)
+
+-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
+mAX_PTR_TAG :: Platform -> Int
+[LclIdX,
+ Unf=Unf{Src=<vanilla>, TopLvl=True, Value=False, ConLike=False,
+ WorkFree=True, Expandable=True,
+ Guidance=ALWAYS_IF(arity=0,unsat_ok=True,boring_ok=True)}]
+mAX_PTR_TAG = tAG_MASK
+
+-- RHS size: {terms: 9, types: 4, coercions: 0, joins: 0/0}
+cmmLabelOffW :: Platform -> CLabel -> WordOff -> CmmLit
+[LclIdX,
+ Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
+ WorkFree=True, Expandable=True, Guidance=IF_ARGS [0 0 0] 70 0}]
+cmmLabelOffW
+ = \ (platform_a5gWJ :: Platform)
+ (lbl_a5gWK :: CLabel)
+ (wd_off_a5gWL :: WordOff) ->
+ cmmLabelOffB
+ lbl_a5gWK
+ (wordsToBytes
+ @ WordOff GHC.Num.$fNumInt platform_a5gWJ wd_off_a5gWL)
+
+-- RHS size: {terms: 9, types: 4, coercions: 0, joins: 0/0}
+cmmRegOffW :: Platform -> CmmReg -> WordOff -> CmmExpr
+[LclIdX,
+ Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
+ WorkFree=True, Expandable=True, Guidance=IF_ARGS [0 0 0] 70 0}]
+cmmRegOffW
+ = \ (platform_a5gWD :: Platform)
+ (reg_a5gWE :: CmmReg)
+ (wd_off_a5gWF :: WordOff) ->
+ cmmRegOffB
+ reg_a5gWE
+ (wordsToBytes
+ @ WordOff GHC.Num.$fNumInt platform_a5gWD wd_off_a5gWF)
+
+Rec {
+-- RHS size: {terms: 34, types: 18, coercions: 0, joins: 0/1}
+mkLiveness [Occ=LoopBreaker] :: Platform -> [LocalReg] -> Liveness
+[LclIdX,
+ Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
+ WorkFree=True, Expandable=True, Guidance=IF_ARGS [0 30] 400 10}]
+mkLiveness
+ = \ (ds_d5hrw :: Platform) (ds_d5hrx :: [LocalReg]) ->
+ case ds_d5hrx of {
+ [] -> ghc-prim-0.6.1:GHC.Types.[] @ Bool;
+ : reg_a5gYd regs_a5gYe ->
+ let {
+ word_size_a5gYf :: Int
+ [LclId,
+ Unf=Unf{Src=<vanilla>, TopLvl=False, Value=False, ConLike=False,
+ WorkFree=False, Expandable=False, Guidance=IF_ARGS [] 20 0}]
+ word_size_a5gYf = platformWordSizeInBytes ds_d5hrw } in
+ ++
+ @ Bool
+ (replicate
+ @ Bool
+ (quot
+ @ Int
+ GHC.Real.$fIntegralInt
+ (- @ Int
+ GHC.Num.$fNumInt
+ (+ @ Int
+ GHC.Num.$fNumInt
+ (widthInBytes (typeWidth (localRegType reg_a5gYd)))
+ word_size_a5gYf)
+ (ghc-prim-0.6.1:GHC.Types.I# 1#))
+ word_size_a5gYf)
+ ($ @ 'ghc-prim-0.6.1:GHC.Types.LiftedRep
+ @ Bool
+ @ Bool
+ not
+ (isGcPtrType (localRegType reg_a5gYd))))
+ (mkLiveness ds_d5hrw regs_a5gYe)
+ }
+end Rec }
+
+-- RHS size: {terms: 42, types: 19, coercions: 0, joins: 0/0}
+cmmOffsetLit :: CmmLit -> Int -> CmmLit
+[LclIdX,
+ Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
+ WorkFree=True, Expandable=True, Guidance=IF_ARGS [320 0] 440 50}]
+cmmOffsetLit
+ = \ (ds_d5hDy :: CmmLit) (byte_off_a5gVW :: Int) ->
+ case ds_d5hDy of {
+ __DEFAULT ->
+ pprPanic
+ @ CmmLit
+ $dIP_a5hjZ
+ (ghc-prim-0.6.1:GHC.CString.unpackCString# "cmmOffsetLit"#)
+ (ppr @ Int GHC.Utils.Outputable.$fOutputableInt byte_off_a5gVW);
+ CmmInt m_a5gW5 rep_a5gW6 ->
+ GHC.Cmm.Expr.$WCmmInt
+ (+ @ Integer
+ GHC.Num.$fNumInteger
+ m_a5gW5
+ (fromIntegral
+ @ Int
+ @ Integer
+ GHC.Real.$fIntegralInt
+ GHC.Num.$fNumInteger
+ byte_off_a5gVW))
+ rep_a5gW6;
+ CmmLabel l_a5gVV -> cmmLabelOff l_a5gVV byte_off_a5gVW;
+ CmmLabelOff l_a5gVX m_a5gVY ->
+ cmmLabelOff
+ l_a5gVX (+ @ Int GHC.Num.$fNumInt m_a5gVY byte_off_a5gVW);
+ CmmLabelDiffOff l1_a5gW0 l2_a5gW1 m_a5gW2 w_a5gW3 ->
+ GHC.Cmm.Expr.CmmLabelDiffOff
+ l1_a5gW0
+ l2_a5gW1
+ (+ @ Int GHC.Num.$fNumInt m_a5gW2 byte_off_a5gVW)
+ w_a5gW3
+ }
+
+-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
+cmmOffsetLitB :: CmmLit -> ByteOff -> CmmLit
+[LclIdX,
+ Unf=Unf{Src=<vanilla>, TopLvl=True, Value=False, ConLike=False,
+ WorkFree=True, Expandable=True,
+ Guidance=ALWAYS_IF(arity=0,unsat_ok=True,boring_ok=True)}]
+cmmOffsetLitB = cmmOffsetLit
+
+-- RHS size: {terms: 9, types: 4, coercions: 0, joins: 0/0}
+cmmOffsetLitW :: Platform -> CmmLit -> WordOff -> CmmLit
+[LclIdX,
+ Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
+ WorkFree=True, Expandable=True, Guidance=IF_ARGS [0 0 0] 70 0}]
+cmmOffsetLitW
+ = \ (platform_a5gWG :: Platform)
+ (lit_a5gWH :: CmmLit)
+ (wd_off_a5gWI :: WordOff) ->
+ cmmOffsetLitB
+ lit_a5gWH
+ (wordsToBytes
+ @ WordOff GHC.Num.$fNumInt platform_a5gWG wd_off_a5gWI)
+
+-- RHS size: {terms: 119, types: 58, coercions: 0, joins: 1/2}
+cmmOffset :: Platform -> CmmExpr -> Int -> CmmExpr
+[LclIdX,
+ Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
+ WorkFree=True, Expandable=True, Guidance=NEVER}]
+cmmOffset
+ = \ (_platform_a5gVC :: Platform)
+ (e_a5gVD :: CmmExpr)
+ (ds_d5hEC :: Int) ->
+ case ds_d5hEC of { ghc-prim-0.6.1:GHC.Types.I# ds_d5hID ->
+ case ds_d5hID of {
+ __DEFAULT ->
+ join {
+ fail_d5hIx :: ghc-prim-0.6.1:GHC.Prim.Void# -> CmmExpr
+ [LclId[JoinId(1)],
+ Str=<L,U>,
+ Unf=Unf{Src=<vanilla>, TopLvl=False, Value=True, ConLike=True,
+ WorkFree=True, Expandable=True, Guidance=IF_ARGS [0] 210 30}]
+ fail_d5hIx _ [Occ=Dead, OS=OneShot]
+ = let {
+ width_a5gVR :: Width
+ [LclId,
+ Unf=Unf{Src=<vanilla>, TopLvl=False, Value=False, ConLike=False,
+ WorkFree=False, Expandable=False, Guidance=IF_ARGS [] 30 0}]
+ width_a5gVR = cmmExprWidth _platform_a5gVC e_a5gVD } in
+ GHC.Cmm.Expr.CmmMachOp
+ (GHC.Cmm.MachOp.MO_Add width_a5gVR)
+ (GHC.Base.build
+ @ CmmExpr
+ (\ (@ a_d5hFb)
+ (c_d5hFc :: CmmExpr -> a_d5hFb -> a_d5hFb)
+ (n_d5hFd :: a_d5hFb) ->
+ c_d5hFc
+ e_a5gVD
+ (c_d5hFc
+ (GHC.Cmm.Expr.CmmLit
+ (GHC.Cmm.Expr.$WCmmInt
+ (toInteger @ Int GHC.Real.$fIntegralInt ds_d5hEC) width_a5gVR))
+ n_d5hFd))) } in
+ case e_a5gVD of {
+ __DEFAULT -> jump fail_d5hIx ghc-prim-0.6.1:GHC.Prim.void#;
+ CmmLit lit_a5gVK ->
+ GHC.Cmm.Expr.CmmLit (cmmOffsetLit lit_a5gVK ds_d5hEC);
+ CmmReg reg_a5gVH -> cmmRegOff reg_a5gVH ds_d5hEC;
+ CmmMachOp ds_d5hIr ds_d5hIs ->
+ case ds_d5hIr of {
+ __DEFAULT -> jump fail_d5hIx ghc-prim-0.6.1:GHC.Prim.void#;
+ MO_Add rep_a5gVN ->
+ case ds_d5hIs of {
+ __DEFAULT -> jump fail_d5hIx ghc-prim-0.6.1:GHC.Prim.void#;
+ : expr_a5gVO ds_d5hIt ->
+ case ds_d5hIt of {
+ __DEFAULT -> jump fail_d5hIx ghc-prim-0.6.1:GHC.Prim.void#;
+ : ds_d5hIu ds_d5hIv ->
+ case ds_d5hIu of {
+ __DEFAULT -> jump fail_d5hIx ghc-prim-0.6.1:GHC.Prim.void#;
+ CmmLit ds_d5hIw ->
+ case ds_d5hIw of {
+ __DEFAULT -> jump fail_d5hIx ghc-prim-0.6.1:GHC.Prim.void#;
+ CmmInt byte_off1_a5gVP _ [Occ=Dead] ->
+ case ds_d5hIv of {
+ __DEFAULT -> jump fail_d5hIx ghc-prim-0.6.1:GHC.Prim.void#;
+ [] ->
+ GHC.Cmm.Expr.CmmMachOp
+ (GHC.Cmm.MachOp.MO_Add rep_a5gVN)
+ (GHC.Base.build
+ @ CmmExpr
+ (\ (@ a_d5hF8)
+ (c_d5hF9 :: CmmExpr -> a_d5hF8 -> a_d5hF8)
+ (n_d5hFa :: a_d5hF8) ->
+ c_d5hF9
+ expr_a5gVO
+ (c_d5hF9
+ (GHC.Cmm.Expr.CmmLit
+ (GHC.Cmm.Expr.$WCmmInt
+ (+ @ Integer
+ GHC.Num.$fNumInteger
+ byte_off1_a5gVP
+ (toInteger
+ @ Int
+ GHC.Real.$fIntegralInt
+ ds_d5hEC))
+ rep_a5gVN))
+ n_d5hFa)))
+ }
+ }
+ }
+ }
+ }
+ };
+ CmmStackSlot area_a5gVL off_a5gVM ->
+ GHC.Cmm.Expr.$WCmmStackSlot
+ area_a5gVL (- @ Int GHC.Num.$fNumInt off_a5gVM ds_d5hEC);
+ CmmRegOff reg_a5gVI m_a5gVJ ->
+ cmmRegOff reg_a5gVI (+ @ Int GHC.Num.$fNumInt m_a5gVJ ds_d5hEC)
+ };
+ 0# -> e_a5gVD
+ }
+ }
+
+-- RHS size: {terms: 12, types: 5, coercions: 0, joins: 0/0}
+cmmIndex :: Platform -> Width -> CmmExpr -> Int -> CmmExpr
+[LclIdX,
+ Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
+ WorkFree=True, Expandable=True, Guidance=IF_ARGS [0 0 0 0] 100 0}]
+cmmIndex
+ = \ (platform_a5gWc :: Platform)
+ (width_a5gWd :: Width)
+ (base_a5gWe :: CmmExpr)
+ (idx_a5gWf :: Int) ->
+ cmmOffset
+ platform_a5gWc
+ base_a5gWe
+ (* @ Int GHC.Num.$fNumInt idx_a5gWf (widthInBytes width_a5gWd))
+
+-- RHS size: {terms: 12, types: 4, coercions: 0, joins: 0/0}
+cmmLoadIndex :: Platform -> CmmType -> CmmExpr -> Int -> CmmExpr
+[LclIdX,
+ Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
+ WorkFree=True, Expandable=True, Guidance=IF_ARGS [0 0 0 0] 100 0}]
+cmmLoadIndex
+ = \ (platform_a5gWq :: Platform)
+ (ty_a5gWr :: CmmType)
+ (expr_a5gWs :: CmmExpr)
+ (ix_a5gWt :: Int) ->
+ GHC.Cmm.Expr.$WCmmLoad
+ (cmmIndex platform_a5gWq (typeWidth ty_a5gWr) expr_a5gWs ix_a5gWt)
+ ty_a5gWr
+
+-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
+cmmOffsetB :: Platform -> CmmExpr -> ByteOff -> CmmExpr
+[LclIdX,
+ Unf=Unf{Src=<vanilla>, TopLvl=True, Value=False, ConLike=False,
+ WorkFree=True, Expandable=True,
+ Guidance=ALWAYS_IF(arity=0,unsat_ok=True,boring_ok=True)}]
+cmmOffsetB = cmmOffset
+
+-- RHS size: {terms: 10, types: 4, coercions: 0, joins: 0/0}
+cmmOffsetW :: Platform -> CmmExpr -> WordOff -> CmmExpr
+[LclIdX,
+ Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
+ WorkFree=True, Expandable=True, Guidance=IF_ARGS [0 0 0] 80 0}]
+cmmOffsetW
+ = \ (platform_a5gWA :: Platform)
+ (e_a5gWB :: CmmExpr)
+ (n_a5gWC :: WordOff) ->
+ cmmOffsetB
+ platform_a5gWA
+ e_a5gWB
+ (wordsToBytes @ WordOff GHC.Num.$fNumInt platform_a5gWA n_a5gWC)
+
+-- RHS size: {terms: 10, types: 4, coercions: 0, joins: 0/0}
+cmmLoadIndexW :: Platform -> CmmExpr -> Int -> CmmType -> CmmExpr
+[LclIdX,
+ Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
+ WorkFree=True, Expandable=True, Guidance=IF_ARGS [0 0 0 0] 70 0}]
+cmmLoadIndexW
+ = \ (platform_a5gWM :: Platform)
+ (base_a5gWN :: CmmExpr)
+ (off_a5gWO :: Int)
+ (ty_a5gWP :: CmmType) ->
+ GHC.Cmm.Expr.$WCmmLoad
+ (cmmOffsetW platform_a5gWM base_a5gWN off_a5gWO) ty_a5gWP
+
+-- RHS size: {terms: 37, types: 19, coercions: 0, joins: 1/1}
+cmmOffsetExpr :: Platform -> CmmExpr -> CmmExpr -> CmmExpr
+[LclIdX,
+ Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
+ WorkFree=True, Expandable=True, Guidance=IF_ARGS [0 0 34] 248 0}]
+cmmOffsetExpr
+ = \ (platform_a5gVw :: Platform)
+ (e_a5gVx :: CmmExpr)
+ (ds_d5hIG :: CmmExpr) ->
+ join {
+ fail_d5hJz :: ghc-prim-0.6.1:GHC.Prim.Void# -> CmmExpr
+ [LclId[JoinId(1)],
+ Str=<L,U>,
+ Unf=Unf{Src=<vanilla>, TopLvl=False, Value=True, ConLike=True,
+ WorkFree=True, Expandable=True, Guidance=IF_ARGS [0] 130 30}]
+ fail_d5hJz _ [Occ=Dead, OS=OneShot]
+ = GHC.Cmm.Expr.CmmMachOp
+ (GHC.Cmm.MachOp.MO_Add (cmmExprWidth platform_a5gVw e_a5gVx))
+ (GHC.Base.build
+ @ CmmExpr
+ (\ (@ a_d5hIN)
+ (c_d5hIO :: CmmExpr -> a_d5hIN -> a_d5hIN)
+ (n_d5hIP :: a_d5hIN) ->
+ c_d5hIO e_a5gVx (c_d5hIO ds_d5hIG n_d5hIP))) } in
+ case ds_d5hIG of {
+ __DEFAULT -> jump fail_d5hJz ghc-prim-0.6.1:GHC.Prim.void#;
+ CmmLit ds_d5hJx ->
+ case ds_d5hJx of {
+ __DEFAULT -> jump fail_d5hJz ghc-prim-0.6.1:GHC.Prim.void#;
+ CmmInt n_a5gVy _ [Occ=Dead] ->
+ cmmOffset
+ platform_a5gVw e_a5gVx (fromInteger @ Int GHC.Num.$fNumInt n_a5gVy)
+ }
+ }
+
+-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
+cmmOffsetExprB :: Platform -> CmmExpr -> CmmExpr -> CmmExpr
+[LclIdX,
+ Unf=Unf{Src=<vanilla>, TopLvl=True, Value=False, ConLike=False,
+ WorkFree=True, Expandable=True,
+ Guidance=ALWAYS_IF(arity=0,unsat_ok=True,boring_ok=True)}]
+cmmOffsetExprB = cmmOffsetExpr
+
+-- RHS size: {terms: 8, types: 3, coercions: 0, joins: 0/0}
+mkIntCLit :: Platform -> Int -> CmmLit
+[LclIdX,
+ Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
+ WorkFree=True, Expandable=True, Guidance=IF_ARGS [0 0] 80 0}]
+mkIntCLit
+ = \ (platform_a5gV4 :: Platform) (i_a5gV5 :: Int) ->
+ GHC.Cmm.Expr.$WCmmInt
+ (toInteger @ Int GHC.Real.$fIntegralInt i_a5gV5)
+ (wordWidth platform_a5gV4)
+
+-- RHS size: {terms: 7, types: 5, coercions: 0, joins: 0/0}
+mkIntExpr :: Platform -> Int -> CmmExpr
+[LclIdX,
+ Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
+ WorkFree=True, Expandable=True, Guidance=IF_ARGS [0 0] 60 0}]
+mkIntExpr
+ = \ (platform_a5gV6 :: Platform) (i_a5gV7 :: Int) ->
+ $!
+ @ 'ghc-prim-0.6.1:GHC.Types.LiftedRep
+ @ CmmLit
+ @ CmmExpr
+ GHC.Cmm.Expr.CmmLit
+ (mkIntCLit platform_a5gV6 i_a5gV7)
+
+-- RHS size: {terms: 47, types: 21, coercions: 0, joins: 1/2}
+cmmIndexExpr :: Platform -> Width -> CmmExpr -> CmmExpr -> CmmExpr
+[LclIdX,
+ Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
+ WorkFree=True, Expandable=True, Guidance=IF_ARGS [0 0 0 34] 358 0}]
+cmmIndexExpr
+ = \ (platform_a5gWg :: Platform)
+ (width_a5gWh :: Width)
+ (base_a5gWi :: CmmExpr)
+ (ds_d5hKJ :: CmmExpr) ->
+ join {
+ fail_d5hLC :: ghc-prim-0.6.1:GHC.Prim.Void# -> CmmExpr
+ [LclId[JoinId(1)],
+ Str=<L,U>,
+ Unf=Unf{Src=<vanilla>, TopLvl=False, Value=True, ConLike=True,
+ WorkFree=True, Expandable=True, Guidance=IF_ARGS [0] 230 0}]
+ fail_d5hLC _ [Occ=Dead, OS=OneShot]
+ = let {
+ idx_w_a5gWo :: Width
+ [LclId,
+ Unf=Unf{Src=<vanilla>, TopLvl=False, Value=False, ConLike=False,
+ WorkFree=False, Expandable=False, Guidance=IF_ARGS [] 30 0}]
+ idx_w_a5gWo = cmmExprWidth platform_a5gWg ds_d5hKJ } in
+ cmmOffsetExpr
+ platform_a5gWg
+ base_a5gWi
+ (GHC.Cmm.Expr.CmmMachOp
+ (GHC.Cmm.MachOp.MO_Shl idx_w_a5gWo)
+ (GHC.Base.build
+ @ CmmExpr
+ (\ (@ a_d5hLz)
+ (c_d5hLA :: CmmExpr -> a_d5hLz -> a_d5hLz)
+ (n_d5hLB :: a_d5hLz) ->
+ c_d5hLA
+ ds_d5hKJ
+ (c_d5hLA
+ (mkIntExpr platform_a5gWg (widthInLog width_a5gWh))
+ n_d5hLB)))) } in
+ case ds_d5hKJ of {
+ __DEFAULT -> jump fail_d5hLC ghc-prim-0.6.1:GHC.Prim.void#;
+ CmmLit ds_d5hLx ->
+ case ds_d5hLx of {
+ __DEFAULT -> jump fail_d5hLC ghc-prim-0.6.1:GHC.Prim.void#;
+ CmmInt n_a5gWj _ [Occ=Dead] ->
+ cmmIndex
+ platform_a5gWg
+ width_a5gWh
+ base_a5gWi
+ (fromInteger @ Int GHC.Num.$fNumInt n_a5gWj)
+ }
+ }
+
+-- RHS size: {terms: 29, types: 12, coercions: 0, joins: 1/1}
+cmmOffsetExprW :: Platform -> CmmExpr -> CmmExpr -> CmmExpr
+[LclIdX,
+ Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
+ WorkFree=True, Expandable=True, Guidance=IF_ARGS [0 0 34] 188 0}]
+cmmOffsetExprW
+ = \ (platform_a5gWu :: Platform)
+ (e_a5gWv :: CmmExpr)
+ (ds_d5hLE :: CmmExpr) ->
+ join {
+ fail_d5hMu :: ghc-prim-0.6.1:GHC.Prim.Void# -> CmmExpr
+ [LclId[JoinId(1)],
+ Str=<L,U>,
+ Unf=Unf{Src=<vanilla>, TopLvl=False, Value=True, ConLike=True,
+ WorkFree=True, Expandable=True, Guidance=IF_ARGS [0] 70 0}]
+ fail_d5hMu _ [Occ=Dead, OS=OneShot]
+ = cmmIndexExpr
+ platform_a5gWu (wordWidth platform_a5gWu) e_a5gWv ds_d5hLE } in
+ case ds_d5hLE of {
+ __DEFAULT -> jump fail_d5hMu ghc-prim-0.6.1:GHC.Prim.void#;
+ CmmLit ds_d5hMs ->
+ case ds_d5hMs of {
+ __DEFAULT -> jump fail_d5hMu ghc-prim-0.6.1:GHC.Prim.void#;
+ CmmInt n_a5gWw _ [Occ=Dead] ->
+ cmmOffsetW
+ platform_a5gWu
+ e_a5gWv
+ (fromInteger @ WordOff GHC.Num.$fNumInt n_a5gWw)
+ }
+ }
+
+-- RHS size: {terms: 5, types: 1, coercions: 0, joins: 0/0}
+cmmTagMask :: Platform -> CmmExpr
+[LclIdX,
+ Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
+ WorkFree=True, Expandable=True, Guidance=IF_ARGS [0] 50 0}]
+cmmTagMask
+ = \ (platform_a5gXK :: Platform) ->
+ mkIntExpr platform_a5gXK (tAG_MASK platform_a5gXK)
+
+-- RHS size: {terms: 11, types: 2, coercions: 0, joins: 0/0}
+cmmIsTagged :: Platform -> CmmExpr -> CmmExpr
+[LclIdX,
+ Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
+ WorkFree=True, Expandable=True, Guidance=IF_ARGS [0 0] 120 0}]
+cmmIsTagged
+ = \ (platform_a5gXP :: Platform) (e_a5gXQ :: CmmExpr) ->
+ cmmNeWord
+ platform_a5gXP
+ (cmmAndWord platform_a5gXP e_a5gXQ (cmmTagMask platform_a5gXP))
+ (zeroExpr platform_a5gXP)
+
+-- RHS size: {terms: 11, types: 2, coercions: 0, joins: 0/0}
+cmmIsNotTagged :: Platform -> CmmExpr -> CmmExpr
+[LclIdX,
+ Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
+ WorkFree=True, Expandable=True, Guidance=IF_ARGS [0 0] 120 0}]
+cmmIsNotTagged
+ = \ (platform_a5gXR :: Platform) (e_a5gXS :: CmmExpr) ->
+ cmmEqWord
+ platform_a5gXR
+ (cmmAndWord platform_a5gXR e_a5gXS (cmmTagMask platform_a5gXR))
+ (zeroExpr platform_a5gXR)
+
+-- RHS size: {terms: 7, types: 2, coercions: 0, joins: 0/0}
+cmmConstrTag1 :: Platform -> CmmExpr -> CmmExpr
+[LclIdX,
+ Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
+ WorkFree=True, Expandable=True, Guidance=IF_ARGS [0 0] 60 0}]
+cmmConstrTag1
+ = \ (platform_a5gXT :: Platform) (e_a5gXU :: CmmExpr) ->
+ cmmAndWord platform_a5gXT e_a5gXU (cmmTagMask platform_a5gXT)
+
+-- RHS size: {terms: 7, types: 2, coercions: 0, joins: 0/0}
+cmmPointerMask :: Platform -> CmmExpr
+[LclIdX,
+ Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
+ WorkFree=True, Expandable=True, Guidance=IF_ARGS [0] 80 0}]
+cmmPointerMask
+ = \ (platform_a5gXL :: Platform) ->
+ mkIntExpr
+ platform_a5gXL
+ (complement @ Int Data.Bits.$fBitsInt (tAG_MASK platform_a5gXL))
+
+-- RHS size: {terms: 22, types: 9, coercions: 0, joins: 1/1}
+cmmUntag :: Platform -> CmmExpr -> CmmExpr
+[LclIdX,
+ Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
+ WorkFree=True, Expandable=True, Guidance=IF_ARGS [0 34] 108 0}]
+cmmUntag
+ = \ (ds_d5hMw :: Platform) (e_a5gXM :: CmmExpr) ->
+ join {
+ fail_d5hNt :: ghc-prim-0.6.1:GHC.Prim.Void# -> CmmExpr
+ [LclId[JoinId(1)],
+ Str=<L,U>,
+ Unf=Unf{Src=<vanilla>, TopLvl=False, Value=True, ConLike=True,
+ WorkFree=True, Expandable=True, Guidance=IF_ARGS [0] 60 0}]
+ fail_d5hNt _ [Occ=Dead, OS=OneShot]
+ = cmmAndWord ds_d5hMw e_a5gXM (cmmPointerMask ds_d5hMw) } in
+ case e_a5gXM of wild_00 {
+ __DEFAULT -> jump fail_d5hNt ghc-prim-0.6.1:GHC.Prim.void#;
+ CmmLit ds_d5hNr ->
+ case ds_d5hNr of {
+ __DEFAULT -> jump fail_d5hNt ghc-prim-0.6.1:GHC.Prim.void#;
+ CmmLabel _ [Occ=Dead] -> wild_00
+ }
+ }
+
+-- RHS size: {terms: 4, types: 3, coercions: 0, joins: 0/0}
+typeForeignHint :: UnaryType -> ForeignHint
+[LclIdX,
+ Unf=Unf{Src=<vanilla>, TopLvl=True, Value=False, ConLike=False,
+ WorkFree=False, Expandable=False, Guidance=IF_ARGS [] 50 0}]
+typeForeignHint
+ = . @ PrimRep
+ @ ForeignHint
+ @ UnaryType
+ primRepForeignHint
+ (typePrimRep1 ghc-prim-0.6.1:GHC.Classes.C:(%%))
+
+-- RHS size: {terms: 7, types: 2, coercions: 0, joins: 0/0}
+typeCmmType :: Platform -> UnaryType -> CmmType
+[LclIdX,
+ Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
+ WorkFree=True, Expandable=True, Guidance=IF_ARGS [0 0] 60 0}]
+typeCmmType
+ = \ (platform_a5gV2 :: Platform) (ty_a5gV3 :: UnaryType) ->
+ primRepCmmType
+ platform_a5gV2
+ (typePrimRep1 ghc-prim-0.6.1:GHC.Classes.C:(%%) ty_a5gV3)
+
+-- RHS size: {terms: 2, types: 1, coercions: 0, joins: 0/0}
+$dNonLocal_a5hdF :: NonLocal (Block CmmNode)
+[LclId,
+ Unf=Unf{Src=<vanilla>, TopLvl=True, Value=False, ConLike=False,
+ WorkFree=False, Expandable=True, Guidance=IF_ARGS [] 20 0}]
+$dNonLocal_a5hdF
+ = GHC.Cmm.Dataflow.Graph.$fNonLocalBlock
+ @ CmmNode GHC.Cmm.Node.$fNonLocalCmmNode
+
+-- RHS size: {terms: 7, types: 4, coercions: 0, joins: 0/0}
+revPostorder :: CmmGraph -> [CmmBlock]
+[LclIdX,
+ Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
+ WorkFree=True, Expandable=True, Guidance=IF_ARGS [0] 80 0}]
+revPostorder
+ = \ (g_a5gYT :: CmmGraph) ->
+ revPostorderFrom
+ @ (Block CmmNode)
+ $dNonLocal_a5hdF
+ (toBlockMap g_a5gYT)
+ (g_entry @ CmmNode g_a5gYT)
+
+-- RHS size: {terms: 14, types: 30, coercions: 0, joins: 0/0}
+ofBlockList :: BlockId -> [CmmBlock] -> CmmGraph
+[LclIdX,
+ Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
+ WorkFree=True, Expandable=True, Guidance=IF_ARGS [0 0] 130 30}]
+ofBlockList
+ = \ (entry_a5gYI :: BlockId) (blocks_a5gYJ :: [CmmBlock]) ->
+ GHC.Cmm.CmmGraph
+ @ CmmNode
+ entry_a5gYI
+ (GHC.Cmm.Dataflow.Graph.$WGMany
+ @ 'Closed
+ @ Block
+ @ CmmNode
+ @ 'Closed
+ (GHC.Cmm.Dataflow.Block.$WNothingO @ (Block CmmNode O C))
+ (foldr
+ @ []
+ Data.Foldable.$fFoldable[]
+ @ (Block CmmNode C C)
+ @ (LabelMap (Block CmmNode C C))
+ (addBlock
+ @ (Block CmmNode)
+ $dNonLocal_a5hdF
+ ghc-prim-0.6.1:GHC.Classes.C:(%%))
+ (emptyBody @ Block @ CmmNode)
+ blocks_a5gYJ)
+ (GHC.Cmm.Dataflow.Block.$WNothingO @ (Block CmmNode C O)))
+
+-- RHS size: {terms: 29, types: 19, coercions: 0, joins: 0/0}
+mkRODataLits
+ :: forall (raw :: Bool) info stmt.
+ CLabel -> [CmmLit] -> GenCmmDecl (GenCmmStatics raw) info stmt
+[LclIdX,
+ Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
+ WorkFree=True, Expandable=True, Guidance=IF_ARGS [0 0] 160 0}]
+mkRODataLits
+ = \ (@ (raw_a5hld :: Bool))
+ (@ info_a5hle)
+ (@ stmt_a5hlf)
+ (lbl_a5gVk :: CLabel)
+ (lits_a5gVl :: [CmmLit]) ->
+ mkDataLits
+ @ raw_a5hld
+ @ info_a5hle
+ @ stmt_a5hlf
+ (case any
+ @ []
+ @ CmmLit
+ Data.Foldable.$fFoldable[]
+ (\ (ds_d5hJJ :: CmmLit) ->
+ case ds_d5hJJ of {
+ __DEFAULT -> ghc-prim-0.6.1:GHC.Types.False;
+ CmmLabel _ [Occ=Dead] -> ghc-prim-0.6.1:GHC.Types.True;
+ CmmLabelOff _ [Occ=Dead] _ [Occ=Dead] ->
+ ghc-prim-0.6.1:GHC.Types.True
+ })
+ lits_a5gVl
+ of {
+ False -> GHC.Cmm.Section GHC.Cmm.ReadOnlyData lbl_a5gVk;
+ True -> GHC.Cmm.Section GHC.Cmm.RelocatableReadOnlyData lbl_a5gVk
+ })
+ lbl_a5gVk
+ lits_a5gVl
+
+-- RHS size: {terms: 33, types: 21, coercions: 0, joins: 0/1}
+regUsedIn :: Platform -> CmmReg -> CmmExpr -> Bool
+[LclIdX,
+ Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
+ WorkFree=True, Expandable=True, Guidance=IF_ARGS [0] 280 0}]
+regUsedIn
+ = \ (platform_a5gY2 :: Platform) ->
+ letrec {
+ regUsedIn__a5gY3 [Occ=LoopBreaker] :: CmmReg -> CmmExpr -> Bool
+ [LclId,
+ Unf=Unf{Src=<vanilla>, TopLvl=False, Value=True, ConLike=True,
+ WorkFree=True, Expandable=True, Guidance=IF_ARGS [0 180] 250 20}]
+ regUsedIn__a5gY3
+ = \ (ds_d5hta :: CmmReg) (ds_d5htb :: CmmExpr) ->
+ case ds_d5htb of {
+ CmmLit _ [Occ=Dead] -> ghc-prim-0.6.1:GHC.Types.False;
+ CmmLoad e_a5gY5 _ [Occ=Dead] -> regUsedIn__a5gY3 ds_d5hta e_a5gY5;
+ CmmReg reg'_a5gY7 ->
+ regsOverlap platform_a5gY2 ds_d5hta reg'_a5gY7;
+ CmmMachOp _ [Occ=Dead] es_a5gYb ->
+ any
+ @ []
+ @ CmmExpr
+ Data.Foldable.$fFoldable[]
+ (\ (ds_d5htr :: CmmExpr) -> regUsedIn__a5gY3 ds_d5hta ds_d5htr)
+ es_a5gYb;
+ CmmStackSlot _ [Occ=Dead] _ [Occ=Dead] ->
+ ghc-prim-0.6.1:GHC.Types.False;
+ CmmRegOff reg'_a5gY9 _ [Occ=Dead] ->
+ regsOverlap platform_a5gY2 ds_d5hta reg'_a5gY9
+ }; } in
+ regUsedIn__a5gY3
+
+Rec {
+-- RHS size: {terms: 35, types: 20, coercions: 0, joins: 1/1}
+hasNoGlobalRegs [Occ=LoopBreaker] :: CmmExpr -> Bool
+[LclIdX,
+ Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
+ WorkFree=True, Expandable=True, Guidance=IF_ARGS [142] 172 30}]
+hasNoGlobalRegs
+ = \ (ds_d5hwu :: CmmExpr) ->
+ join {
+ fail_d5hzs :: ghc-prim-0.6.1:GHC.Prim.Void# -> Bool
+ [LclId[JoinId(1)],
+ Str=<L,U>,
+ Unf=Unf{Src=<vanilla>, TopLvl=False, Value=True, ConLike=True,
+ WorkFree=True, Expandable=True,
+ Guidance=ALWAYS_IF(arity=1,unsat_ok=True,boring_ok=True)}]
+ fail_d5hzs _ [Occ=Dead, OS=OneShot]
+ = ghc-prim-0.6.1:GHC.Types.False } in
+ case ds_d5hwu of {
+ __DEFAULT -> jump fail_d5hzs ghc-prim-0.6.1:GHC.Prim.void#;
+ CmmLit _ [Occ=Dead] -> ghc-prim-0.6.1:GHC.Types.True;
+ CmmLoad e_a5gXG _ [Occ=Dead] -> hasNoGlobalRegs e_a5gXG;
+ CmmReg ds_d5hzn ->
+ case ds_d5hzn of {
+ __DEFAULT -> jump fail_d5hzs ghc-prim-0.6.1:GHC.Prim.void#;
+ CmmLocal _ [Occ=Dead] -> ghc-prim-0.6.1:GHC.Types.True
+ };
+ CmmMachOp _ [Occ=Dead] es_a5gXH ->
+ all
+ @ [] @ CmmExpr Data.Foldable.$fFoldable[] hasNoGlobalRegs es_a5gXH;
+ CmmRegOff ds_d5hzp _ [Occ=Dead] ->
+ case ds_d5hzp of {
+ __DEFAULT -> jump fail_d5hzs ghc-prim-0.6.1:GHC.Prim.void#;
+ CmmLocal _ [Occ=Dead] -> ghc-prim-0.6.1:GHC.Types.True
+ }
+ }
+end Rec }
+
+-- RHS size: {terms: 4, types: 7, coercions: 0, joins: 0/0}
+bodyToBlockList :: Body CmmNode -> [CmmBlock]
+[LclIdX,
+ Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
+ WorkFree=True, Expandable=True, Guidance=IF_ARGS [0] 30 0}]
+bodyToBlockList
+ = \ (body_a5gYL :: Body CmmNode) ->
+ mapElems
+ @ LabelMap
+ GHC.Cmm.Dataflow.Label.$fIsMapLabelMap
+ @ (Block CmmNode C C)
+ body_a5gYL
+
+-- RHS size: {terms: 11, types: 14, coercions: 0, joins: 0/0}
+foldlGraphBlocks
+ :: forall a. (a -> CmmBlock -> a) -> a -> CmmGraph -> a
+[LclIdX,
+ Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
+ WorkFree=True, Expandable=True, Guidance=IF_ARGS [0 0 0] 90 0}]
+foldlGraphBlocks
+ = \ (@ a_a5hgN)
+ (k_a5gYQ :: a_a5hgN -> CmmBlock -> a_a5hgN)
+ (z_a5gYR :: a_a5hgN)
+ (g_a5gYS :: CmmGraph) ->
+ $ @ 'ghc-prim-0.6.1:GHC.Types.LiftedRep
+ @ (LabelMap CmmBlock)
+ @ a_a5hgN
+ (mapFoldl
+ @ LabelMap
+ GHC.Cmm.Dataflow.Label.$fIsMapLabelMap
+ @ a_a5hgN
+ @ CmmBlock
+ k_a5gYQ
+ z_a5gYR)
+ (toBlockMap g_a5gYS)
+
+-- RHS size: {terms: 6, types: 8, coercions: 0, joins: 0/0}
+toBlockList :: CmmGraph -> [CmmBlock]
+[LclIdX,
+ Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
+ WorkFree=True, Expandable=True, Guidance=IF_ARGS [0] 70 0}]
+toBlockList
+ = \ (g_a5gYo :: CmmGraph) ->
+ $ @ 'ghc-prim-0.6.1:GHC.Types.LiftedRep
+ @ (LabelMap CmmBlock)
+ @ [CmmBlock]
+ (mapElems
+ @ LabelMap GHC.Cmm.Dataflow.Label.$fIsMapLabelMap @ CmmBlock)
+ (toBlockMap g_a5gYo)
+
+-- RHS size: {terms: 41, types: 39, coercions: 3, joins: 0/2}
+toBlockListEntryFirst :: CmmGraph -> [CmmBlock]
+[LclIdX,
+ Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
+ WorkFree=True, Expandable=True, Guidance=IF_ARGS [0] 560 40}]
+toBlockListEntryFirst
+ = \ (g_a5gYp :: CmmGraph) ->
+ let {
+ entry_id_a5gYr :: BlockId
+ [LclId,
+ Unf=Unf{Src=<vanilla>, TopLvl=False, Value=False, ConLike=False,
+ WorkFree=False, Expandable=True, Guidance=IF_ARGS [] 20 0}]
+ entry_id_a5gYr = g_entry @ CmmNode g_a5gYp } in
+ let {
+ m_a5gYq :: LabelMap CmmBlock
+ [LclId,
+ Unf=Unf{Src=<vanilla>, TopLvl=False, Value=False, ConLike=False,
+ WorkFree=False, Expandable=False, Guidance=IF_ARGS [] 20 0}]
+ m_a5gYq = toBlockMap g_a5gYp } in
+ case mapNull
+ @ LabelMap
+ GHC.Cmm.Dataflow.Label.$fIsMapLabelMap
+ @ CmmBlock
+ m_a5gYq
+ of {
+ False ->
+ ghc-prim-0.6.1:GHC.Types.:
+ @ CmmBlock
+ (case case mapLookup
+ @ LabelMap
+ GHC.Cmm.Dataflow.Label.$fIsMapLabelMap
+ @ CmmBlock
+ (entry_id_a5gYr
+ `cast` (Sub (Sym (GHC.Cmm.Dataflow.Label.D:R:KeyOfLabelMap[0]))
+ :: Label ~R# KeyOf LabelMap))
+ m_a5gYq
+ of {
+ __DEFAULT ->
+ Control.Exception.Base.patError
+ @ 'ghc-prim-0.6.1:GHC.Types.LiftedRep
+ @ (Unit CmmBlock)
+ "E:\\ghc_inferTags\\compiler\\GHC\\Cmm\\Utils.hs:541:5-43|Just entry_block"#;
+ Just entry_block_a5gYs -> (entry_block_a5gYs)
+ }
+ of
+ { (entry_block_a5gYs) ->
+ entry_block_a5gYs
+ })
+ (filter
+ @ (Block CmmNode C C)
+ (. @ BlockId
+ @ Bool
+ @ (Block CmmNode C C)
+ (\ (ds_d5hqh :: BlockId) ->
+ /=
+ @ BlockId GHC.Cmm.Dataflow.Label.$fEqLabel ds_d5hqh entry_id_a5gYr)
+ (entryLabel @ (Block CmmNode) $dNonLocal_a5hdF @ C))
+ (mapElems
+ @ LabelMap
+ GHC.Cmm.Dataflow.Label.$fIsMapLabelMap
+ @ CmmBlock
+ m_a5gYq));
+ True -> ghc-prim-0.6.1:GHC.Types.[] @ CmmBlock
+ }
+
+-- RHS size: {terms: 85, types: 67, coercions: 12, joins: 0/4}
+toBlockListEntryFirstFalseFallthrough :: CmmGraph -> [CmmBlock]
+[LclIdX,
+ Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
+ WorkFree=True, Expandable=True, Guidance=NEVER}]
+toBlockListEntryFirstFalseFallthrough
+ = \ (g_a5gYu :: CmmGraph) ->
+ let {
+ m_a5gYv :: LabelMap CmmBlock
+ [LclId,
+ Unf=Unf{Src=<vanilla>, TopLvl=False, Value=False, ConLike=False,
+ WorkFree=False, Expandable=False, Guidance=IF_ARGS [] 20 0}]
+ m_a5gYv = toBlockMap g_a5gYu } in
+ let {
+ entry_block_a5gYx :: CmmBlock
+ [LclId,
+ Unf=Unf{Src=<vanilla>, TopLvl=False, Value=False, ConLike=False,
+ WorkFree=False, Expandable=False, Guidance=IF_ARGS [] 300 0}]
+ entry_block_a5gYx
+ = case case mapLookup
+ @ LabelMap
+ GHC.Cmm.Dataflow.Label.$fIsMapLabelMap
+ @ CmmBlock
+ ((g_entry @ CmmNode g_a5gYu)
+ `cast` (Sub (Sym (GHC.Cmm.Dataflow.Label.D:R:KeyOfLabelMap[0]))
+ :: Label ~R# KeyOf LabelMap))
+ m_a5gYv
+ of {
+ __DEFAULT ->
+ Control.Exception.Base.patError
+ @ 'ghc-prim-0.6.1:GHC.Types.LiftedRep
+ @ (Unit CmmBlock)
+ "E:\\ghc_inferTags\\compiler\\GHC\\Cmm\\Utils.hs:559:5-43|Just entry_block"#;
+ Just entry_block_a5gYx -> (entry_block_a5gYx)
+ }
+ of
+ { (entry_block_a5gYx) ->
+ entry_block_a5gYx
+ } } in
+ letrec {
+ dfs_a5gYy [Occ=LoopBreaker] :: LabelSet -> [CmmBlock] -> [CmmBlock]
+ [LclId,
+ Unf=Unf{Src=<vanilla>, TopLvl=False, Value=True, ConLike=True,
+ WorkFree=True, Expandable=True, Guidance=IF_ARGS [0 30] 400 40}]
+ dfs_a5gYy
+ = \ (ds_d5hqE :: LabelSet) (ds_d5hqF :: [CmmBlock]) ->
+ case ds_d5hqF of {
+ [] -> ghc-prim-0.6.1:GHC.Types.[] @ CmmBlock;
+ : block_a5gYA bs_a5gYB ->
+ let {
+ id_a5gYC :: Label
+ [LclId,
+ Unf=Unf{Src=<vanilla>, TopLvl=False, Value=False, ConLike=False,
+ WorkFree=False, Expandable=False, Guidance=IF_ARGS [] 30 0}]
+ id_a5gYC
+ = entryLabel
+ @ (Block CmmNode) $dNonLocal_a5hdF @ C block_a5gYA } in
+ case setMember
+ @ LabelSet
+ GHC.Cmm.Dataflow.Label.$fIsSetLabelSet
+ (id_a5gYC
+ `cast` (Sub (Sym (GHC.Cmm.Dataflow.Label.D:R:ElemOfLabelSet[0]))
+ :: Label ~R# ElemOf LabelSet))
+ ds_d5hqE
+ of {
+ False ->
+ ghc-prim-0.6.1:GHC.Types.:
+ @ CmmBlock
+ block_a5gYA
+ (dfs_a5gYy
+ (setInsert
+ @ LabelSet
+ GHC.Cmm.Dataflow.Label.$fIsSetLabelSet
+ (id_a5gYC
+ `cast` (Sub (Sym (GHC.Cmm.Dataflow.Label.D:R:ElemOfLabelSet[0]))
+ :: Label ~R# ElemOf LabelSet))
+ ds_d5hqE)
+ (foldr
+ @ []
+ Data.Foldable.$fFoldable[]
+ @ Label
+ @ [CmmBlock]
+ (\ (id_a5gYF :: Label) (bs_a5gYG :: [CmmBlock]) ->
+ case mapLookup
+ @ LabelMap
+ GHC.Cmm.Dataflow.Label.$fIsMapLabelMap
+ @ CmmBlock
+ (id_a5gYF
+ `cast` (Sub (Sym (GHC.Cmm.Dataflow.Label.D:R:KeyOfLabelMap[0]))
+ :: Label ~R# KeyOf LabelMap))
+ m_a5gYv
+ of {
+ Nothing -> bs_a5gYG;
+ Just b_a5gYH ->
+ ghc-prim-0.6.1:GHC.Types.: @ CmmBlock b_a5gYH bs_a5gYG
+ })
+ bs_a5gYB
+ (successors @ (Block CmmNode) $dNonLocal_a5hdF @ C block_a5gYA)));
+ True -> dfs_a5gYy ds_d5hqE bs_a5gYB
+ }
+ }; } in
+ case mapNull
+ @ LabelMap
+ GHC.Cmm.Dataflow.Label.$fIsMapLabelMap
+ @ CmmBlock
+ m_a5gYv
+ of {
+ False ->
+ dfs_a5gYy
+ (setEmpty @ LabelSet GHC.Cmm.Dataflow.Label.$fIsSetLabelSet)
+ (GHC.Base.build
+ @ CmmBlock
+ (\ (@ a_d5hqt)
+ (c_d5hqu :: CmmBlock -> a_d5hqt -> a_d5hqt)
+ (n_d5hqv :: a_d5hqt) ->
+ c_d5hqu entry_block_a5gYx n_d5hqv));
+ True -> ghc-prim-0.6.1:GHC.Types.[] @ CmmBlock
+ }
+
+-- RHS size: {terms: 23, types: 100, coercions: 0, joins: 0/0}
+mapGraphNodes
+ :: (CmmNode C O -> CmmNode C O, CmmNode O O -> CmmNode O O,
+ CmmNode O C -> CmmNode O C)
+ -> CmmGraph -> CmmGraph
+[LclIdX,
+ Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
+ WorkFree=True, Expandable=True, Guidance=IF_ARGS [20 0] 290 0}]
+mapGraphNodes
+ = \ (funs_a5gYM
+ :: (CmmNode C O -> CmmNode C O, CmmNode O O -> CmmNode O O,
+ CmmNode O C -> CmmNode O C))
+ (g_a5gYO :: CmmGraph) ->
+ case funs_a5gYM of wild_00
+ { (mf_a5gYN, _ [Occ=Dead], _ [Occ=Dead]) ->
+ $ @ 'ghc-prim-0.6.1:GHC.Types.LiftedRep
+ @ (LabelMap CmmBlock)
+ @ CmmGraph
+ (ofBlockMap
+ ($ @ 'ghc-prim-0.6.1:GHC.Types.LiftedRep
+ @ (CmmNode C O)
+ @ Label
+ (entryLabel @ CmmNode GHC.Cmm.Node.$fNonLocalCmmNode @ O)
+ ($ @ 'ghc-prim-0.6.1:GHC.Types.LiftedRep
+ @ (CmmNode C O)
+ @ (CmmNode C O)
+ mf_a5gYN
+ (GHC.Cmm.Node.$WCmmEntry
+ (g_entry @ CmmNode g_a5gYO) GHC.Cmm.Node.GlobalScope))))
+ ($ @ 'ghc-prim-0.6.1:GHC.Types.LiftedRep
+ @ (LabelMap (Block CmmNode C C))
+ @ (LabelMap (Block CmmNode C C))
+ (mapMap
+ @ LabelMap
+ GHC.Cmm.Dataflow.Label.$fIsMapLabelMap
+ @ (Block CmmNode C C)
+ @ (Block CmmNode C C)
+ (mapBlock3' @ CmmNode @ CmmNode @ C @ C wild_00))
+ (toBlockMap g_a5gYO))
+ }
+
+
diff --git a/compiler/GHC/Cmm/Utils.dump-ds-preopt b/compiler/GHC/Cmm/Utils.dump-ds-preopt
new file mode 100644
index 0000000000..4ae7e02db4
--- /dev/null
+++ b/compiler/GHC/Cmm/Utils.dump-ds-preopt
@@ -0,0 +1,4760 @@
+
+==================== Desugar (before optimization) ====================
+2020-11-24 12:41:53.3451651 UTC
+
+Result size of Desugar (before optimization)
+ = {terms: 1,961, types: 1,710, coercions: 43, joins: 0/103}
+
+Rec {
+-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
+$dIsMap_a18BT :: IsMap LabelMap
+[LclId]
+$dIsMap_a18BT = $dIsMap_a18yG
+
+-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
+$dIsMap_a18Bx :: IsMap LabelMap
+[LclId]
+$dIsMap_a18Bx = $dIsMap_a18yG
+
+-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
+$dIsMap_a18AV :: IsMap LabelMap
+[LclId]
+$dIsMap_a18AV = $dIsMap_a18yG
+
+-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
+$dIsMap_a18AG :: IsMap LabelMap
+[LclId]
+$dIsMap_a18AG = $dIsMap_a18yG
+
+-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
+$dIsMap_a18Ae :: IsMap LabelMap
+[LclId]
+$dIsMap_a18Ae = $dIsMap_a18yG
+
+-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
+$dIsMap_a18A8 :: IsMap LabelMap
+[LclId]
+$dIsMap_a18A8 = $dIsMap_a18yG
+
+-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
+$dIsMap_a18zS :: IsMap LabelMap
+[LclId]
+$dIsMap_a18zS = $dIsMap_a18yG
+
+-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
+$dIsMap_a18zy :: IsMap LabelMap
+[LclId]
+$dIsMap_a18zy = $dIsMap_a18yG
+
+-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
+$dIsMap_a18yG :: IsMap LabelMap
+[LclId]
+$dIsMap_a18yG = GHC.Cmm.Dataflow.Label.$fIsMapLabelMap
+
+-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
+$dFoldable_a18E7 :: Foldable []
+[LclId]
+$dFoldable_a18E7 = $dFoldable_a18yM
+
+-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
+$dFoldable_a18DN :: Foldable []
+[LclId]
+$dFoldable_a18DN = $dFoldable_a18yM
+
+-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
+$dFoldable_a18B6 :: Foldable []
+[LclId]
+$dFoldable_a18B6 = $dFoldable_a18yM
+
+-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
+$dFoldable_a18yM :: Foldable []
+[LclId]
+$dFoldable_a18yM = Data.Foldable.$fFoldable[]
+
+-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
+$dNonLocal_a18Cj :: NonLocal (Block CmmNode)
+[LclId]
+$dNonLocal_a18Cj = $dNonLocal_a18yU
+
+-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
+$dNonLocal_a18Bi :: NonLocal (Block CmmNode)
+[LclId]
+$dNonLocal_a18Bi = $dNonLocal_a18yU
+
+-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
+$dNonLocal_a18Bb :: NonLocal (Block CmmNode)
+[LclId]
+$dNonLocal_a18Bb = $dNonLocal_a18yU
+
+-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
+$dNonLocal_a18A5 :: NonLocal (Block CmmNode)
+[LclId]
+$dNonLocal_a18A5 = $dNonLocal_a18yU
+
+-- RHS size: {terms: 2, types: 1, coercions: 0, joins: 0/0}
+$dNonLocal_a18yU :: NonLocal (Block CmmNode)
+[LclId]
+$dNonLocal_a18yU
+ = GHC.Cmm.Dataflow.Graph.$fNonLocalBlock @ CmmNode $dNonLocal_a18IU
+
+-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
+$dNonLocal_a18BH :: NonLocal CmmNode
+[LclId]
+$dNonLocal_a18BH = $dNonLocal_a18IU
+
+-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
+$dNonLocal_a18IU :: NonLocal CmmNode
+[LclId]
+$dNonLocal_a18IU = GHC.Cmm.Node.$fNonLocalCmmNode
+
+-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
+$d(%%)_a18IC :: GHC.Utils.Misc.HasDebugCallStack
+[LclId]
+$d(%%)_a18IC = $d(%%)_a18yV
+
+-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
+$d(%%)_a18Iw :: GHC.Utils.Misc.HasDebugCallStack
+[LclId]
+$d(%%)_a18Iw = $d(%%)_a18yV
+
+-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
+$d(%%)_a18yV :: GHC.Utils.Misc.HasDebugCallStack
+[LclId]
+$d(%%)_a18yV = ghc-prim-0.6.1:GHC.Classes.C:(%%)
+
+-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
+$dEq_a18A2 :: Eq BlockId
+[LclId]
+$dEq_a18A2 = GHC.Cmm.Dataflow.Label.$fEqLabel
+
+-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
+$dIsSet_a18BB :: IsSet LabelSet
+[LclId]
+$dIsSet_a18BB = $dIsSet_a18Bq
+
+-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
+$dIsSet_a18Bu :: IsSet LabelSet
+[LclId]
+$dIsSet_a18Bu = $dIsSet_a18Bq
+
+-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
+$dIsSet_a18Bq :: IsSet LabelSet
+[LclId]
+$dIsSet_a18Bq = GHC.Cmm.Dataflow.Label.$fIsSetLabelSet
+
+-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
+$dIntegral_a18HY :: Integral Int
+[LclId]
+$dIntegral_a18HY = $dIntegral_a18D0
+
+-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
+$dIntegral_a18FZ :: Integral Int
+[LclId]
+$dIntegral_a18FZ = $dIntegral_a18D0
+
+-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
+$dIntegral_a18FT :: Integral Int
+[LclId]
+$dIntegral_a18FT = $dIntegral_a18D0
+
+-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
+$dIntegral_a18Fe :: Integral Int
+[LclId]
+$dIntegral_a18Fe = $dIntegral_a18D0
+
+-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
+$dIntegral_a18D0 :: Integral Int
+[LclId]
+$dIntegral_a18D0 = GHC.Real.$fIntegralInt
+
+-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
+$dNum_a18Ig :: Num WordOff
+[LclId]
+$dNum_a18Ig = $dNum_a18D2
+
+-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
+$dNum_a18I5 :: Num Int
+[LclId]
+$dNum_a18I5 = $dNum_a18D2
+
+-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
+$dNum_a18Gb :: Num Int
+[LclId]
+$dNum_a18Gb = $dNum_a18D2
+
+-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
+$dNum_a18G7 :: Num WordOff
+[LclId]
+$dNum_a18G7 = $dNum_a18D2
+
+-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
+$dNum_a18G2 :: Num Int
+[LclId]
+$dNum_a18G2 = $dNum_a18D2
+
+-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
+$dNum_a18FP :: Num Int
+[LclId]
+$dNum_a18FP = $dNum_a18D2
+
+-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
+$dNum_a18FN :: Num Int
+[LclId]
+$dNum_a18FN = $dNum_a18D2
+
+-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
+$dNum_a18FJ :: Num Int
+[LclId]
+$dNum_a18FJ = $dNum_a18D2
+
+-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
+$dNum_a18FA :: Num WordOff
+[LclId]
+$dNum_a18FA = $dNum_a18D2
+
+-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
+$dNum_a18Fw :: Num Int
+[LclId]
+$dNum_a18Fw = $dNum_a18D2
+
+-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
+$dNum_a18Fn :: Num WordOff
+[LclId]
+$dNum_a18Fn = $dNum_a18D2
+
+-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
+$dNum_a18F9 :: Num Int
+[LclId]
+$dNum_a18F9 = $dNum_a18D2
+
+-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
+$dNum_a18F7 :: Num Int
+[LclId]
+$dNum_a18F7 = $dNum_a18D2
+
+-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
+$dNum_a18F4 :: Num WordOff
+[LclId]
+$dNum_a18F4 = $dNum_a18D2
+
+-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
+$dNum_a18EZ :: Num Int
+[LclId]
+$dNum_a18EZ = $dNum_a18D2
+
+-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
+$dNum_a18E0 :: Num Int
+[LclId]
+$dNum_a18E0 = $dNum_a18D2
+
+-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
+$dNum_a18DW :: Num Int
+[LclId]
+$dNum_a18DW = $dNum_a18D2
+
+-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
+$dNum_a18DQ :: Num Int
+[LclId]
+$dNum_a18DQ = $dNum_a18D2
+
+-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
+$dNum_a18D8 :: Num Int
+[LclId]
+$dNum_a18D8 = $dNum_a18D2
+
+-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
+$dNum_a18D4 :: Num Int
+[LclId]
+$dNum_a18D4 = $dNum_a18D2
+
+-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
+$dNum_a18D2 :: Num Int
+[LclId]
+$dNum_a18D2 = GHC.Num.$fNumInt
+
+-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
+$dEq_a18Do :: Eq GHC.Platform.Reg.RealReg
+[LclId]
+$dEq_a18Do = GHC.Platform.Reg.$fEqRealReg
+
+-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
+$dEq_a18Dq :: Eq CmmReg
+[LclId]
+$dEq_a18Dq = GHC.Cmm.Expr.$fEqCmmReg
+
+-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
+$dBits_a18In :: Bits Int
+[LclId]
+$dBits_a18In = $dBits_a18DS
+
+-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
+$dBits_a18DS :: Bits Int
+[LclId]
+$dBits_a18DS = Data.Bits.$fBitsInt
+
+-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
+$dEq_a18Ev :: Eq Width
+[LclId]
+$dEq_a18Ev = GHC.Cmm.Type.$fEqWidth
+
+-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
+$dNum_a18FR :: Num Integer
+[LclId]
+$dNum_a18FR = $dNum_a18ED
+
+-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
+$dNum_a18Ff :: Num Integer
+[LclId]
+$dNum_a18Ff = $dNum_a18ED
+
+-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
+$dNum_a18Fb :: Num Integer
+[LclId]
+$dNum_a18Fb = $dNum_a18ED
+
+-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
+$dNum_a18ED :: Num Integer
+[LclId]
+$dNum_a18ED = GHC.Num.$fNumInteger
+
+-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
+$dEq_a18FF :: Eq Int
+[LclId]
+$dEq_a18FF = $dEq_a18EV
+
+-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
+$dEq_a18Fs :: Eq Int
+[LclId]
+$dEq_a18Fs = $dEq_a18EV
+
+-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
+$dEq_a18EV :: Eq Int
+[LclId]
+$dEq_a18EV = ghc-prim-0.6.1:GHC.Classes.$fEqInt
+
+-- RHS size: {terms: 20, types: 3, coercions: 7, joins: 0/0}
+$dIP_a18Fh :: GHC.Stack.Types.HasCallStack
+[LclId]
+$dIP_a18Fh
+ = (GHC.Stack.Types.pushCallStack
+ (ghc-prim-0.6.1:GHC.CString.unpackCString# "pprPanic"#,
+ GHC.Stack.Types.SrcLoc
+ (ghc-prim-0.6.1:GHC.CString.unpackCString# "ghc"#)
+ (ghc-prim-0.6.1:GHC.CString.unpackCString# "GHC.Cmm.Utils"#)
+ (ghc-prim-0.6.1:GHC.CString.unpackCString#
+ "E:\\ghc_inferTags\\compiler\\GHC\\Cmm\\Utils.hs"#)
+ (ghc-prim-0.6.1:GHC.Types.I# 284#)
+ (ghc-prim-0.6.1:GHC.Types.I# 43#)
+ (ghc-prim-0.6.1:GHC.Types.I# 284#)
+ (ghc-prim-0.6.1:GHC.Types.I# 81#))
+ ($dIP_a18IV
+ `cast` (ghc-prim-0.6.1:GHC.Classes.N:IP[0]
+ <"callStack">_N <GHC.Stack.Types.CallStack>_N
+ :: (?callStack::GHC.Stack.Types.CallStack)
+ ~R# GHC.Stack.Types.CallStack)))
+ `cast` (Sym (ghc-prim-0.6.1:GHC.Classes.N:IP[0]
+ <"callStack">_N <GHC.Stack.Types.CallStack>_N)
+ :: GHC.Stack.Types.CallStack
+ ~R# (?callStack::GHC.Stack.Types.CallStack))
+
+-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
+$dOutputable_a18Fj :: Outputable Int
+[LclId]
+$dOutputable_a18Fj = GHC.Utils.Outputable.$fOutputableInt
+
+-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
+$dBits_a18HT :: Bits Integer
+[LclId]
+$dBits_a18HT = $dBits_a18HN
+
+-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
+$dBits_a18HR :: Bits Integer
+[LclId]
+$dBits_a18HR = $dBits_a18HN
+
+-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
+$dBits_a18HP :: Bits Integer
+[LclId]
+$dBits_a18HP = $dBits_a18HN
+
+-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
+$dBits_a18HN :: Bits Integer
+[LclId]
+$dBits_a18HN = Data.Bits.$fBitsInteger
+
+-- RHS size: {terms: 1, types: 0, coercions: 4, joins: 0/0}
+$dIP_a18IV :: GHC.Stack.Types.HasCallStack
+[LclId]
+$dIP_a18IV
+ = GHC.Stack.Types.emptyCallStack
+ `cast` (Sym (ghc-prim-0.6.1:GHC.Classes.N:IP[0]
+ <"callStack">_N <GHC.Stack.Types.CallStack>_N)
+ :: GHC.Stack.Types.CallStack
+ ~R# (?callStack::GHC.Stack.Types.CallStack))
+
+-- RHS size: {terms: 5, types: 0, coercions: 0, joins: 0/0}
+GHC.Cmm.Utils.$trModule :: ghc-prim-0.6.1:GHC.Types.Module
+[LclIdX]
+GHC.Cmm.Utils.$trModule
+ = ghc-prim-0.6.1:GHC.Types.Module
+ (ghc-prim-0.6.1:GHC.Types.TrNameS "ghc"#)
+ (ghc-prim-0.6.1:GHC.Types.TrNameS "GHC.Cmm.Utils"#)
+
+-- RHS size: {terms: 2, types: 0, coercions: 0, joins: 0/0}
+cccsExpr :: CmmExpr
+[LclIdX]
+cccsExpr = GHC.Cmm.Expr.$WCmmReg cccsReg
+
+-- RHS size: {terms: 2, types: 0, coercions: 0, joins: 0/0}
+currentNurseryExpr :: CmmExpr
+[LclIdX]
+currentNurseryExpr = GHC.Cmm.Expr.$WCmmReg currentNurseryReg
+
+-- RHS size: {terms: 2, types: 0, coercions: 0, joins: 0/0}
+currentTSOExpr :: CmmExpr
+[LclIdX]
+currentTSOExpr = GHC.Cmm.Expr.$WCmmReg currentTSOReg
+
+-- RHS size: {terms: 2, types: 0, coercions: 0, joins: 0/0}
+hpLimExpr :: CmmExpr
+[LclIdX]
+hpLimExpr = GHC.Cmm.Expr.$WCmmReg hpLimReg
+
+-- RHS size: {terms: 2, types: 0, coercions: 0, joins: 0/0}
+hpExpr :: CmmExpr
+[LclIdX]
+hpExpr = GHC.Cmm.Expr.$WCmmReg hpReg
+
+-- RHS size: {terms: 2, types: 0, coercions: 0, joins: 0/0}
+spLimExpr :: CmmExpr
+[LclIdX]
+spLimExpr = GHC.Cmm.Expr.$WCmmReg spLimReg
+
+-- RHS size: {terms: 2, types: 0, coercions: 0, joins: 0/0}
+spExpr :: CmmExpr
+[LclIdX]
+spExpr = GHC.Cmm.Expr.$WCmmReg spReg
+
+-- RHS size: {terms: 2, types: 0, coercions: 0, joins: 0/0}
+baseExpr :: CmmExpr
+[LclIdX]
+baseExpr = GHC.Cmm.Expr.$WCmmReg baseReg
+
+-- RHS size: {terms: 32, types: 69, coercions: 17, joins: 0/4}
+blockTicks :: Block CmmNode C C -> [CmmTickish]
+[LclIdX]
+blockTicks
+ = \ (b_a18jX :: Block CmmNode C C) ->
+ letrec {
+ goStmt_a18jY
+ :: forall (e :: Extensibility) (x :: Extensibility).
+ CmmNode e x -> [CmmTickish] -> [CmmTickish]
+ [LclId]
+ goStmt_a18jY
+ = \ (@ (e_a18xu :: Extensibility))
+ (@ (x_a18xv :: Extensibility))
+ (ds_d18J1 :: CmmNode e_a18xu x_a18xv)
+ (ts_a18k2 :: [CmmTickish]) ->
+ let {
+ _other_a18k3 :: CmmNode e_a18xu x_a18xv
+ [LclId]
+ _other_a18k3 = ds_d18J1 } in
+ let {
+ fail_d18JT :: ghc-prim-0.6.1:GHC.Prim.Void# -> [CmmTickish]
+ [LclId]
+ fail_d18JT
+ = \ (ds_d18JU [OS=OneShot] :: ghc-prim-0.6.1:GHC.Prim.Void#) ->
+ let {
+ ts_a18k4 :: [CmmTickish]
+ [LclId]
+ ts_a18k4 = ts_a18k2 } in
+ ts_a18k4 } in
+ case ds_d18J1 of wild_00 {
+ __DEFAULT -> fail_d18JT ghc-prim-0.6.1:GHC.Prim.void#;
+ CmmTick co_a18y3 co_a18y4 t_a18k1 ->
+ ghc-prim-0.6.1:GHC.Types.: @ CmmTickish t_a18k1 ts_a18k2
+ }; } in
+ $ @ 'ghc-prim-0.6.1:GHC.Types.LiftedRep
+ @ [CmmTickish]
+ @ [CmmTickish]
+ (reverse @ CmmTickish)
+ (((\ (ds_d18J0
+ :: forall (e :: Extensibility) (x :: Extensibility).
+ CmmNode e x -> [CmmTickish] -> [CmmTickish]) ->
+ foldBlockNodesF @ CmmNode @ [CmmTickish] ds_d18J0 @ C @ C)
+ (\ (@ (e_a18yn :: Extensibility)) (@ (x_a18yo :: Extensibility)) ->
+ goStmt_a18jY @ e_a18yn @ x_a18yo)
+ b_a18jX
+ ((ghc-prim-0.6.1:GHC.Types.[] @ CmmTickish)
+ `cast` (Sub (Sym (GHC.Cmm.Dataflow.Block.D:R:IndexedCOkCloseda_b[0]
+ <*>_N <[CmmTickish]>_N <[CmmTickish]>_N))
+ :: [CmmTickish] ~R# IndexedCO C [CmmTickish] [CmmTickish])))
+ `cast` (Sub (GHC.Cmm.Dataflow.Block.D:R:IndexedCOkCloseda_b[0]
+ <*>_N <[CmmTickish]>_N <[CmmTickish]>_N)
+ :: IndexedCO C [CmmTickish] [CmmTickish] ~R# [CmmTickish]))
+
+-- RHS size: {terms: 4, types: 7, coercions: 0, joins: 0/0}
+bodyToBlockList :: Body CmmNode -> [CmmBlock]
+[LclIdX]
+bodyToBlockList
+ = \ (body_a18jO :: Body CmmNode) ->
+ mapElems @ LabelMap $dIsMap_a18yG @ (Block CmmNode C C) body_a18jO
+
+-- RHS size: {terms: 16, types: 35, coercions: 0, joins: 0/1}
+ofBlockList :: BlockId -> [CmmBlock] -> CmmGraph
+[LclIdX]
+ofBlockList
+ = \ (entry_a18jL :: BlockId) (blocks_a18jM :: [CmmBlock]) ->
+ letrec {
+ body_a18jN :: LabelMap (Block CmmNode C C)
+ [LclId]
+ body_a18jN
+ = foldr
+ @ []
+ $dFoldable_a18yM
+ @ (Block CmmNode C C)
+ @ (LabelMap (Block CmmNode C C))
+ (addBlock @ (Block CmmNode) $dNonLocal_a18yU $d(%%)_a18yV)
+ (emptyBody @ Block @ CmmNode)
+ blocks_a18jM; } in
+ GHC.Cmm.CmmGraph
+ @ CmmNode
+ entry_a18jL
+ (GHC.Cmm.Dataflow.Graph.$WGMany
+ @ 'Closed
+ @ Block
+ @ CmmNode
+ @ 'Closed
+ (GHC.Cmm.Dataflow.Block.$WNothingO @ (Block CmmNode O C))
+ body_a18jN
+ (GHC.Cmm.Dataflow.Block.$WNothingO @ (Block CmmNode C O)))
+
+-- RHS size: {terms: 8, types: 16, coercions: 0, joins: 0/0}
+ofBlockMap :: BlockId -> LabelMap CmmBlock -> CmmGraph
+[LclIdX]
+ofBlockMap
+ = \ (entry_a18jp :: BlockId)
+ (bodyMap_a18jq :: LabelMap CmmBlock) ->
+ GHC.Cmm.CmmGraph
+ @ CmmNode
+ entry_a18jp
+ (GHC.Cmm.Dataflow.Graph.$WGMany
+ @ 'Closed
+ @ Block
+ @ CmmNode
+ @ 'Closed
+ (GHC.Cmm.Dataflow.Block.$WNothingO @ (Block CmmNode O C))
+ bodyMap_a18jq
+ (GHC.Cmm.Dataflow.Block.$WNothingO @ (Block CmmNode C O)))
+
+-- RHS size: {terms: 27, types: 57, coercions: 0, joins: 0/1}
+toBlockMap :: CmmGraph -> LabelMap CmmBlock
+[LclIdX]
+toBlockMap
+ = \ (ds_d18JV :: GenCmmGraph CmmNode) ->
+ let {
+ fail_d18LC :: ghc-prim-0.6.1:GHC.Prim.Void# -> LabelMap CmmBlock
+ [LclId]
+ fail_d18LC
+ = \ (ds_d18LD [OS=OneShot] :: ghc-prim-0.6.1:GHC.Prim.Void#) ->
+ Control.Exception.Base.patError
+ @ 'ghc-prim-0.6.1:GHC.Types.LiftedRep
+ @ (LabelMap CmmBlock)
+ "E:\\ghc_inferTags\\compiler\\GHC\\Cmm\\Utils.hs:525:1-67|function toBlockMap"# } in
+ case ds_d18JV of wild_00 { CmmGraph ds_d18Ly ds_d18Lz ->
+ case ds_d18Lz of wild_00 {
+ __DEFAULT -> fail_d18LC ghc-prim-0.6.1:GHC.Prim.void#;
+ GMany ds_d18LA body_a18jo ds_d18LB ->
+ case ds_d18LA of wild_00 {
+ __DEFAULT -> fail_d18LC ghc-prim-0.6.1:GHC.Prim.void#;
+ NothingO co_a18zq ->
+ case ds_d18LB of wild_00 {
+ __DEFAULT -> fail_d18LC ghc-prim-0.6.1:GHC.Prim.void#;
+ NothingO co_a18zr -> body_a18jo
+ }
+ }
+ }
+ }
+
+-- RHS size: {terms: 6, types: 8, coercions: 0, joins: 0/0}
+toBlockList :: CmmGraph -> [CmmBlock]
+[LclIdX]
+toBlockList
+ = \ (g_a18jr :: CmmGraph) ->
+ $ @ 'ghc-prim-0.6.1:GHC.Types.LiftedRep
+ @ (LabelMap CmmBlock)
+ @ [CmmBlock]
+ (mapElems @ LabelMap $dIsMap_a18zy @ CmmBlock)
+ (toBlockMap g_a18jr)
+
+-- RHS size: {terms: 59, types: 58, coercions: 3, joins: 0/9}
+toBlockListEntryFirst :: CmmGraph -> [CmmBlock]
+[LclIdX]
+toBlockListEntryFirst
+ = \ (g_a18js :: CmmGraph) ->
+ letrec {
+ entry_id_a18ju :: BlockId
+ [LclId]
+ entry_id_a18ju = g_entry @ CmmNode g_a18js; } in
+ letrec {
+ m_a18jt :: LabelMap CmmBlock
+ [LclId]
+ m_a18jt = toBlockMap g_a18js; } in
+ letrec {
+ ds_d18LO :: Unit CmmBlock
+ [LclId]
+ ds_d18LO
+ = let {
+ fail_d18LW :: ghc-prim-0.6.1:GHC.Prim.Void# -> Unit CmmBlock
+ [LclId]
+ fail_d18LW
+ = \ (ds_d18LX [OS=OneShot] :: ghc-prim-0.6.1:GHC.Prim.Void#) ->
+ Control.Exception.Base.patError
+ @ 'ghc-prim-0.6.1:GHC.Types.LiftedRep
+ @ (Unit CmmBlock)
+ "E:\\ghc_inferTags\\compiler\\GHC\\Cmm\\Utils.hs:541:5-43|Just entry_block"# } in
+ let {
+ ds_d18LP :: Maybe CmmBlock
+ [LclId]
+ ds_d18LP
+ = mapLookup
+ @ LabelMap
+ $dIsMap_a18zS
+ @ CmmBlock
+ (entry_id_a18ju
+ `cast` (Sub (Sym (GHC.Cmm.Dataflow.Label.D:R:KeyOfLabelMap[0]))
+ :: Label ~R# KeyOf LabelMap))
+ m_a18jt } in
+ case ds_d18LP of wild_00 {
+ __DEFAULT -> fail_d18LW ghc-prim-0.6.1:GHC.Prim.void#;
+ Just entry_block_a18jv -> (entry_block_a18jv)
+ };
+ entry_block_a18jv :: CmmBlock
+ [LclId]
+ entry_block_a18jv
+ = case ds_d18LO of ds_d18LO { (entry_block_a18jv) ->
+ entry_block_a18jv
+ }; } in
+ letrec {
+ others_a18jw :: [Block CmmNode C C]
+ [LclId]
+ others_a18jw
+ = filter
+ @ (Block CmmNode C C)
+ (. @ BlockId
+ @ Bool
+ @ (Block CmmNode C C)
+ (let {
+ ds_d18LN :: BlockId
+ [LclId]
+ ds_d18LN = entry_id_a18ju } in
+ \ (ds_d18LM :: BlockId) ->
+ /= @ BlockId $dEq_a18A2 ds_d18LM ds_d18LN)
+ (entryLabel @ (Block CmmNode) $dNonLocal_a18A5 @ C))
+ (mapElems @ LabelMap $dIsMap_a18A8 @ CmmBlock m_a18jt); } in
+ let {
+ fail_d18LK :: ghc-prim-0.6.1:GHC.Prim.Void# -> [CmmBlock]
+ [LclId]
+ fail_d18LK
+ = \ (ds_d18LL [OS=OneShot] :: ghc-prim-0.6.1:GHC.Prim.Void#) ->
+ ghc-prim-0.6.1:GHC.Types.:
+ @ CmmBlock entry_block_a18jv others_a18jw } in
+ case mapNull @ LabelMap $dIsMap_a18Ae @ CmmBlock m_a18jt
+ of wild_00 {
+ False -> fail_d18LK ghc-prim-0.6.1:GHC.Prim.void#;
+ True -> ghc-prim-0.6.1:GHC.Types.[] @ CmmBlock
+ }
+
+-- RHS size: {terms: 111, types: 94, coercions: 12, joins: 0/14}
+toBlockListEntryFirstFalseFallthrough :: CmmGraph -> [CmmBlock]
+[LclIdX]
+toBlockListEntryFirstFalseFallthrough
+ = \ (g_a18jx :: CmmGraph) ->
+ letrec {
+ entry_id_a18jz :: BlockId
+ [LclId]
+ entry_id_a18jz = g_entry @ CmmNode g_a18jx; } in
+ letrec {
+ m_a18jy :: LabelMap CmmBlock
+ [LclId]
+ m_a18jy = toBlockMap g_a18jx; } in
+ letrec {
+ ds_d18MF :: Unit CmmBlock
+ [LclId]
+ ds_d18MF
+ = let {
+ fail_d18MN :: ghc-prim-0.6.1:GHC.Prim.Void# -> Unit CmmBlock
+ [LclId]
+ fail_d18MN
+ = \ (ds_d18MO [OS=OneShot] :: ghc-prim-0.6.1:GHC.Prim.Void#) ->
+ Control.Exception.Base.patError
+ @ 'ghc-prim-0.6.1:GHC.Types.LiftedRep
+ @ (Unit CmmBlock)
+ "E:\\ghc_inferTags\\compiler\\GHC\\Cmm\\Utils.hs:559:5-43|Just entry_block"# } in
+ let {
+ ds_d18MG :: Maybe CmmBlock
+ [LclId]
+ ds_d18MG
+ = mapLookup
+ @ LabelMap
+ $dIsMap_a18AG
+ @ CmmBlock
+ (entry_id_a18jz
+ `cast` (Sub (Sym (GHC.Cmm.Dataflow.Label.D:R:KeyOfLabelMap[0]))
+ :: Label ~R# KeyOf LabelMap))
+ m_a18jy } in
+ case ds_d18MG of wild_00 {
+ __DEFAULT -> fail_d18MN ghc-prim-0.6.1:GHC.Prim.void#;
+ Just entry_block_a18jA -> (entry_block_a18jA)
+ };
+ entry_block_a18jA :: CmmBlock
+ [LclId]
+ entry_block_a18jA
+ = case ds_d18MF of ds_d18MF { (entry_block_a18jA) ->
+ entry_block_a18jA
+ }; } in
+ letrec {
+ dfs_a18jB :: LabelSet -> [CmmBlock] -> [CmmBlock]
+ [LclId]
+ dfs_a18jB
+ = \ (ds_d18M9 :: LabelSet) (ds_d18Ma :: [CmmBlock]) ->
+ let {
+ visited_a18jC :: LabelSet
+ [LclId]
+ visited_a18jC = ds_d18M9 } in
+ case ds_d18Ma of wild_00 {
+ [] -> ghc-prim-0.6.1:GHC.Types.[] @ CmmBlock;
+ : block_a18jD bs_a18jE ->
+ letrec {
+ add_id_a18jH :: Label -> [CmmBlock] -> [CmmBlock]
+ [LclId]
+ add_id_a18jH
+ = \ (id_a18jI :: Label) (bs_a18jJ :: [CmmBlock]) ->
+ let {
+ ds_d18Mt :: Maybe CmmBlock
+ [LclId]
+ ds_d18Mt
+ = mapLookup
+ @ LabelMap
+ $dIsMap_a18AV
+ @ CmmBlock
+ (id_a18jI
+ `cast` (Sub (Sym (GHC.Cmm.Dataflow.Label.D:R:KeyOfLabelMap[0]))
+ :: Label ~R# KeyOf LabelMap))
+ m_a18jy } in
+ case ds_d18Mt of wild_00 {
+ Nothing -> bs_a18jJ;
+ Just b_a18jK ->
+ ghc-prim-0.6.1:GHC.Types.: @ CmmBlock b_a18jK bs_a18jJ
+ }; } in
+ letrec {
+ bs'_a18jG :: [CmmBlock]
+ [LclId]
+ bs'_a18jG
+ = foldr
+ @ []
+ $dFoldable_a18B6
+ @ Label
+ @ [CmmBlock]
+ add_id_a18jH
+ bs_a18jE
+ (successors
+ @ (Block CmmNode) $dNonLocal_a18Bb @ C block_a18jD); } in
+ letrec {
+ id_a18jF :: Label
+ [LclId]
+ id_a18jF
+ = entryLabel
+ @ (Block CmmNode) $dNonLocal_a18Bi @ C block_a18jD; } in
+ let {
+ fail_d18Mr :: ghc-prim-0.6.1:GHC.Prim.Void# -> [CmmBlock]
+ [LclId]
+ fail_d18Mr
+ = \ (ds_d18Ms [OS=OneShot] :: ghc-prim-0.6.1:GHC.Prim.Void#) ->
+ ghc-prim-0.6.1:GHC.Types.:
+ @ CmmBlock
+ block_a18jD
+ (dfs_a18jB
+ (setInsert
+ @ LabelSet
+ $dIsSet_a18Bu
+ (id_a18jF
+ `cast` (Sub (Sym (GHC.Cmm.Dataflow.Label.D:R:ElemOfLabelSet[0]))
+ :: Label ~R# ElemOf LabelSet))
+ visited_a18jC)
+ bs'_a18jG) } in
+ case setMember
+ @ LabelSet
+ $dIsSet_a18Bq
+ (id_a18jF
+ `cast` (Sub (Sym (GHC.Cmm.Dataflow.Label.D:R:ElemOfLabelSet[0]))
+ :: Label ~R# ElemOf LabelSet))
+ visited_a18jC
+ of wild_00 {
+ False -> fail_d18Mr ghc-prim-0.6.1:GHC.Prim.void#;
+ True -> dfs_a18jB visited_a18jC bs_a18jE
+ }
+ }; } in
+ let {
+ fail_d18M7 :: ghc-prim-0.6.1:GHC.Prim.Void# -> [CmmBlock]
+ [LclId]
+ fail_d18M7
+ = \ (ds_d18M8 [OS=OneShot] :: ghc-prim-0.6.1:GHC.Prim.Void#) ->
+ dfs_a18jB
+ (setEmpty @ LabelSet $dIsSet_a18BB)
+ (GHC.Base.build
+ @ CmmBlock
+ (\ (@ a_d18LY)
+ (c_d18LZ :: CmmBlock -> a_d18LY -> a_d18LY)
+ (n_d18M0 :: a_d18LY) ->
+ c_d18LZ entry_block_a18jA n_d18M0)) } in
+ case mapNull @ LabelMap $dIsMap_a18Bx @ CmmBlock m_a18jy
+ of wild_00 {
+ False -> fail_d18M7 ghc-prim-0.6.1:GHC.Prim.void#;
+ True -> ghc-prim-0.6.1:GHC.Types.[] @ CmmBlock
+ }
+
+-- RHS size: {terms: 23, types: 100, coercions: 0, joins: 0/0}
+mapGraphNodes
+ :: (CmmNode C O -> CmmNode C O, CmmNode O O -> CmmNode O O,
+ CmmNode O C -> CmmNode O C)
+ -> CmmGraph -> CmmGraph
+[LclIdX]
+mapGraphNodes
+ = \ (funs_a18jP
+ :: (CmmNode C O -> CmmNode C O, CmmNode O O -> CmmNode O O,
+ CmmNode O C -> CmmNode O C))
+ (g_a18jR :: CmmGraph) ->
+ case funs_a18jP of wild_00 { (mf_a18jQ, ds_d18MZ, ds_d18N0) ->
+ $ @ 'ghc-prim-0.6.1:GHC.Types.LiftedRep
+ @ (LabelMap CmmBlock)
+ @ CmmGraph
+ (ofBlockMap
+ ($ @ 'ghc-prim-0.6.1:GHC.Types.LiftedRep
+ @ (CmmNode C O)
+ @ Label
+ (entryLabel @ CmmNode $dNonLocal_a18BH @ O)
+ ($ @ 'ghc-prim-0.6.1:GHC.Types.LiftedRep
+ @ (CmmNode C O)
+ @ (CmmNode C O)
+ mf_a18jQ
+ (GHC.Cmm.Node.$WCmmEntry
+ (g_entry @ CmmNode g_a18jR) GHC.Cmm.Node.GlobalScope))))
+ ($ @ 'ghc-prim-0.6.1:GHC.Types.LiftedRep
+ @ (LabelMap (Block CmmNode C C))
+ @ (LabelMap (Block CmmNode C C))
+ (mapMap
+ @ LabelMap
+ $dIsMap_a18BT
+ @ (Block CmmNode C C)
+ @ (Block CmmNode C C)
+ (mapBlock3' @ CmmNode @ CmmNode @ C @ C funs_a18jP))
+ (toBlockMap g_a18jR))
+ }
+
+-- RHS size: {terms: 13, types: 16, coercions: 0, joins: 0/1}
+foldlGraphBlocks
+ :: forall a. (a -> CmmBlock -> a) -> a -> CmmGraph -> a
+[LclIdX]
+foldlGraphBlocks
+ = \ (@ a_a18C5) ->
+ let {
+ $dIsMap_a18Cb :: IsMap LabelMap
+ [LclId]
+ $dIsMap_a18Cb = $dIsMap_a18yG } in
+ \ (k_a18jT :: a_a18C5 -> CmmBlock -> a_a18C5)
+ (z_a18jU :: a_a18C5)
+ (g_a18jV :: CmmGraph) ->
+ $ @ 'ghc-prim-0.6.1:GHC.Types.LiftedRep
+ @ (LabelMap CmmBlock)
+ @ a_a18C5
+ (mapFoldl
+ @ LabelMap $dIsMap_a18Cb @ a_a18C5 @ CmmBlock k_a18jT z_a18jU)
+ (toBlockMap g_a18jV)
+
+-- RHS size: {terms: 7, types: 4, coercions: 0, joins: 0/0}
+revPostorder :: CmmGraph -> [CmmBlock]
+[LclIdX]
+revPostorder
+ = \ (g_a18jW :: CmmGraph) ->
+ revPostorderFrom
+ @ (Block CmmNode)
+ $dNonLocal_a18Cj
+ (toBlockMap g_a18jW)
+ (g_entry @ CmmNode g_a18jW)
+
+-- RHS size: {terms: 10, types: 19, coercions: 0, joins: 0/0}
+modifyGraph
+ :: forall (n :: Extensibility -> Extensibility -> *)
+ (n' :: Extensibility -> Extensibility -> *).
+ (Graph n C C -> Graph n' C C) -> GenCmmGraph n -> GenCmmGraph n'
+[LclIdX]
+modifyGraph
+ = \ (@ (n_a18Cl :: Extensibility -> Extensibility -> *))
+ (@ (n'_a18Cm :: Extensibility -> Extensibility -> *))
+ (f_a18jm :: Graph n_a18Cl C C -> Graph n'_a18Cm C C)
+ (g_a18jn :: GenCmmGraph n_a18Cl) ->
+ GHC.Cmm.CmmGraph
+ @ n'_a18Cm
+ (g_entry @ n_a18Cl g_a18jn)
+ (f_a18jm (g_graph @ n_a18Cl g_a18jn))
+
+-- RHS size: {terms: 6, types: 18, coercions: 0, joins: 0/0}
+mapGraphNodes1
+ :: (forall (e :: Extensibility) (x :: Extensibility).
+ CmmNode e x -> CmmNode e x)
+ -> CmmGraph -> CmmGraph
+[LclIdX]
+mapGraphNodes1
+ = \ (f_a18jS
+ :: forall (e :: Extensibility) (x :: Extensibility).
+ CmmNode e x -> CmmNode e x) ->
+ modifyGraph
+ @ CmmNode
+ @ CmmNode
+ (mapGraph
+ @ CmmNode
+ @ CmmNode
+ @ C
+ @ C
+ (\ (@ (e1_a18CE :: Extensibility))
+ (@ (x1_a18CF :: Extensibility)) ->
+ f_a18jS @ e1_a18CE @ x1_a18CF))
+
+-- RHS size: {terms: 42, types: 23, coercions: 0, joins: 0/5}
+mkLiveness :: Platform -> [LocalReg] -> Liveness
+[LclIdX]
+mkLiveness
+ = \ (ds_d18N1 :: Platform) (ds_d18N2 :: [LocalReg]) ->
+ let {
+ platform_a18jf :: Platform
+ [LclId]
+ platform_a18jf = ds_d18N1 } in
+ case ds_d18N2 of wild_00 {
+ [] -> ghc-prim-0.6.1:GHC.Types.[] @ Bool;
+ : reg_a18jg regs_a18jh ->
+ letrec {
+ is_non_ptr_a18jl :: Bool
+ [LclId]
+ is_non_ptr_a18jl
+ = $ @ 'ghc-prim-0.6.1:GHC.Types.LiftedRep
+ @ Bool
+ @ Bool
+ not
+ (isGcPtrType (localRegType reg_a18jg)); } in
+ letrec {
+ word_size_a18ji :: Int
+ [LclId]
+ word_size_a18ji = platformWordSizeInBytes platform_a18jf; } in
+ letrec {
+ sizeW_a18jj :: Int
+ [LclId]
+ sizeW_a18jj
+ = quot
+ @ Int
+ $dIntegral_a18D0
+ (- @ Int
+ $dNum_a18D2
+ (+ @ Int
+ $dNum_a18D4
+ (widthInBytes (typeWidth (localRegType reg_a18jg)))
+ word_size_a18ji)
+ (ghc-prim-0.6.1:GHC.Types.I# 1#))
+ word_size_a18ji; } in
+ letrec {
+ bits_a18jk :: [Bool]
+ [LclId]
+ bits_a18jk = replicate @ Bool sizeW_a18jj is_non_ptr_a18jl; } in
+ ++ @ Bool bits_a18jk (mkLiveness platform_a18jf regs_a18jh)
+ }
+
+-- RHS size: {terms: 55, types: 25, coercions: 0, joins: 0/5}
+regsOverlap :: Platform -> CmmReg -> CmmReg -> Bool
+[LclIdX]
+regsOverlap
+ = \ (platform_a18iY :: Platform)
+ (ds_d18Nd :: CmmReg)
+ (ds_d18Ne :: CmmReg) ->
+ let {
+ reg_a18j3 :: CmmReg
+ [LclId]
+ reg_a18j3 = ds_d18Nd } in
+ let {
+ fail_d18OD :: ghc-prim-0.6.1:GHC.Prim.Void# -> Bool
+ [LclId]
+ fail_d18OD
+ = \ (ds_d18OE [OS=OneShot] :: ghc-prim-0.6.1:GHC.Prim.Void#) ->
+ let {
+ reg'_a18j4 :: CmmReg
+ [LclId]
+ reg'_a18j4 = ds_d18Ne } in
+ == @ CmmReg $dEq_a18Dq reg_a18j3 reg'_a18j4 } in
+ case ds_d18Nd of wild_00 {
+ __DEFAULT -> fail_d18OD ghc-prim-0.6.1:GHC.Prim.void#;
+ CmmGlobal g_a18iZ ->
+ case ds_d18Ne of wild_00 {
+ __DEFAULT -> fail_d18OD ghc-prim-0.6.1:GHC.Prim.void#;
+ CmmGlobal g'_a18j0 ->
+ let {
+ ds_d18Nj :: Maybe GHC.Platform.Reg.RealReg
+ [LclId]
+ ds_d18Nj = globalRegMaybe platform_a18iY g_a18iZ } in
+ case ds_d18Nj of wild_00 {
+ __DEFAULT -> fail_d18OD ghc-prim-0.6.1:GHC.Prim.void#;
+ Just real_a18j1 ->
+ let {
+ ds_d18Nn :: Maybe GHC.Platform.Reg.RealReg
+ [LclId]
+ ds_d18Nn = globalRegMaybe platform_a18iY g'_a18j0 } in
+ case ds_d18Nn of wild_00 {
+ __DEFAULT -> fail_d18OD ghc-prim-0.6.1:GHC.Prim.void#;
+ Just real'_a18j2 ->
+ case ==
+ @ GHC.Platform.Reg.RealReg $dEq_a18Do real_a18j1 real'_a18j2
+ of wild_00 {
+ False -> fail_d18OD ghc-prim-0.6.1:GHC.Prim.void#;
+ True -> ghc-prim-0.6.1:GHC.Types.True
+ }
+ }
+ }
+ }
+ }
+
+-- RHS size: {terms: 43, types: 26, coercions: 0, joins: 0/6}
+regUsedIn :: Platform -> CmmReg -> CmmExpr -> Bool
+[LclIdX]
+regUsedIn
+ = \ (platform_a18j5 :: Platform) ->
+ letrec {
+ regUsedIn__a18j6 :: CmmReg -> CmmExpr -> Bool
+ [LclId]
+ regUsedIn__a18j6
+ = \ (ds_d18OF :: CmmReg) (ds_d18OG :: CmmExpr) ->
+ let {
+ reg_a18j7 :: CmmReg
+ [LclId]
+ reg_a18j7 = ds_d18OF } in
+ let {
+ reg_a18j9 :: CmmReg
+ [LclId]
+ reg_a18j9 = ds_d18OF } in
+ let {
+ reg_a18jb :: CmmReg
+ [LclId]
+ reg_a18jb = ds_d18OF } in
+ let {
+ reg_a18jd :: CmmReg
+ [LclId]
+ reg_a18jd = ds_d18OF } in
+ case ds_d18OG of wild_00 {
+ CmmLit ds_d18R2 -> ghc-prim-0.6.1:GHC.Types.False;
+ CmmLoad e_a18j8 ds_d18R3 -> regUsedIn__a18j6 reg_a18j7 e_a18j8;
+ CmmReg reg'_a18ja ->
+ regsOverlap platform_a18j5 reg_a18j9 reg'_a18ja;
+ CmmMachOp ds_d18R5 es_a18je ->
+ any
+ @ []
+ @ CmmExpr
+ $dFoldable_a18DN
+ (let {
+ ds_d18OV :: CmmReg
+ [LclId]
+ ds_d18OV = reg_a18jd } in
+ \ (ds_d18OW :: CmmExpr) -> regUsedIn__a18j6 ds_d18OV ds_d18OW)
+ es_a18je;
+ CmmStackSlot ds_d18R6 ds_d18R7 -> ghc-prim-0.6.1:GHC.Types.False;
+ CmmRegOff reg'_a18jc ds_d18R4 ->
+ regsOverlap platform_a18j5 reg_a18jb reg'_a18jc
+ }; } in
+ regUsedIn__a18j6
+
+-- RHS size: {terms: 12, types: 3, coercions: 0, joins: 0/0}
+tAG_MASK :: Platform -> Int
+[LclIdX]
+tAG_MASK
+ = \ (platform_a18iM :: Platform) ->
+ - @ Int
+ $dNum_a18DQ
+ (shiftL
+ @ Int
+ $dBits_a18DS
+ (ghc-prim-0.6.1:GHC.Types.I# 1#)
+ (pc_TAG_BITS (platformConstants platform_a18iM)))
+ (ghc-prim-0.6.1:GHC.Types.I# 1#)
+
+-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
+mAX_PTR_TAG :: Platform -> Int
+[LclIdX]
+mAX_PTR_TAG = tAG_MASK
+
+-- RHS size: {terms: 12, types: 8, coercions: 0, joins: 0/1}
+isComparisonExpr :: CmmExpr -> Bool
+[LclIdX]
+isComparisonExpr
+ = \ (ds_d18R8 :: CmmExpr) ->
+ let {
+ fail_d18Rj :: ghc-prim-0.6.1:GHC.Prim.Void# -> Bool
+ [LclId]
+ fail_d18Rj
+ = \ (ds_d18Rk [OS=OneShot] :: ghc-prim-0.6.1:GHC.Prim.Void#) ->
+ ghc-prim-0.6.1:GHC.Types.False } in
+ case ds_d18R8 of wild_00 {
+ __DEFAULT -> fail_d18Rj ghc-prim-0.6.1:GHC.Prim.void#;
+ CmmMachOp op_a18iL ds_d18Ri -> isComparisonMachOp op_a18iL
+ }
+
+-- RHS size: {terms: 11, types: 6, coercions: 0, joins: 0/1}
+isLit :: CmmExpr -> Bool
+[LclIdX]
+isLit
+ = \ (ds_d18Rl :: CmmExpr) ->
+ let {
+ fail_d18RX :: ghc-prim-0.6.1:GHC.Prim.Void# -> Bool
+ [LclId]
+ fail_d18RX
+ = \ (ds_d18RY [OS=OneShot] :: ghc-prim-0.6.1:GHC.Prim.Void#) ->
+ ghc-prim-0.6.1:GHC.Types.False } in
+ case ds_d18Rl of wild_00 {
+ __DEFAULT -> fail_d18RX ghc-prim-0.6.1:GHC.Prim.void#;
+ CmmLit ds_d18RW -> ghc-prim-0.6.1:GHC.Types.True
+ }
+
+-- RHS size: {terms: 35, types: 20, coercions: 0, joins: 0/1}
+hasNoGlobalRegs :: CmmExpr -> Bool
+[LclIdX]
+hasNoGlobalRegs
+ = \ (ds_d18RZ :: CmmExpr) ->
+ let {
+ fail_d18UX :: ghc-prim-0.6.1:GHC.Prim.Void# -> Bool
+ [LclId]
+ fail_d18UX
+ = \ (ds_d18UY [OS=OneShot] :: ghc-prim-0.6.1:GHC.Prim.Void#) ->
+ ghc-prim-0.6.1:GHC.Types.False } in
+ case ds_d18RZ of wild_00 {
+ __DEFAULT -> fail_d18UX ghc-prim-0.6.1:GHC.Prim.void#;
+ CmmLit ds_d18UR -> ghc-prim-0.6.1:GHC.Types.True;
+ CmmLoad e_a18iJ ds_d18UP -> hasNoGlobalRegs e_a18iJ;
+ CmmReg ds_d18US ->
+ case ds_d18US of wild_00 {
+ __DEFAULT -> fail_d18UX ghc-prim-0.6.1:GHC.Prim.void#;
+ CmmLocal ds_d18UT -> ghc-prim-0.6.1:GHC.Types.True
+ };
+ CmmMachOp ds_d18UQ es_a18iK ->
+ all @ [] @ CmmExpr $dFoldable_a18E7 hasNoGlobalRegs es_a18iK;
+ CmmRegOff ds_d18UU ds_d18UV ->
+ case ds_d18UU of wild_00 {
+ __DEFAULT -> fail_d18UX ghc-prim-0.6.1:GHC.Prim.void#;
+ CmmLocal ds_d18UW -> ghc-prim-0.6.1:GHC.Types.True
+ }
+ }
+
+-- RHS size: {terms: 17, types: 14, coercions: 0, joins: 0/0}
+isTrivialCmmExpr :: CmmExpr -> Bool
+[LclIdX]
+isTrivialCmmExpr
+ = \ (ds_d18UZ :: CmmExpr) ->
+ case ds_d18UZ of wild_00 {
+ CmmLit ds_d18X7 -> ghc-prim-0.6.1:GHC.Types.True;
+ CmmLoad ds_d18X3 ds_d18X4 -> ghc-prim-0.6.1:GHC.Types.False;
+ CmmReg ds_d18X8 -> ghc-prim-0.6.1:GHC.Types.True;
+ CmmMachOp ds_d18X5 ds_d18X6 -> ghc-prim-0.6.1:GHC.Types.False;
+ CmmStackSlot ds_d18Xb ds_d18Xc ->
+ panic
+ @ Bool
+ (ghc-prim-0.6.1:GHC.CString.unpackCString#
+ "isTrivialCmmExpr CmmStackSlot"#);
+ CmmRegOff ds_d18X9 ds_d18Xa -> ghc-prim-0.6.1:GHC.Types.True
+ }
+
+-- RHS size: {terms: 21, types: 10, coercions: 0, joins: 0/2}
+cmmMkAssign
+ :: Platform -> CmmExpr -> Unique -> (CmmNode O O, CmmExpr)
+[LclIdX]
+cmmMkAssign
+ = \ (platform_a18iE :: Platform)
+ (expr_a18iF :: CmmExpr)
+ (uq_a18iG :: Unique) ->
+ letrec {
+ ty_a18iH :: CmmType
+ [LclId]
+ ty_a18iH = cmmExprType platform_a18iE expr_a18iF; } in
+ case ty_a18iH of ty_a18iH { __DEFAULT ->
+ letrec {
+ reg_a18iI :: CmmReg
+ [LclId]
+ reg_a18iI
+ = GHC.Cmm.Expr.$WCmmLocal
+ (GHC.Cmm.Expr.$WLocalReg uq_a18iG ty_a18iH); } in
+ (GHC.Cmm.Node.$WCmmAssign reg_a18iI expr_a18iF,
+ GHC.Cmm.Expr.$WCmmReg reg_a18iI)
+ }
+
+-- RHS size: {terms: 32, types: 16, coercions: 0, joins: 0/3}
+cmmToWord :: Platform -> CmmExpr -> CmmExpr
+[LclIdX]
+cmmToWord
+ = \ (platform_a18iA :: Platform) (e_a18iB :: CmmExpr) ->
+ letrec {
+ word_a18iD :: Width
+ [LclId]
+ word_a18iD = wordWidth platform_a18iA; } in
+ letrec {
+ w_a18iC :: Width
+ [LclId]
+ w_a18iC = cmmExprWidth platform_a18iA e_a18iB; } in
+ let {
+ fail_d18Xm :: ghc-prim-0.6.1:GHC.Prim.Void# -> CmmExpr
+ [LclId]
+ fail_d18Xm
+ = \ (ds_d18Xn [OS=OneShot] :: ghc-prim-0.6.1:GHC.Prim.Void#) ->
+ GHC.Cmm.Expr.CmmMachOp
+ (GHC.Cmm.MachOp.MO_UU_Conv w_a18iC word_a18iD)
+ (GHC.Base.build
+ @ CmmExpr
+ (\ (@ a_d18Xd)
+ (c_d18Xe :: CmmExpr -> a_d18Xd -> a_d18Xd)
+ (n_d18Xf :: a_d18Xd) ->
+ c_d18Xe e_a18iB n_d18Xf)) } in
+ case == @ Width $dEq_a18Ev w_a18iC word_a18iD of wild_00 {
+ False -> fail_d18Xm ghc-prim-0.6.1:GHC.Prim.void#;
+ True -> e_a18iB
+ }
+
+-- RHS size: {terms: 36, types: 19, coercions: 0, joins: 0/2}
+cmmNegate :: Platform -> CmmExpr -> CmmExpr
+[LclIdX]
+cmmNegate
+ = \ (platform_a18iw :: Platform) (ds_d18Xo :: CmmExpr) ->
+ let {
+ e_a18iz :: CmmExpr
+ [LclId]
+ e_a18iz = ds_d18Xo } in
+ let {
+ fail_d18Ye :: ghc-prim-0.6.1:GHC.Prim.Void# -> CmmExpr
+ [LclId]
+ fail_d18Ye
+ = \ (ds_d18Yf [OS=OneShot] :: ghc-prim-0.6.1:GHC.Prim.Void#) ->
+ GHC.Cmm.Expr.CmmMachOp
+ (GHC.Cmm.MachOp.MO_S_Neg (cmmExprWidth platform_a18iw e_a18iz))
+ (GHC.Base.build
+ @ CmmExpr
+ (\ (@ a_d18Xu)
+ (c_d18Xv :: CmmExpr -> a_d18Xu -> a_d18Xu)
+ (n_d18Xw :: a_d18Xu) ->
+ c_d18Xv e_a18iz n_d18Xw)) } in
+ case ds_d18Xo of wild_00 {
+ __DEFAULT -> fail_d18Ye ghc-prim-0.6.1:GHC.Prim.void#;
+ CmmLit ds_d18Yd ->
+ case ds_d18Yd of wild_00 {
+ __DEFAULT -> fail_d18Ye ghc-prim-0.6.1:GHC.Prim.void#;
+ CmmInt n_a18ix rep_a18iy ->
+ GHC.Cmm.Expr.CmmLit
+ (GHC.Cmm.Expr.$WCmmInt
+ (negate @ Integer $dNum_a18ED n_a18ix) rep_a18iy)
+ }
+ }
+
+-- RHS size: {terms: 15, types: 10, coercions: 0, joins: 0/0}
+cmmQuotWord :: Platform -> CmmExpr -> CmmExpr -> CmmExpr
+[LclIdX]
+cmmQuotWord
+ = \ (platform_a18it :: Platform)
+ (e1_a18iu :: CmmExpr)
+ (e2_a18iv :: CmmExpr) ->
+ GHC.Cmm.Expr.CmmMachOp
+ (mo_wordUQuot platform_a18it)
+ (GHC.Base.build
+ @ CmmExpr
+ (\ (@ a_d18Yg)
+ (c_d18Yh :: CmmExpr -> a_d18Yg -> a_d18Yg)
+ (n_d18Yi :: a_d18Yg) ->
+ c_d18Yh e1_a18iu (c_d18Yh e2_a18iv n_d18Yi)))
+
+-- RHS size: {terms: 15, types: 10, coercions: 0, joins: 0/0}
+cmmMulWord :: Platform -> CmmExpr -> CmmExpr -> CmmExpr
+[LclIdX]
+cmmMulWord
+ = \ (platform_a18iq :: Platform)
+ (e1_a18ir :: CmmExpr)
+ (e2_a18is :: CmmExpr) ->
+ GHC.Cmm.Expr.CmmMachOp
+ (mo_wordMul platform_a18iq)
+ (GHC.Base.build
+ @ CmmExpr
+ (\ (@ a_d18Yj)
+ (c_d18Yk :: CmmExpr -> a_d18Yj -> a_d18Yj)
+ (n_d18Yl :: a_d18Yj) ->
+ c_d18Yk e1_a18ir (c_d18Yk e2_a18is n_d18Yl)))
+
+-- RHS size: {terms: 15, types: 10, coercions: 0, joins: 0/0}
+cmmSubWord :: Platform -> CmmExpr -> CmmExpr -> CmmExpr
+[LclIdX]
+cmmSubWord
+ = \ (platform_a18in :: Platform)
+ (e1_a18io :: CmmExpr)
+ (e2_a18ip :: CmmExpr) ->
+ GHC.Cmm.Expr.CmmMachOp
+ (mo_wordSub platform_a18in)
+ (GHC.Base.build
+ @ CmmExpr
+ (\ (@ a_d18Ym)
+ (c_d18Yn :: CmmExpr -> a_d18Ym -> a_d18Ym)
+ (n_d18Yo :: a_d18Ym) ->
+ c_d18Yn e1_a18io (c_d18Yn e2_a18ip n_d18Yo)))
+
+-- RHS size: {terms: 15, types: 10, coercions: 0, joins: 0/0}
+cmmAddWord :: Platform -> CmmExpr -> CmmExpr -> CmmExpr
+[LclIdX]
+cmmAddWord
+ = \ (platform_a18ik :: Platform)
+ (e1_a18il :: CmmExpr)
+ (e2_a18im :: CmmExpr) ->
+ GHC.Cmm.Expr.CmmMachOp
+ (mo_wordAdd platform_a18ik)
+ (GHC.Base.build
+ @ CmmExpr
+ (\ (@ a_d18Yp)
+ (c_d18Yq :: CmmExpr -> a_d18Yp -> a_d18Yp)
+ (n_d18Yr :: a_d18Yp) ->
+ c_d18Yq e1_a18il (c_d18Yq e2_a18im n_d18Yr)))
+
+-- RHS size: {terms: 15, types: 10, coercions: 0, joins: 0/0}
+cmmUShrWord :: Platform -> CmmExpr -> CmmExpr -> CmmExpr
+[LclIdX]
+cmmUShrWord
+ = \ (platform_a18ih :: Platform)
+ (e1_a18ii :: CmmExpr)
+ (e2_a18ij :: CmmExpr) ->
+ GHC.Cmm.Expr.CmmMachOp
+ (mo_wordUShr platform_a18ih)
+ (GHC.Base.build
+ @ CmmExpr
+ (\ (@ a_d18Ys)
+ (c_d18Yt :: CmmExpr -> a_d18Ys -> a_d18Ys)
+ (n_d18Yu :: a_d18Ys) ->
+ c_d18Yt e1_a18ii (c_d18Yt e2_a18ij n_d18Yu)))
+
+-- RHS size: {terms: 15, types: 10, coercions: 0, joins: 0/0}
+cmmSLtWord :: Platform -> CmmExpr -> CmmExpr -> CmmExpr
+[LclIdX]
+cmmSLtWord
+ = \ (platform_a18ie :: Platform)
+ (e1_a18if :: CmmExpr)
+ (e2_a18ig :: CmmExpr) ->
+ GHC.Cmm.Expr.CmmMachOp
+ (mo_wordSLt platform_a18ie)
+ (GHC.Base.build
+ @ CmmExpr
+ (\ (@ a_d18Yv)
+ (c_d18Yw :: CmmExpr -> a_d18Yv -> a_d18Yv)
+ (n_d18Yx :: a_d18Yv) ->
+ c_d18Yw e1_a18if (c_d18Yw e2_a18ig n_d18Yx)))
+
+-- RHS size: {terms: 15, types: 10, coercions: 0, joins: 0/0}
+cmmUGtWord :: Platform -> CmmExpr -> CmmExpr -> CmmExpr
+[LclIdX]
+cmmUGtWord
+ = \ (platform_a18ib :: Platform)
+ (e1_a18ic :: CmmExpr)
+ (e2_a18id :: CmmExpr) ->
+ GHC.Cmm.Expr.CmmMachOp
+ (mo_wordUGt platform_a18ib)
+ (GHC.Base.build
+ @ CmmExpr
+ (\ (@ a_d18Yy)
+ (c_d18Yz :: CmmExpr -> a_d18Yy -> a_d18Yy)
+ (n_d18YA :: a_d18Yy) ->
+ c_d18Yz e1_a18ic (c_d18Yz e2_a18id n_d18YA)))
+
+-- RHS size: {terms: 15, types: 10, coercions: 0, joins: 0/0}
+cmmUGeWord :: Platform -> CmmExpr -> CmmExpr -> CmmExpr
+[LclIdX]
+cmmUGeWord
+ = \ (platform_a18i8 :: Platform)
+ (e1_a18i9 :: CmmExpr)
+ (e2_a18ia :: CmmExpr) ->
+ GHC.Cmm.Expr.CmmMachOp
+ (mo_wordUGe platform_a18i8)
+ (GHC.Base.build
+ @ CmmExpr
+ (\ (@ a_d18YB)
+ (c_d18YC :: CmmExpr -> a_d18YB -> a_d18YB)
+ (n_d18YD :: a_d18YB) ->
+ c_d18YC e1_a18i9 (c_d18YC e2_a18ia n_d18YD)))
+
+-- RHS size: {terms: 15, types: 10, coercions: 0, joins: 0/0}
+cmmULtWord :: Platform -> CmmExpr -> CmmExpr -> CmmExpr
+[LclIdX]
+cmmULtWord
+ = \ (platform_a18i5 :: Platform)
+ (e1_a18i6 :: CmmExpr)
+ (e2_a18i7 :: CmmExpr) ->
+ GHC.Cmm.Expr.CmmMachOp
+ (mo_wordULt platform_a18i5)
+ (GHC.Base.build
+ @ CmmExpr
+ (\ (@ a_d18YE)
+ (c_d18YF :: CmmExpr -> a_d18YE -> a_d18YE)
+ (n_d18YG :: a_d18YE) ->
+ c_d18YF e1_a18i6 (c_d18YF e2_a18i7 n_d18YG)))
+
+-- RHS size: {terms: 15, types: 10, coercions: 0, joins: 0/0}
+cmmEqWord :: Platform -> CmmExpr -> CmmExpr -> CmmExpr
+[LclIdX]
+cmmEqWord
+ = \ (platform_a18i2 :: Platform)
+ (e1_a18i3 :: CmmExpr)
+ (e2_a18i4 :: CmmExpr) ->
+ GHC.Cmm.Expr.CmmMachOp
+ (mo_wordEq platform_a18i2)
+ (GHC.Base.build
+ @ CmmExpr
+ (\ (@ a_d18YH)
+ (c_d18YI :: CmmExpr -> a_d18YH -> a_d18YH)
+ (n_d18YJ :: a_d18YH) ->
+ c_d18YI e1_a18i3 (c_d18YI e2_a18i4 n_d18YJ)))
+
+-- RHS size: {terms: 15, types: 10, coercions: 0, joins: 0/0}
+cmmNeWord :: Platform -> CmmExpr -> CmmExpr -> CmmExpr
+[LclIdX]
+cmmNeWord
+ = \ (platform_a18hZ :: Platform)
+ (e1_a18i0 :: CmmExpr)
+ (e2_a18i1 :: CmmExpr) ->
+ GHC.Cmm.Expr.CmmMachOp
+ (mo_wordNe platform_a18hZ)
+ (GHC.Base.build
+ @ CmmExpr
+ (\ (@ a_d18YK)
+ (c_d18YL :: CmmExpr -> a_d18YK -> a_d18YK)
+ (n_d18YM :: a_d18YK) ->
+ c_d18YL e1_a18i0 (c_d18YL e2_a18i1 n_d18YM)))
+
+-- RHS size: {terms: 15, types: 10, coercions: 0, joins: 0/0}
+cmmAndWord :: Platform -> CmmExpr -> CmmExpr -> CmmExpr
+[LclIdX]
+cmmAndWord
+ = \ (platform_a18hW :: Platform)
+ (e1_a18hX :: CmmExpr)
+ (e2_a18hY :: CmmExpr) ->
+ GHC.Cmm.Expr.CmmMachOp
+ (mo_wordAnd platform_a18hW)
+ (GHC.Base.build
+ @ CmmExpr
+ (\ (@ a_d18YN)
+ (c_d18YO :: CmmExpr -> a_d18YN -> a_d18YN)
+ (n_d18YP :: a_d18YN) ->
+ c_d18YO e1_a18hX (c_d18YO e2_a18hY n_d18YP)))
+
+-- RHS size: {terms: 15, types: 10, coercions: 0, joins: 0/0}
+cmmOrWord :: Platform -> CmmExpr -> CmmExpr -> CmmExpr
+[LclIdX]
+cmmOrWord
+ = \ (platform_a18hT :: Platform)
+ (e1_a18hU :: CmmExpr)
+ (e2_a18hV :: CmmExpr) ->
+ GHC.Cmm.Expr.CmmMachOp
+ (mo_wordOr platform_a18hT)
+ (GHC.Base.build
+ @ CmmExpr
+ (\ (@ a_d18YQ)
+ (c_d18YR :: CmmExpr -> a_d18YQ -> a_d18YQ)
+ (n_d18YS :: a_d18YQ) ->
+ c_d18YR e1_a18hU (c_d18YR e2_a18hV n_d18YS)))
+
+-- RHS size: {terms: 22, types: 10, coercions: 0, joins: 0/3}
+cmmLabelOff :: CLabel -> Int -> CmmLit
+[LclIdX]
+cmmLabelOff
+ = \ (lbl_a18hc :: CLabel) (ds_d18YT :: Int) ->
+ let {
+ lbl_a18hd :: CLabel
+ [LclId]
+ lbl_a18hd = lbl_a18hc } in
+ let {
+ byte_off_a18he :: Int
+ [LclId]
+ byte_off_a18he = ds_d18YT } in
+ let {
+ fail_d18Z1 :: ghc-prim-0.6.1:GHC.Prim.Void# -> CmmLit
+ [LclId]
+ fail_d18Z1
+ = \ (ds_d18Z2 [OS=OneShot] :: ghc-prim-0.6.1:GHC.Prim.Void#) ->
+ GHC.Cmm.Expr.CmmLabelOff lbl_a18hd byte_off_a18he } in
+ case ds_d18YT of wild_00 { ghc-prim-0.6.1:GHC.Types.I# ds_d18Z0 ->
+ case ds_d18Z0 of ds_d18Z0 {
+ __DEFAULT -> fail_d18Z1 ghc-prim-0.6.1:GHC.Prim.void#;
+ 0# -> GHC.Cmm.Expr.CmmLabel lbl_a18hc
+ }
+ }
+
+-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
+cmmLabelOffB :: CLabel -> ByteOff -> CmmLit
+[LclIdX]
+cmmLabelOffB = cmmLabelOff
+
+-- RHS size: {terms: 9, types: 4, coercions: 0, joins: 0/0}
+cmmLabelOffW :: Platform -> CLabel -> WordOff -> CmmLit
+[LclIdX]
+cmmLabelOffW
+ = \ (platform_a18hM :: Platform)
+ (lbl_a18hN :: CLabel)
+ (wd_off_a18hO :: WordOff) ->
+ cmmLabelOffB
+ lbl_a18hN
+ (wordsToBytes @ WordOff $dNum_a18F4 platform_a18hM wd_off_a18hO)
+
+-- RHS size: {terms: 54, types: 26, coercions: 0, joins: 0/5}
+cmmOffsetLit :: CmmLit -> Int -> CmmLit
+[LclIdX]
+cmmOffsetLit
+ = \ (ds_d18Z3 :: CmmLit) (byte_off_a18gZ :: Int) ->
+ let {
+ fail_d18ZV :: ghc-prim-0.6.1:GHC.Prim.Void# -> CmmLit
+ [LclId]
+ fail_d18ZV
+ = \ (ds_d18ZW [OS=OneShot] :: ghc-prim-0.6.1:GHC.Prim.Void#) ->
+ let {
+ byte_off_a18hb :: Int
+ [LclId]
+ byte_off_a18hb = byte_off_a18gZ } in
+ pprPanic
+ @ CmmLit
+ $dIP_a18Fh
+ (ghc-prim-0.6.1:GHC.CString.unpackCString# "cmmOffsetLit"#)
+ (ppr @ Int $dOutputable_a18Fj byte_off_a18hb) } in
+ case ds_d18Z3 of wild_00 {
+ __DEFAULT -> fail_d18ZV ghc-prim-0.6.1:GHC.Prim.void#;
+ CmmInt m_a18h8 rep_a18h9 ->
+ let {
+ byte_off_a18ha :: Int
+ [LclId]
+ byte_off_a18ha = byte_off_a18gZ } in
+ GHC.Cmm.Expr.$WCmmInt
+ (+ @ Integer
+ $dNum_a18Fb
+ m_a18h8
+ (fromIntegral
+ @ Int @ Integer $dIntegral_a18Fe $dNum_a18Ff byte_off_a18ha))
+ rep_a18h9;
+ CmmLabel l_a18gY -> cmmLabelOff l_a18gY byte_off_a18gZ;
+ CmmLabelOff l_a18h0 m_a18h1 ->
+ let {
+ byte_off_a18h2 :: Int
+ [LclId]
+ byte_off_a18h2 = byte_off_a18gZ } in
+ cmmLabelOff l_a18h0 (+ @ Int $dNum_a18F7 m_a18h1 byte_off_a18h2);
+ CmmLabelDiffOff l1_a18h3 l2_a18h4 m_a18h5 w_a18h6 ->
+ let {
+ byte_off_a18h7 :: Int
+ [LclId]
+ byte_off_a18h7 = byte_off_a18gZ } in
+ GHC.Cmm.Expr.CmmLabelDiffOff
+ l1_a18h3
+ l2_a18h4
+ (+ @ Int $dNum_a18F9 m_a18h5 byte_off_a18h7)
+ w_a18h6
+ }
+
+-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
+cmmOffsetLitB :: CmmLit -> ByteOff -> CmmLit
+[LclIdX]
+cmmOffsetLitB = cmmOffsetLit
+
+-- RHS size: {terms: 9, types: 4, coercions: 0, joins: 0/0}
+cmmOffsetLitW :: Platform -> CmmLit -> WordOff -> CmmLit
+[LclIdX]
+cmmOffsetLitW
+ = \ (platform_a18hJ :: Platform)
+ (lit_a18hK :: CmmLit)
+ (wd_off_a18hL :: WordOff) ->
+ cmmOffsetLitB
+ lit_a18hK
+ (wordsToBytes @ WordOff $dNum_a18Fn platform_a18hJ wd_off_a18hL)
+
+-- RHS size: {terms: 22, types: 10, coercions: 0, joins: 0/3}
+cmmRegOff :: CmmReg -> Int -> CmmExpr
+[LclIdX]
+cmmRegOff
+ = \ (reg_a18gV :: CmmReg) (ds_d18ZX :: Int) ->
+ let {
+ reg_a18gW :: CmmReg
+ [LclId]
+ reg_a18gW = reg_a18gV } in
+ let {
+ byte_off_a18gX :: Int
+ [LclId]
+ byte_off_a18gX = ds_d18ZX } in
+ let {
+ fail_d1905 :: ghc-prim-0.6.1:GHC.Prim.Void# -> CmmExpr
+ [LclId]
+ fail_d1905
+ = \ (ds_d1906 [OS=OneShot] :: ghc-prim-0.6.1:GHC.Prim.Void#) ->
+ GHC.Cmm.Expr.$WCmmRegOff reg_a18gW byte_off_a18gX } in
+ case ds_d18ZX of wild_00 { ghc-prim-0.6.1:GHC.Types.I# ds_d1904 ->
+ case ds_d1904 of ds_d1904 {
+ __DEFAULT -> fail_d1905 ghc-prim-0.6.1:GHC.Prim.void#;
+ 0# -> GHC.Cmm.Expr.$WCmmReg reg_a18gV
+ }
+ }
+
+-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
+cmmRegOffB :: CmmReg -> ByteOff -> CmmExpr
+[LclIdX]
+cmmRegOffB = cmmRegOff
+
+-- RHS size: {terms: 9, types: 4, coercions: 0, joins: 0/0}
+cmmRegOffW :: Platform -> CmmReg -> WordOff -> CmmExpr
+[LclIdX]
+cmmRegOffW
+ = \ (platform_a18hG :: Platform)
+ (reg_a18hH :: CmmReg)
+ (wd_off_a18hI :: WordOff) ->
+ cmmRegOffB
+ reg_a18hH
+ (wordsToBytes @ WordOff $dNum_a18FA platform_a18hG wd_off_a18hI)
+
+-- RHS size: {terms: 131, types: 65, coercions: 0, joins: 0/7}
+cmmOffset :: Platform -> CmmExpr -> Int -> CmmExpr
+[LclIdX]
+cmmOffset
+ = \ (_platform_a18gF :: Platform)
+ (e_a18gG :: CmmExpr)
+ (ds_d1907 :: Int) ->
+ let {
+ platform_a18gH :: Platform
+ [LclId]
+ platform_a18gH = _platform_a18gF } in
+ let {
+ e_a18gI :: CmmExpr
+ [LclId]
+ e_a18gI = e_a18gG } in
+ let {
+ byte_off_a18gJ :: Int
+ [LclId]
+ byte_off_a18gJ = ds_d1907 } in
+ let {
+ fail_d1949 :: ghc-prim-0.6.1:GHC.Prim.Void# -> CmmExpr
+ [LclId]
+ fail_d1949
+ = \ (ds_d194a [OS=OneShot] :: ghc-prim-0.6.1:GHC.Prim.Void#) ->
+ let {
+ ds_d190a :: CmmExpr
+ [LclId]
+ ds_d190a = e_a18gI } in
+ let {
+ fail_d1942 :: ghc-prim-0.6.1:GHC.Prim.Void# -> CmmExpr
+ [LclId]
+ fail_d1942
+ = \ (ds_d1943 [OS=OneShot] :: ghc-prim-0.6.1:GHC.Prim.Void#) ->
+ letrec {
+ width_a18gU :: Width
+ [LclId]
+ width_a18gU = cmmExprWidth platform_a18gH e_a18gI; } in
+ GHC.Cmm.Expr.CmmMachOp
+ (GHC.Cmm.MachOp.MO_Add width_a18gU)
+ (GHC.Base.build
+ @ CmmExpr
+ (\ (@ a_d190G)
+ (c_d190H :: CmmExpr -> a_d190G -> a_d190G)
+ (n_d190I :: a_d190G) ->
+ c_d190H
+ e_a18gI
+ (c_d190H
+ (GHC.Cmm.Expr.CmmLit
+ (GHC.Cmm.Expr.$WCmmInt
+ (toInteger @ Int $dIntegral_a18FZ byte_off_a18gJ)
+ width_a18gU))
+ n_d190I))) } in
+ case ds_d190a of wild_00 {
+ __DEFAULT -> fail_d1942 ghc-prim-0.6.1:GHC.Prim.void#;
+ CmmLit lit_a18gN ->
+ GHC.Cmm.Expr.CmmLit (cmmOffsetLit lit_a18gN byte_off_a18gJ);
+ CmmReg reg_a18gK -> cmmRegOff reg_a18gK byte_off_a18gJ;
+ CmmMachOp ds_d193W ds_d193X ->
+ case ds_d193W of wild_00 {
+ __DEFAULT -> fail_d1942 ghc-prim-0.6.1:GHC.Prim.void#;
+ MO_Add rep_a18gQ ->
+ case ds_d193X of wild_00 {
+ __DEFAULT -> fail_d1942 ghc-prim-0.6.1:GHC.Prim.void#;
+ : expr_a18gR ds_d193Y ->
+ case ds_d193Y of wild_00 {
+ __DEFAULT -> fail_d1942 ghc-prim-0.6.1:GHC.Prim.void#;
+ : ds_d193Z ds_d1940 ->
+ case ds_d193Z of wild_00 {
+ __DEFAULT -> fail_d1942 ghc-prim-0.6.1:GHC.Prim.void#;
+ CmmLit ds_d1941 ->
+ case ds_d1941 of wild_00 {
+ __DEFAULT -> fail_d1942 ghc-prim-0.6.1:GHC.Prim.void#;
+ CmmInt byte_off1_a18gS _rep_a18gT ->
+ case ds_d1940 of wild_00 {
+ __DEFAULT -> fail_d1942 ghc-prim-0.6.1:GHC.Prim.void#;
+ [] ->
+ GHC.Cmm.Expr.CmmMachOp
+ (GHC.Cmm.MachOp.MO_Add rep_a18gQ)
+ (GHC.Base.build
+ @ CmmExpr
+ (\ (@ a_d190D)
+ (c_d190E :: CmmExpr -> a_d190D -> a_d190D)
+ (n_d190F :: a_d190D) ->
+ c_d190E
+ expr_a18gR
+ (c_d190E
+ (GHC.Cmm.Expr.CmmLit
+ (GHC.Cmm.Expr.$WCmmInt
+ (+ @ Integer
+ $dNum_a18FR
+ byte_off1_a18gS
+ (toInteger
+ @ Int
+ $dIntegral_a18FT
+ byte_off_a18gJ))
+ rep_a18gQ))
+ n_d190F)))
+ }
+ }
+ }
+ }
+ }
+ };
+ CmmStackSlot area_a18gO off_a18gP ->
+ GHC.Cmm.Expr.$WCmmStackSlot
+ area_a18gO (- @ Int $dNum_a18FP off_a18gP byte_off_a18gJ);
+ CmmRegOff reg_a18gL m_a18gM ->
+ cmmRegOff reg_a18gL (+ @ Int $dNum_a18FN m_a18gM byte_off_a18gJ)
+ } } in
+ case ds_d1907 of wild_00 { ghc-prim-0.6.1:GHC.Types.I# ds_d1948 ->
+ case ds_d1948 of ds_d1948 {
+ __DEFAULT -> fail_d1949 ghc-prim-0.6.1:GHC.Prim.void#;
+ 0# -> e_a18gG
+ }
+ }
+
+-- RHS size: {terms: 12, types: 5, coercions: 0, joins: 0/0}
+cmmIndex :: Platform -> Width -> CmmExpr -> Int -> CmmExpr
+[LclIdX]
+cmmIndex
+ = \ (platform_a18hf :: Platform)
+ (width_a18hg :: Width)
+ (base_a18hh :: CmmExpr)
+ (idx_a18hi :: Int) ->
+ cmmOffset
+ platform_a18hf
+ base_a18hh
+ (* @ Int $dNum_a18G2 idx_a18hi (widthInBytes width_a18hg))
+
+-- RHS size: {terms: 12, types: 4, coercions: 0, joins: 0/0}
+cmmLoadIndex :: Platform -> CmmType -> CmmExpr -> Int -> CmmExpr
+[LclIdX]
+cmmLoadIndex
+ = \ (platform_a18ht :: Platform)
+ (ty_a18hu :: CmmType)
+ (expr_a18hv :: CmmExpr)
+ (ix_a18hw :: Int) ->
+ GHC.Cmm.Expr.$WCmmLoad
+ (cmmIndex platform_a18ht (typeWidth ty_a18hu) expr_a18hv ix_a18hw)
+ ty_a18hu
+
+-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
+cmmOffsetB :: Platform -> CmmExpr -> ByteOff -> CmmExpr
+[LclIdX]
+cmmOffsetB = cmmOffset
+
+-- RHS size: {terms: 10, types: 4, coercions: 0, joins: 0/0}
+cmmOffsetW :: Platform -> CmmExpr -> WordOff -> CmmExpr
+[LclIdX]
+cmmOffsetW
+ = \ (platform_a18hD :: Platform)
+ (e_a18hE :: CmmExpr)
+ (n_a18hF :: WordOff) ->
+ cmmOffsetB
+ platform_a18hD
+ e_a18hE
+ (wordsToBytes @ WordOff $dNum_a18G7 platform_a18hD n_a18hF)
+
+-- RHS size: {terms: 10, types: 4, coercions: 0, joins: 0/0}
+cmmLoadIndexW :: Platform -> CmmExpr -> Int -> CmmType -> CmmExpr
+[LclIdX]
+cmmLoadIndexW
+ = \ (platform_a18hP :: Platform)
+ (base_a18hQ :: CmmExpr)
+ (off_a18hR :: Int)
+ (ty_a18hS :: CmmType) ->
+ GHC.Cmm.Expr.$WCmmLoad
+ (cmmOffsetW platform_a18hP base_a18hQ off_a18hR) ty_a18hS
+
+-- RHS size: {terms: 43, types: 22, coercions: 0, joins: 0/4}
+cmmOffsetExpr :: Platform -> CmmExpr -> CmmExpr -> CmmExpr
+[LclIdX]
+cmmOffsetExpr
+ = \ (platform_a18gz :: Platform)
+ (e_a18gA :: CmmExpr)
+ (ds_d194b :: CmmExpr) ->
+ let {
+ platform_a18gC :: Platform
+ [LclId]
+ platform_a18gC = platform_a18gz } in
+ let {
+ e_a18gD :: CmmExpr
+ [LclId]
+ e_a18gD = e_a18gA } in
+ let {
+ byte_off_a18gE :: CmmExpr
+ [LclId]
+ byte_off_a18gE = ds_d194b } in
+ let {
+ fail_d1954 :: ghc-prim-0.6.1:GHC.Prim.Void# -> CmmExpr
+ [LclId]
+ fail_d1954
+ = \ (ds_d1955 [OS=OneShot] :: ghc-prim-0.6.1:GHC.Prim.Void#) ->
+ GHC.Cmm.Expr.CmmMachOp
+ (GHC.Cmm.MachOp.MO_Add (cmmExprWidth platform_a18gC e_a18gD))
+ (GHC.Base.build
+ @ CmmExpr
+ (\ (@ a_d194i)
+ (c_d194j :: CmmExpr -> a_d194i -> a_d194i)
+ (n_d194k :: a_d194i) ->
+ c_d194j e_a18gD (c_d194j byte_off_a18gE n_d194k))) } in
+ case ds_d194b of wild_00 {
+ __DEFAULT -> fail_d1954 ghc-prim-0.6.1:GHC.Prim.void#;
+ CmmLit ds_d1952 ->
+ case ds_d1952 of wild_00 {
+ __DEFAULT -> fail_d1954 ghc-prim-0.6.1:GHC.Prim.void#;
+ CmmInt n_a18gB ds_d1953 ->
+ cmmOffset
+ platform_a18gz e_a18gA (fromInteger @ Int $dNum_a18Gb n_a18gB)
+ }
+ }
+
+-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
+cmmOffsetExprB :: Platform -> CmmExpr -> CmmExpr -> CmmExpr
+[LclIdX]
+cmmOffsetExprB = cmmOffsetExpr
+
+-- RHS size: {terms: 4, types: 1, coercions: 0, joins: 0/0}
+mkLblExpr :: CLabel -> CmmExpr
+[LclIdX]
+mkLblExpr
+ = \ (lbl_a18gy :: CLabel) ->
+ GHC.Cmm.Expr.CmmLit (GHC.Cmm.Expr.CmmLabel lbl_a18gy)
+
+-- RHS size: {terms: 7, types: 2, coercions: 0, joins: 0/0}
+mkStgWordCLit :: Platform -> StgWord -> CmmLit
+[LclIdX]
+mkStgWordCLit
+ = \ (platform_a18gr :: Platform) (wd_a18gs :: StgWord) ->
+ GHC.Cmm.Expr.$WCmmInt
+ (fromStgWord wd_a18gs) (wordWidth platform_a18gr)
+
+-- RHS size: {terms: 14, types: 21, coercions: 0, joins: 0/0}
+mkDataLits
+ :: forall (raw :: Bool) info stmt.
+ Section
+ -> CLabel -> [CmmLit] -> GenCmmDecl (GenCmmStatics raw) info stmt
+[LclIdX]
+mkDataLits
+ = \ (@ (raw_a18Gf :: Bool))
+ (@ info_a18Gg)
+ (@ stmt_a18Gh)
+ (section_a18gk :: Section)
+ (lbl_a18gl :: CLabel)
+ (lits_a18gm :: [CmmLit]) ->
+ GHC.Cmm.CmmData
+ @ (GenCmmStatics raw_a18Gf)
+ @ info_a18Gg
+ @ stmt_a18Gh
+ section_a18gk
+ ($ @ 'ghc-prim-0.6.1:GHC.Types.LiftedRep
+ @ [CmmStatic]
+ @ (GenCmmStatics raw_a18Gf)
+ (GHC.Cmm.CmmStaticsRaw @ raw_a18Gf lbl_a18gl)
+ (map @ CmmLit @ CmmStatic GHC.Cmm.CmmStaticLit lits_a18gm))
+
+-- RHS size: {terms: 45, types: 32, coercions: 0, joins: 0/6}
+mkRODataLits
+ :: forall (raw :: Bool) info stmt.
+ CLabel -> [CmmLit] -> GenCmmDecl (GenCmmStatics raw) info stmt
+[LclIdX]
+mkRODataLits
+ = \ (@ (raw_a18Gz :: Bool)) (@ info_a18GA) (@ stmt_a18GB) ->
+ let {
+ $dFoldable_a18GU :: Foldable []
+ [LclId]
+ $dFoldable_a18GU = $dFoldable_a18yM } in
+ \ (lbl_a18gn :: CLabel) (lits_a18go :: [CmmLit]) ->
+ letrec {
+ needsRelocation_a18gq :: CmmLit -> Bool
+ [LclId]
+ needsRelocation_a18gq
+ = letrec {
+ needsRelocation_a18GL :: CmmLit -> Bool
+ [LclId]
+ needsRelocation_a18GL
+ = \ (ds_d195e :: CmmLit) ->
+ let {
+ fail_d195U :: ghc-prim-0.6.1:GHC.Prim.Void# -> Bool
+ [LclId]
+ fail_d195U
+ = \ (ds_d195V [OS=OneShot] :: ghc-prim-0.6.1:GHC.Prim.Void#) ->
+ ghc-prim-0.6.1:GHC.Types.False } in
+ case ds_d195e of wild_00 {
+ __DEFAULT -> fail_d195U ghc-prim-0.6.1:GHC.Prim.void#;
+ CmmLabel ds_d195R -> ghc-prim-0.6.1:GHC.Types.True;
+ CmmLabelOff ds_d195S ds_d195T -> ghc-prim-0.6.1:GHC.Types.True
+ }; } in
+ needsRelocation_a18GL; } in
+ letrec {
+ section_a18gp :: Section
+ [LclId]
+ section_a18gp
+ = let {
+ fail_d195c :: ghc-prim-0.6.1:GHC.Prim.Void# -> Section
+ [LclId]
+ fail_d195c
+ = \ (ds_d195d [OS=OneShot] :: ghc-prim-0.6.1:GHC.Prim.Void#) ->
+ GHC.Cmm.Section GHC.Cmm.ReadOnlyData lbl_a18gn } in
+ case any
+ @ [] @ CmmLit $dFoldable_a18GU needsRelocation_a18gq lits_a18go
+ of wild_00 {
+ False -> fail_d195c ghc-prim-0.6.1:GHC.Prim.void#;
+ True -> GHC.Cmm.Section GHC.Cmm.RelocatableReadOnlyData lbl_a18gn
+ }; } in
+ mkDataLits
+ @ raw_a18Gz
+ @ info_a18GA
+ @ stmt_a18GB
+ section_a18gp
+ lbl_a18gn
+ lits_a18go
+
+-- RHS size: {terms: 22, types: 25, coercions: 0, joins: 0/0}
+mkFileEmbedLit
+ :: forall (raw :: Bool) info stmt.
+ CLabel
+ -> FilePath -> (CmmLit, GenCmmDecl (GenCmmStatics raw) info stmt)
+[LclIdX]
+mkFileEmbedLit
+ = \ (@ (raw_a18H8 :: Bool))
+ (@ info_a18H9)
+ (@ stmt_a18Ha)
+ (lbl_a18gi :: CLabel)
+ (path_a18gj :: FilePath) ->
+ (GHC.Cmm.Expr.CmmLabel lbl_a18gi,
+ GHC.Cmm.CmmData
+ @ (GenCmmStatics raw_a18H8)
+ @ info_a18H9
+ @ stmt_a18Ha
+ (GHC.Cmm.Section GHC.Cmm.ReadOnlyData lbl_a18gi)
+ (GHC.Cmm.CmmStaticsRaw
+ @ raw_a18H8
+ lbl_a18gi
+ (GHC.Base.build
+ @ CmmStatic
+ (\ (@ a_d195W)
+ (c_d195X :: CmmStatic -> a_d195W -> a_d195W)
+ (n_d195Y :: a_d195W) ->
+ c_d195X (GHC.Cmm.CmmFileEmbed path_a18gj) n_d195Y))))
+
+-- RHS size: {terms: 36, types: 38, coercions: 0, joins: 0/2}
+mkByteStringCLit
+ :: forall (raw :: Bool) info stmt.
+ CLabel
+ -> ByteString -> (CmmLit, GenCmmDecl (GenCmmStatics raw) info stmt)
+[LclIdX]
+mkByteStringCLit
+ = \ (@ (raw_a18Hg :: Bool)) (@ info_a18Hh) (@ stmt_a18Hi) ->
+ let {
+ $dNum_a18Hp :: Num GHC.Word.Word8
+ [LclId]
+ $dNum_a18Hp = GHC.Word.$fNumWord8 } in
+ \ (lbl_a18gf :: CLabel) (bytes_a18gg :: ByteString) ->
+ letrec {
+ sec_a18gh :: SectionType
+ [LclId]
+ sec_a18gh
+ = case BS.elem
+ (fromInteger @ GHC.Word.Word8 $dNum_a18Hp 0) bytes_a18gg
+ of wild_00 {
+ False -> GHC.Cmm.CString;
+ True -> GHC.Cmm.ReadOnlyData
+ }; } in
+ (GHC.Cmm.Expr.CmmLabel lbl_a18gf,
+ $ @ 'ghc-prim-0.6.1:GHC.Types.LiftedRep
+ @ (GenCmmStatics raw_a18Hg)
+ @ (GenCmmDecl (GenCmmStatics raw_a18Hg) info_a18Hh stmt_a18Hi)
+ (GHC.Cmm.CmmData
+ @ (GenCmmStatics raw_a18Hg)
+ @ info_a18Hh
+ @ stmt_a18Hi
+ (GHC.Cmm.Section sec_a18gh lbl_a18gf))
+ (GHC.Cmm.CmmStaticsRaw
+ @ raw_a18Hg
+ lbl_a18gf
+ (GHC.Base.build
+ @ CmmStatic
+ (\ (@ a_d195Z)
+ (c_d1960 :: CmmStatic -> a_d195Z -> a_d195Z)
+ (n_d1961 :: a_d195Z) ->
+ c_d1960 (GHC.Cmm.CmmString bytes_a18gg) n_d1961))))
+
+-- RHS size: {terms: 6, types: 2, coercions: 0, joins: 0/0}
+mkWordCLit :: Platform -> Integer -> CmmLit
+[LclIdX]
+mkWordCLit
+ = \ (platform_a18gd :: Platform) (wd_a18ge :: Integer) ->
+ GHC.Cmm.Expr.$WCmmInt wd_a18ge (wordWidth platform_a18gd)
+
+-- RHS size: {terms: 36, types: 11, coercions: 0, joins: 0/3}
+packHalfWordsCLit
+ :: Platform -> StgHalfWord -> StgHalfWord -> CmmLit
+[LclIdX]
+packHalfWordsCLit
+ = \ (platform_a18gt :: Platform)
+ (lower_half_word_a18gu :: StgHalfWord)
+ (upper_half_word_a18gv :: StgHalfWord) ->
+ letrec {
+ u_a18gx :: Integer
+ [LclId]
+ u_a18gx = fromStgHalfWord upper_half_word_a18gv; } in
+ letrec {
+ l_a18gw :: Integer
+ [LclId]
+ l_a18gw = fromStgHalfWord lower_half_word_a18gu; } in
+ let {
+ ds_d1962 :: ByteOrder
+ [LclId]
+ ds_d1962 = platformByteOrder platform_a18gt } in
+ case ds_d1962 of wild_00 {
+ BigEndian ->
+ mkWordCLit
+ platform_a18gt
+ (.|.
+ @ Integer
+ $dBits_a18HN
+ (shiftL
+ @ Integer $dBits_a18HP l_a18gw (halfWordSizeInBits platform_a18gt))
+ u_a18gx);
+ LittleEndian ->
+ mkWordCLit
+ platform_a18gt
+ (.|.
+ @ Integer
+ $dBits_a18HR
+ l_a18gw
+ (shiftL
+ @ Integer
+ $dBits_a18HT
+ u_a18gx
+ (halfWordSizeInBits platform_a18gt)))
+ }
+
+-- RHS size: {terms: 5, types: 1, coercions: 0, joins: 0/0}
+zeroCLit :: Platform -> CmmLit
+[LclIdX]
+zeroCLit
+ = \ (platform_a18gb :: Platform) ->
+ GHC.Cmm.Expr.$WCmmInt 0 (wordWidth platform_a18gb)
+
+-- RHS size: {terms: 4, types: 1, coercions: 0, joins: 0/0}
+zeroExpr :: Platform -> CmmExpr
+[LclIdX]
+zeroExpr
+ = \ (platform_a18gc :: Platform) ->
+ GHC.Cmm.Expr.CmmLit (zeroCLit platform_a18gc)
+
+-- RHS size: {terms: 8, types: 3, coercions: 0, joins: 0/0}
+mkIntCLit :: Platform -> Int -> CmmLit
+[LclIdX]
+mkIntCLit
+ = \ (platform_a18g7 :: Platform) (i_a18g8 :: Int) ->
+ GHC.Cmm.Expr.$WCmmInt
+ (toInteger @ Int $dIntegral_a18HY i_a18g8)
+ (wordWidth platform_a18g7)
+
+-- RHS size: {terms: 7, types: 5, coercions: 0, joins: 0/0}
+mkIntExpr :: Platform -> Int -> CmmExpr
+[LclIdX]
+mkIntExpr
+ = \ (platform_a18g9 :: Platform) (i_a18ga :: Int) ->
+ $!
+ @ 'ghc-prim-0.6.1:GHC.Types.LiftedRep
+ @ CmmLit
+ @ CmmExpr
+ GHC.Cmm.Expr.CmmLit
+ (mkIntCLit platform_a18g9 i_a18ga)
+
+-- RHS size: {terms: 57, types: 26, coercions: 0, joins: 0/7}
+cmmIndexExpr :: Platform -> Width -> CmmExpr -> CmmExpr -> CmmExpr
+[LclIdX]
+cmmIndexExpr
+ = \ (platform_a18hj :: Platform)
+ (width_a18hk :: Width)
+ (base_a18hl :: CmmExpr)
+ (ds_d196e :: CmmExpr) ->
+ let {
+ platform_a18hn :: Platform
+ [LclId]
+ platform_a18hn = platform_a18hj } in
+ let {
+ width_a18ho :: Width
+ [LclId]
+ width_a18ho = width_a18hk } in
+ let {
+ base_a18hp :: CmmExpr
+ [LclId]
+ base_a18hp = base_a18hl } in
+ let {
+ idx_a18hq :: CmmExpr
+ [LclId]
+ idx_a18hq = ds_d196e } in
+ let {
+ fail_d1977 :: ghc-prim-0.6.1:GHC.Prim.Void# -> CmmExpr
+ [LclId]
+ fail_d1977
+ = \ (ds_d1978 [OS=OneShot] :: ghc-prim-0.6.1:GHC.Prim.Void#) ->
+ letrec {
+ idx_w_a18hr :: Width
+ [LclId]
+ idx_w_a18hr = cmmExprWidth platform_a18hn idx_a18hq; } in
+ letrec {
+ byte_off_a18hs :: CmmExpr
+ [LclId]
+ byte_off_a18hs
+ = GHC.Cmm.Expr.CmmMachOp
+ (GHC.Cmm.MachOp.MO_Shl idx_w_a18hr)
+ (GHC.Base.build
+ @ CmmExpr
+ (\ (@ a_d1974)
+ (c_d1975 :: CmmExpr -> a_d1974 -> a_d1974)
+ (n_d1976 :: a_d1974) ->
+ c_d1975
+ idx_a18hq
+ (c_d1975
+ (mkIntExpr platform_a18hn (widthInLog width_a18ho))
+ n_d1976))); } in
+ cmmOffsetExpr platform_a18hn base_a18hp byte_off_a18hs } in
+ case ds_d196e of wild_00 {
+ __DEFAULT -> fail_d1977 ghc-prim-0.6.1:GHC.Prim.void#;
+ CmmLit ds_d1972 ->
+ case ds_d1972 of wild_00 {
+ __DEFAULT -> fail_d1977 ghc-prim-0.6.1:GHC.Prim.void#;
+ CmmInt n_a18hm ds_d1973 ->
+ cmmIndex
+ platform_a18hj
+ width_a18hk
+ base_a18hl
+ (fromInteger @ Int $dNum_a18I5 n_a18hm)
+ }
+ }
+
+-- RHS size: {terms: 35, types: 15, coercions: 0, joins: 0/4}
+cmmOffsetExprW :: Platform -> CmmExpr -> CmmExpr -> CmmExpr
+[LclIdX]
+cmmOffsetExprW
+ = \ (platform_a18hx :: Platform)
+ (e_a18hy :: CmmExpr)
+ (ds_d1979 :: CmmExpr) ->
+ let {
+ platform_a18hA :: Platform
+ [LclId]
+ platform_a18hA = platform_a18hx } in
+ let {
+ e_a18hB :: CmmExpr
+ [LclId]
+ e_a18hB = e_a18hy } in
+ let {
+ wd_off_a18hC :: CmmExpr
+ [LclId]
+ wd_off_a18hC = ds_d1979 } in
+ let {
+ fail_d197Z :: ghc-prim-0.6.1:GHC.Prim.Void# -> CmmExpr
+ [LclId]
+ fail_d197Z
+ = \ (ds_d1980 [OS=OneShot] :: ghc-prim-0.6.1:GHC.Prim.Void#) ->
+ cmmIndexExpr
+ platform_a18hA (wordWidth platform_a18hA) e_a18hB wd_off_a18hC } in
+ case ds_d1979 of wild_00 {
+ __DEFAULT -> fail_d197Z ghc-prim-0.6.1:GHC.Prim.void#;
+ CmmLit ds_d197X ->
+ case ds_d197X of wild_00 {
+ __DEFAULT -> fail_d197Z ghc-prim-0.6.1:GHC.Prim.void#;
+ CmmInt n_a18hz ds_d197Y ->
+ cmmOffsetW
+ platform_a18hx e_a18hy (fromInteger @ WordOff $dNum_a18Ig n_a18hz)
+ }
+ }
+
+-- RHS size: {terms: 5, types: 1, coercions: 0, joins: 0/0}
+cmmTagMask :: Platform -> CmmExpr
+[LclIdX]
+cmmTagMask
+ = \ (platform_a18iN :: Platform) ->
+ mkIntExpr platform_a18iN (tAG_MASK platform_a18iN)
+
+-- RHS size: {terms: 11, types: 2, coercions: 0, joins: 0/0}
+cmmIsTagged :: Platform -> CmmExpr -> CmmExpr
+[LclIdX]
+cmmIsTagged
+ = \ (platform_a18iS :: Platform) (e_a18iT :: CmmExpr) ->
+ cmmNeWord
+ platform_a18iS
+ (cmmAndWord platform_a18iS e_a18iT (cmmTagMask platform_a18iS))
+ (zeroExpr platform_a18iS)
+
+-- RHS size: {terms: 11, types: 2, coercions: 0, joins: 0/0}
+cmmIsNotTagged :: Platform -> CmmExpr -> CmmExpr
+[LclIdX]
+cmmIsNotTagged
+ = \ (platform_a18iU :: Platform) (e_a18iV :: CmmExpr) ->
+ cmmEqWord
+ platform_a18iU
+ (cmmAndWord platform_a18iU e_a18iV (cmmTagMask platform_a18iU))
+ (zeroExpr platform_a18iU)
+
+-- RHS size: {terms: 7, types: 2, coercions: 0, joins: 0/0}
+cmmConstrTag1 :: Platform -> CmmExpr -> CmmExpr
+[LclIdX]
+cmmConstrTag1
+ = \ (platform_a18iW :: Platform) (e_a18iX :: CmmExpr) ->
+ cmmAndWord platform_a18iW e_a18iX (cmmTagMask platform_a18iW)
+
+-- RHS size: {terms: 7, types: 2, coercions: 0, joins: 0/0}
+cmmPointerMask :: Platform -> CmmExpr
+[LclIdX]
+cmmPointerMask
+ = \ (platform_a18iO :: Platform) ->
+ mkIntExpr
+ platform_a18iO
+ (complement @ Int $dBits_a18In (tAG_MASK platform_a18iO))
+
+-- RHS size: {terms: 26, types: 11, coercions: 0, joins: 0/3}
+cmmUntag :: Platform -> CmmExpr -> CmmExpr
+[LclIdX]
+cmmUntag
+ = \ (ds_d1981 :: Platform) (e_a18iP :: CmmExpr) ->
+ let {
+ platform_a18iQ :: Platform
+ [LclId]
+ platform_a18iQ = ds_d1981 } in
+ let {
+ e_a18iR :: CmmExpr
+ [LclId]
+ e_a18iR = e_a18iP } in
+ let {
+ fail_d198Y :: ghc-prim-0.6.1:GHC.Prim.Void# -> CmmExpr
+ [LclId]
+ fail_d198Y
+ = \ (ds_d198Z [OS=OneShot] :: ghc-prim-0.6.1:GHC.Prim.Void#) ->
+ cmmAndWord
+ platform_a18iQ e_a18iR (cmmPointerMask platform_a18iQ) } in
+ case e_a18iP of wild_00 {
+ __DEFAULT -> fail_d198Y ghc-prim-0.6.1:GHC.Prim.void#;
+ CmmLit ds_d198W ->
+ case ds_d198W of wild_00 {
+ __DEFAULT -> fail_d198Y ghc-prim-0.6.1:GHC.Prim.void#;
+ CmmLabel ds_d198X -> e_a18iP
+ }
+ }
+
+-- RHS size: {terms: 13, types: 2, coercions: 0, joins: 0/0}
+slotForeignHint :: SlotTy -> ForeignHint
+[LclIdX]
+slotForeignHint
+ = \ (ds_d1990 :: SlotTy) ->
+ case ds_d1990 of wild_00 {
+ PtrSlot -> GHC.Cmm.Type.AddrHint;
+ WordSlot -> GHC.Cmm.Type.NoHint;
+ Word64Slot -> GHC.Cmm.Type.NoHint;
+ FloatSlot -> GHC.Cmm.Type.NoHint;
+ DoubleSlot -> GHC.Cmm.Type.NoHint
+ }
+
+-- RHS size: {terms: 39, types: 5, coercions: 0, joins: 0/0}
+primRepForeignHint :: PrimRep -> ForeignHint
+[LclIdX]
+primRepForeignHint
+ = \ (ds_d199f :: PrimRep) ->
+ case ds_d199f of wild_00 {
+ VoidRep ->
+ panic
+ @ ForeignHint
+ (ghc-prim-0.6.1:GHC.CString.unpackCString#
+ "primRepForeignHint:VoidRep"#);
+ LiftedRep -> GHC.Cmm.Type.AddrHint;
+ UnliftedRep -> GHC.Cmm.Type.AddrHint;
+ Int8Rep -> GHC.Cmm.Type.SignedHint;
+ Int16Rep -> GHC.Cmm.Type.SignedHint;
+ Int32Rep -> GHC.Cmm.Type.SignedHint;
+ Int64Rep -> GHC.Cmm.Type.SignedHint;
+ IntRep -> GHC.Cmm.Type.SignedHint;
+ Word8Rep -> GHC.Cmm.Type.NoHint;
+ Word16Rep -> GHC.Cmm.Type.NoHint;
+ Word32Rep -> GHC.Cmm.Type.NoHint;
+ Word64Rep -> GHC.Cmm.Type.NoHint;
+ WordRep -> GHC.Cmm.Type.NoHint;
+ AddrRep -> GHC.Cmm.Type.AddrHint;
+ FloatRep -> GHC.Cmm.Type.NoHint;
+ DoubleRep -> GHC.Cmm.Type.NoHint;
+ VecRep ds_d199Y ds_d199Z -> GHC.Cmm.Type.NoHint
+ }
+
+-- RHS size: {terms: 4, types: 3, coercions: 0, joins: 0/0}
+typeForeignHint :: UnaryType -> ForeignHint
+[LclIdX]
+typeForeignHint
+ = . @ PrimRep
+ @ ForeignHint
+ @ UnaryType
+ primRepForeignHint
+ (typePrimRep1 $d(%%)_a18Iw)
+
+-- RHS size: {terms: 23, types: 2, coercions: 0, joins: 0/0}
+primElemRepCmmType :: PrimElemRep -> CmmType
+[LclIdX]
+primElemRepCmmType
+ = \ (ds_d19a0 :: PrimElemRep) ->
+ case ds_d19a0 of wild_00 {
+ Int8ElemRep -> b8;
+ Int16ElemRep -> b16;
+ Int32ElemRep -> b32;
+ Int64ElemRep -> b64;
+ Word8ElemRep -> b8;
+ Word16ElemRep -> b16;
+ Word32ElemRep -> b32;
+ Word64ElemRep -> b64;
+ FloatElemRep -> f32;
+ DoubleElemRep -> f64
+ }
+
+-- RHS size: {terms: 16, types: 3, coercions: 0, joins: 0/0}
+slotCmmType :: Platform -> SlotTy -> CmmType
+[LclIdX]
+slotCmmType
+ = \ (platform_a18g4 :: Platform) (ds_d19ap :: SlotTy) ->
+ case ds_d19ap of wild_00 {
+ PtrSlot -> gcWord platform_a18g4;
+ WordSlot -> bWord platform_a18g4;
+ Word64Slot -> b64;
+ FloatSlot -> f32;
+ DoubleSlot -> f64
+ }
+
+-- RHS size: {terms: 48, types: 6, coercions: 0, joins: 0/0}
+primRepCmmType :: Platform -> PrimRep -> CmmType
+[LclIdX]
+primRepCmmType
+ = \ (platform_a18g1 :: Platform) (ds_d19aE :: PrimRep) ->
+ case ds_d19aE of wild_00 {
+ VoidRep ->
+ panic
+ @ CmmType
+ (ghc-prim-0.6.1:GHC.CString.unpackCString#
+ "primRepCmmType:VoidRep"#);
+ LiftedRep -> gcWord platform_a18g1;
+ UnliftedRep -> gcWord platform_a18g1;
+ Int8Rep -> b8;
+ Int16Rep -> b16;
+ Int32Rep -> b32;
+ Int64Rep -> b64;
+ IntRep -> bWord platform_a18g1;
+ Word8Rep -> b8;
+ Word16Rep -> b16;
+ Word32Rep -> b32;
+ Word64Rep -> b64;
+ WordRep -> bWord platform_a18g1;
+ AddrRep -> bWord platform_a18g1;
+ FloatRep -> f32;
+ DoubleRep -> f64;
+ VecRep len_a18g2 rep_a18g3 ->
+ vec len_a18g2 (primElemRepCmmType rep_a18g3)
+ }
+
+-- RHS size: {terms: 7, types: 2, coercions: 0, joins: 0/0}
+typeCmmType :: Platform -> UnaryType -> CmmType
+[LclIdX]
+typeCmmType
+ = \ (platform_a18g5 :: Platform) (ty_a18g6 :: UnaryType) ->
+ primRepCmmType platform_a18g5 (typePrimRep1 $d(%%)_a18IC ty_a18g6)
+end Rec }
+
+
+
+==================== Desugar (before optimization) ====================
+2020-11-24 12:44:28.4384398 UTC
+
+Result size of Desugar (before optimization)
+ = {terms: 1,961, types: 1,710, coercions: 43, joins: 0/103}
+
+Rec {
+-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
+$dIsMap_a5hgB :: IsMap LabelMap
+[LclId]
+$dIsMap_a5hgB = $dIsMap_a5hdt
+
+-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
+$dIsMap_a5hgf :: IsMap LabelMap
+[LclId]
+$dIsMap_a5hgf = $dIsMap_a5hdt
+
+-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
+$dIsMap_a5hfG :: IsMap LabelMap
+[LclId]
+$dIsMap_a5hfG = $dIsMap_a5hdt
+
+-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
+$dIsMap_a5hfr :: IsMap LabelMap
+[LclId]
+$dIsMap_a5hfr = $dIsMap_a5hdt
+
+-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
+$dIsMap_a5heZ :: IsMap LabelMap
+[LclId]
+$dIsMap_a5heZ = $dIsMap_a5hdt
+
+-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
+$dIsMap_a5heT :: IsMap LabelMap
+[LclId]
+$dIsMap_a5heT = $dIsMap_a5hdt
+
+-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
+$dIsMap_a5heD :: IsMap LabelMap
+[LclId]
+$dIsMap_a5heD = $dIsMap_a5hdt
+
+-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
+$dIsMap_a5hej :: IsMap LabelMap
+[LclId]
+$dIsMap_a5hej = $dIsMap_a5hdt
+
+-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
+$dIsMap_a5hdt :: IsMap LabelMap
+[LclId]
+$dIsMap_a5hdt = GHC.Cmm.Dataflow.Label.$fIsMapLabelMap
+
+-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
+$dFoldable_a5hiP :: Foldable []
+[LclId]
+$dFoldable_a5hiP = $dFoldable_a5hdz
+
+-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
+$dFoldable_a5hiv :: Foldable []
+[LclId]
+$dFoldable_a5hiv = $dFoldable_a5hdz
+
+-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
+$dFoldable_a5hfR :: Foldable []
+[LclId]
+$dFoldable_a5hfR = $dFoldable_a5hdz
+
+-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
+$dFoldable_a5hdz :: Foldable []
+[LclId]
+$dFoldable_a5hdz = Data.Foldable.$fFoldable[]
+
+-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
+$dNonLocal_a5hh1 :: NonLocal (Block CmmNode)
+[LclId]
+$dNonLocal_a5hh1 = $dNonLocal_a5hdF
+
+-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
+$dNonLocal_a5hg3 :: NonLocal (Block CmmNode)
+[LclId]
+$dNonLocal_a5hg3 = $dNonLocal_a5hdF
+
+-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
+$dNonLocal_a5hfW :: NonLocal (Block CmmNode)
+[LclId]
+$dNonLocal_a5hfW = $dNonLocal_a5hdF
+
+-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
+$dNonLocal_a5heQ :: NonLocal (Block CmmNode)
+[LclId]
+$dNonLocal_a5heQ = $dNonLocal_a5hdF
+
+-- RHS size: {terms: 2, types: 1, coercions: 0, joins: 0/0}
+$dNonLocal_a5hdF :: NonLocal (Block CmmNode)
+[LclId]
+$dNonLocal_a5hdF
+ = GHC.Cmm.Dataflow.Graph.$fNonLocalBlock @ CmmNode $dNonLocal_a5hnq
+
+-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
+$dNonLocal_a5hgp :: NonLocal CmmNode
+[LclId]
+$dNonLocal_a5hgp = $dNonLocal_a5hnq
+
+-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
+$dNonLocal_a5hnq :: NonLocal CmmNode
+[LclId]
+$dNonLocal_a5hnq = GHC.Cmm.Node.$fNonLocalCmmNode
+
+-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
+$d(%%)_a5hn8 :: GHC.Utils.Misc.HasDebugCallStack
+[LclId]
+$d(%%)_a5hn8 = $d(%%)_a5hdG
+
+-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
+$d(%%)_a5hn2 :: GHC.Utils.Misc.HasDebugCallStack
+[LclId]
+$d(%%)_a5hn2 = $d(%%)_a5hdG
+
+-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
+$d(%%)_a5hdG :: GHC.Utils.Misc.HasDebugCallStack
+[LclId]
+$d(%%)_a5hdG = ghc-prim-0.6.1:GHC.Classes.C:(%%)
+
+-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
+$dEq_a5heN :: Eq BlockId
+[LclId]
+$dEq_a5heN = GHC.Cmm.Dataflow.Label.$fEqLabel
+
+-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
+$dIsSet_a5hgj :: IsSet LabelSet
+[LclId]
+$dIsSet_a5hgj = $dIsSet_a5hg8
+
+-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
+$dIsSet_a5hgc :: IsSet LabelSet
+[LclId]
+$dIsSet_a5hgc = $dIsSet_a5hg8
+
+-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
+$dIsSet_a5hg8 :: IsSet LabelSet
+[LclId]
+$dIsSet_a5hg8 = GHC.Cmm.Dataflow.Label.$fIsSetLabelSet
+
+-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
+$dIntegral_a5hmu :: Integral Int
+[LclId]
+$dIntegral_a5hmu = $dIntegral_a5hhI
+
+-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
+$dIntegral_a5hkH :: Integral Int
+[LclId]
+$dIntegral_a5hkH = $dIntegral_a5hhI
+
+-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
+$dIntegral_a5hkB :: Integral Int
+[LclId]
+$dIntegral_a5hkB = $dIntegral_a5hhI
+
+-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
+$dIntegral_a5hjW :: Integral Int
+[LclId]
+$dIntegral_a5hjW = $dIntegral_a5hhI
+
+-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
+$dIntegral_a5hhI :: Integral Int
+[LclId]
+$dIntegral_a5hhI = GHC.Real.$fIntegralInt
+
+-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
+$dNum_a5hmM :: Num WordOff
+[LclId]
+$dNum_a5hmM = $dNum_a5hhK
+
+-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
+$dNum_a5hmB :: Num Int
+[LclId]
+$dNum_a5hmB = $dNum_a5hhK
+
+-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
+$dNum_a5hkT :: Num Int
+[LclId]
+$dNum_a5hkT = $dNum_a5hhK
+
+-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
+$dNum_a5hkP :: Num WordOff
+[LclId]
+$dNum_a5hkP = $dNum_a5hhK
+
+-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
+$dNum_a5hkK :: Num Int
+[LclId]
+$dNum_a5hkK = $dNum_a5hhK
+
+-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
+$dNum_a5hkx :: Num Int
+[LclId]
+$dNum_a5hkx = $dNum_a5hhK
+
+-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
+$dNum_a5hkv :: Num Int
+[LclId]
+$dNum_a5hkv = $dNum_a5hhK
+
+-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
+$dNum_a5hkr :: Num Int
+[LclId]
+$dNum_a5hkr = $dNum_a5hhK
+
+-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
+$dNum_a5hki :: Num WordOff
+[LclId]
+$dNum_a5hki = $dNum_a5hhK
+
+-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
+$dNum_a5hke :: Num Int
+[LclId]
+$dNum_a5hke = $dNum_a5hhK
+
+-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
+$dNum_a5hk5 :: Num WordOff
+[LclId]
+$dNum_a5hk5 = $dNum_a5hhK
+
+-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
+$dNum_a5hjR :: Num Int
+[LclId]
+$dNum_a5hjR = $dNum_a5hhK
+
+-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
+$dNum_a5hjP :: Num Int
+[LclId]
+$dNum_a5hjP = $dNum_a5hhK
+
+-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
+$dNum_a5hjM :: Num WordOff
+[LclId]
+$dNum_a5hjM = $dNum_a5hhK
+
+-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
+$dNum_a5hjH :: Num Int
+[LclId]
+$dNum_a5hjH = $dNum_a5hhK
+
+-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
+$dNum_a5hiI :: Num Int
+[LclId]
+$dNum_a5hiI = $dNum_a5hhK
+
+-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
+$dNum_a5hiE :: Num Int
+[LclId]
+$dNum_a5hiE = $dNum_a5hhK
+
+-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
+$dNum_a5hiy :: Num Int
+[LclId]
+$dNum_a5hiy = $dNum_a5hhK
+
+-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
+$dNum_a5hhQ :: Num Int
+[LclId]
+$dNum_a5hhQ = $dNum_a5hhK
+
+-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
+$dNum_a5hhM :: Num Int
+[LclId]
+$dNum_a5hhM = $dNum_a5hhK
+
+-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
+$dNum_a5hhK :: Num Int
+[LclId]
+$dNum_a5hhK = GHC.Num.$fNumInt
+
+-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
+$dEq_a5hi6 :: Eq GHC.Platform.Reg.RealReg
+[LclId]
+$dEq_a5hi6 = GHC.Platform.Reg.$fEqRealReg
+
+-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
+$dEq_a5hi8 :: Eq CmmReg
+[LclId]
+$dEq_a5hi8 = GHC.Cmm.Expr.$fEqCmmReg
+
+-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
+$dBits_a5hmT :: Bits Int
+[LclId]
+$dBits_a5hmT = $dBits_a5hiA
+
+-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
+$dBits_a5hiA :: Bits Int
+[LclId]
+$dBits_a5hiA = Data.Bits.$fBitsInt
+
+-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
+$dEq_a5hjd :: Eq Width
+[LclId]
+$dEq_a5hjd = GHC.Cmm.Type.$fEqWidth
+
+-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
+$dNum_a5hkz :: Num Integer
+[LclId]
+$dNum_a5hkz = $dNum_a5hjl
+
+-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
+$dNum_a5hjX :: Num Integer
+[LclId]
+$dNum_a5hjX = $dNum_a5hjl
+
+-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
+$dNum_a5hjT :: Num Integer
+[LclId]
+$dNum_a5hjT = $dNum_a5hjl
+
+-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
+$dNum_a5hjl :: Num Integer
+[LclId]
+$dNum_a5hjl = GHC.Num.$fNumInteger
+
+-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
+$dEq_a5hkn :: Eq Int
+[LclId]
+$dEq_a5hkn = $dEq_a5hjD
+
+-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
+$dEq_a5hka :: Eq Int
+[LclId]
+$dEq_a5hka = $dEq_a5hjD
+
+-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
+$dEq_a5hjD :: Eq Int
+[LclId]
+$dEq_a5hjD = ghc-prim-0.6.1:GHC.Classes.$fEqInt
+
+-- RHS size: {terms: 20, types: 3, coercions: 7, joins: 0/0}
+$dIP_a5hjZ :: GHC.Stack.Types.HasCallStack
+[LclId]
+$dIP_a5hjZ
+ = (GHC.Stack.Types.pushCallStack
+ (ghc-prim-0.6.1:GHC.CString.unpackCString# "pprPanic"#,
+ GHC.Stack.Types.SrcLoc
+ (ghc-prim-0.6.1:GHC.CString.unpackCString# "ghc"#)
+ (ghc-prim-0.6.1:GHC.CString.unpackCString# "GHC.Cmm.Utils"#)
+ (ghc-prim-0.6.1:GHC.CString.unpackCString#
+ "E:\\ghc_inferTags\\compiler\\GHC\\Cmm\\Utils.hs"#)
+ (ghc-prim-0.6.1:GHC.Types.I# 284#)
+ (ghc-prim-0.6.1:GHC.Types.I# 43#)
+ (ghc-prim-0.6.1:GHC.Types.I# 284#)
+ (ghc-prim-0.6.1:GHC.Types.I# 81#))
+ ($dIP_a5hnr
+ `cast` (ghc-prim-0.6.1:GHC.Classes.N:IP[0]
+ <"callStack">_N <GHC.Stack.Types.CallStack>_N
+ :: (?callStack::GHC.Stack.Types.CallStack)
+ ~R# GHC.Stack.Types.CallStack)))
+ `cast` (Sym (ghc-prim-0.6.1:GHC.Classes.N:IP[0]
+ <"callStack">_N <GHC.Stack.Types.CallStack>_N)
+ :: GHC.Stack.Types.CallStack
+ ~R# (?callStack::GHC.Stack.Types.CallStack))
+
+-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
+$dOutputable_a5hk1 :: Outputable Int
+[LclId]
+$dOutputable_a5hk1 = GHC.Utils.Outputable.$fOutputableInt
+
+-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
+$dBits_a5hmp :: Bits Integer
+[LclId]
+$dBits_a5hmp = $dBits_a5hmj
+
+-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
+$dBits_a5hmn :: Bits Integer
+[LclId]
+$dBits_a5hmn = $dBits_a5hmj
+
+-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
+$dBits_a5hml :: Bits Integer
+[LclId]
+$dBits_a5hml = $dBits_a5hmj
+
+-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
+$dBits_a5hmj :: Bits Integer
+[LclId]
+$dBits_a5hmj = Data.Bits.$fBitsInteger
+
+-- RHS size: {terms: 1, types: 0, coercions: 4, joins: 0/0}
+$dIP_a5hnr :: GHC.Stack.Types.HasCallStack
+[LclId]
+$dIP_a5hnr
+ = GHC.Stack.Types.emptyCallStack
+ `cast` (Sym (ghc-prim-0.6.1:GHC.Classes.N:IP[0]
+ <"callStack">_N <GHC.Stack.Types.CallStack>_N)
+ :: GHC.Stack.Types.CallStack
+ ~R# (?callStack::GHC.Stack.Types.CallStack))
+
+-- RHS size: {terms: 5, types: 0, coercions: 0, joins: 0/0}
+GHC.Cmm.Utils.$trModule :: ghc-prim-0.6.1:GHC.Types.Module
+[LclIdX]
+GHC.Cmm.Utils.$trModule
+ = ghc-prim-0.6.1:GHC.Types.Module
+ (ghc-prim-0.6.1:GHC.Types.TrNameS "ghc"#)
+ (ghc-prim-0.6.1:GHC.Types.TrNameS "GHC.Cmm.Utils"#)
+
+-- RHS size: {terms: 2, types: 0, coercions: 0, joins: 0/0}
+cccsExpr :: CmmExpr
+[LclIdX]
+cccsExpr = GHC.Cmm.Expr.$WCmmReg cccsReg
+
+-- RHS size: {terms: 2, types: 0, coercions: 0, joins: 0/0}
+currentNurseryExpr :: CmmExpr
+[LclIdX]
+currentNurseryExpr = GHC.Cmm.Expr.$WCmmReg currentNurseryReg
+
+-- RHS size: {terms: 2, types: 0, coercions: 0, joins: 0/0}
+currentTSOExpr :: CmmExpr
+[LclIdX]
+currentTSOExpr = GHC.Cmm.Expr.$WCmmReg currentTSOReg
+
+-- RHS size: {terms: 2, types: 0, coercions: 0, joins: 0/0}
+hpLimExpr :: CmmExpr
+[LclIdX]
+hpLimExpr = GHC.Cmm.Expr.$WCmmReg hpLimReg
+
+-- RHS size: {terms: 2, types: 0, coercions: 0, joins: 0/0}
+hpExpr :: CmmExpr
+[LclIdX]
+hpExpr = GHC.Cmm.Expr.$WCmmReg hpReg
+
+-- RHS size: {terms: 2, types: 0, coercions: 0, joins: 0/0}
+spLimExpr :: CmmExpr
+[LclIdX]
+spLimExpr = GHC.Cmm.Expr.$WCmmReg spLimReg
+
+-- RHS size: {terms: 2, types: 0, coercions: 0, joins: 0/0}
+spExpr :: CmmExpr
+[LclIdX]
+spExpr = GHC.Cmm.Expr.$WCmmReg spReg
+
+-- RHS size: {terms: 2, types: 0, coercions: 0, joins: 0/0}
+baseExpr :: CmmExpr
+[LclIdX]
+baseExpr = GHC.Cmm.Expr.$WCmmReg baseReg
+
+-- RHS size: {terms: 32, types: 69, coercions: 17, joins: 0/4}
+blockTicks :: Block CmmNode C C -> [CmmTickish]
+[LclIdX]
+blockTicks
+ = \ (b_a5gYU :: Block CmmNode C C) ->
+ letrec {
+ goStmt_a5gYV
+ :: forall (e :: Extensibility) (x :: Extensibility).
+ CmmNode e x -> [CmmTickish] -> [CmmTickish]
+ [LclId]
+ goStmt_a5gYV
+ = \ (@ (e_a5hco :: Extensibility))
+ (@ (x_a5hcp :: Extensibility))
+ (ds_d5hnw :: CmmNode e_a5hco x_a5hcp)
+ (ts_a5gYZ :: [CmmTickish]) ->
+ let {
+ _other_a5gZ0 :: CmmNode e_a5hco x_a5hcp
+ [LclId]
+ _other_a5gZ0 = ds_d5hnw } in
+ let {
+ fail_d5hoo :: ghc-prim-0.6.1:GHC.Prim.Void# -> [CmmTickish]
+ [LclId]
+ fail_d5hoo
+ = \ (ds_d5hop [OS=OneShot] :: ghc-prim-0.6.1:GHC.Prim.Void#) ->
+ let {
+ ts_a5gZ1 :: [CmmTickish]
+ [LclId]
+ ts_a5gZ1 = ts_a5gYZ } in
+ ts_a5gZ1 } in
+ case ds_d5hnw of wild_00 {
+ __DEFAULT -> fail_d5hoo ghc-prim-0.6.1:GHC.Prim.void#;
+ CmmTick co_a5hcX co_a5hcY t_a5gYY ->
+ ghc-prim-0.6.1:GHC.Types.: @ CmmTickish t_a5gYY ts_a5gYZ
+ }; } in
+ $ @ 'ghc-prim-0.6.1:GHC.Types.LiftedRep
+ @ [CmmTickish]
+ @ [CmmTickish]
+ (reverse @ CmmTickish)
+ (((\ (ds_d5hnv
+ :: forall (e :: Extensibility) (x :: Extensibility).
+ CmmNode e x -> [CmmTickish] -> [CmmTickish]) ->
+ foldBlockNodesF @ CmmNode @ [CmmTickish] ds_d5hnv @ C @ C)
+ (\ (@ (e_a5hdd :: Extensibility)) (@ (x_a5hde :: Extensibility)) ->
+ goStmt_a5gYV @ e_a5hdd @ x_a5hde)
+ b_a5gYU
+ ((ghc-prim-0.6.1:GHC.Types.[] @ CmmTickish)
+ `cast` (Sub (Sym (GHC.Cmm.Dataflow.Block.D:R:IndexedCOkCloseda_b[0]
+ <*>_N <[CmmTickish]>_N <[CmmTickish]>_N))
+ :: [CmmTickish] ~R# IndexedCO C [CmmTickish] [CmmTickish])))
+ `cast` (Sub (GHC.Cmm.Dataflow.Block.D:R:IndexedCOkCloseda_b[0]
+ <*>_N <[CmmTickish]>_N <[CmmTickish]>_N)
+ :: IndexedCO C [CmmTickish] [CmmTickish] ~R# [CmmTickish]))
+
+-- RHS size: {terms: 4, types: 7, coercions: 0, joins: 0/0}
+bodyToBlockList :: Body CmmNode -> [CmmBlock]
+[LclIdX]
+bodyToBlockList
+ = \ (body_a5gYL :: Body CmmNode) ->
+ mapElems @ LabelMap $dIsMap_a5hdt @ (Block CmmNode C C) body_a5gYL
+
+-- RHS size: {terms: 16, types: 35, coercions: 0, joins: 0/1}
+ofBlockList :: BlockId -> [CmmBlock] -> CmmGraph
+[LclIdX]
+ofBlockList
+ = \ (entry_a5gYI :: BlockId) (blocks_a5gYJ :: [CmmBlock]) ->
+ letrec {
+ body_a5gYK :: LabelMap (Block CmmNode C C)
+ [LclId]
+ body_a5gYK
+ = foldr
+ @ []
+ $dFoldable_a5hdz
+ @ (Block CmmNode C C)
+ @ (LabelMap (Block CmmNode C C))
+ (addBlock @ (Block CmmNode) $dNonLocal_a5hdF $d(%%)_a5hdG)
+ (emptyBody @ Block @ CmmNode)
+ blocks_a5gYJ; } in
+ GHC.Cmm.CmmGraph
+ @ CmmNode
+ entry_a5gYI
+ (GHC.Cmm.Dataflow.Graph.$WGMany
+ @ 'Closed
+ @ Block
+ @ CmmNode
+ @ 'Closed
+ (GHC.Cmm.Dataflow.Block.$WNothingO @ (Block CmmNode O C))
+ body_a5gYK
+ (GHC.Cmm.Dataflow.Block.$WNothingO @ (Block CmmNode C O)))
+
+-- RHS size: {terms: 8, types: 16, coercions: 0, joins: 0/0}
+ofBlockMap :: BlockId -> LabelMap CmmBlock -> CmmGraph
+[LclIdX]
+ofBlockMap
+ = \ (entry_a5gYm :: BlockId)
+ (bodyMap_a5gYn :: LabelMap CmmBlock) ->
+ GHC.Cmm.CmmGraph
+ @ CmmNode
+ entry_a5gYm
+ (GHC.Cmm.Dataflow.Graph.$WGMany
+ @ 'Closed
+ @ Block
+ @ CmmNode
+ @ 'Closed
+ (GHC.Cmm.Dataflow.Block.$WNothingO @ (Block CmmNode O C))
+ bodyMap_a5gYn
+ (GHC.Cmm.Dataflow.Block.$WNothingO @ (Block CmmNode C O)))
+
+-- RHS size: {terms: 27, types: 57, coercions: 0, joins: 0/1}
+toBlockMap :: CmmGraph -> LabelMap CmmBlock
+[LclIdX]
+toBlockMap
+ = \ (ds_d5hoq :: GenCmmGraph CmmNode) ->
+ let {
+ fail_d5hq7 :: ghc-prim-0.6.1:GHC.Prim.Void# -> LabelMap CmmBlock
+ [LclId]
+ fail_d5hq7
+ = \ (ds_d5hq8 [OS=OneShot] :: ghc-prim-0.6.1:GHC.Prim.Void#) ->
+ Control.Exception.Base.patError
+ @ 'ghc-prim-0.6.1:GHC.Types.LiftedRep
+ @ (LabelMap CmmBlock)
+ "E:\\ghc_inferTags\\compiler\\GHC\\Cmm\\Utils.hs:525:1-67|function toBlockMap"# } in
+ case ds_d5hoq of wild_00 { CmmGraph ds_d5hq3 ds_d5hq4 ->
+ case ds_d5hq4 of wild_00 {
+ __DEFAULT -> fail_d5hq7 ghc-prim-0.6.1:GHC.Prim.void#;
+ GMany ds_d5hq5 body_a5gYl ds_d5hq6 ->
+ case ds_d5hq5 of wild_00 {
+ __DEFAULT -> fail_d5hq7 ghc-prim-0.6.1:GHC.Prim.void#;
+ NothingO co_a5heb ->
+ case ds_d5hq6 of wild_00 {
+ __DEFAULT -> fail_d5hq7 ghc-prim-0.6.1:GHC.Prim.void#;
+ NothingO co_a5hec -> body_a5gYl
+ }
+ }
+ }
+ }
+
+-- RHS size: {terms: 6, types: 8, coercions: 0, joins: 0/0}
+toBlockList :: CmmGraph -> [CmmBlock]
+[LclIdX]
+toBlockList
+ = \ (g_a5gYo :: CmmGraph) ->
+ $ @ 'ghc-prim-0.6.1:GHC.Types.LiftedRep
+ @ (LabelMap CmmBlock)
+ @ [CmmBlock]
+ (mapElems @ LabelMap $dIsMap_a5hej @ CmmBlock)
+ (toBlockMap g_a5gYo)
+
+-- RHS size: {terms: 59, types: 58, coercions: 3, joins: 0/9}
+toBlockListEntryFirst :: CmmGraph -> [CmmBlock]
+[LclIdX]
+toBlockListEntryFirst
+ = \ (g_a5gYp :: CmmGraph) ->
+ letrec {
+ entry_id_a5gYr :: BlockId
+ [LclId]
+ entry_id_a5gYr = g_entry @ CmmNode g_a5gYp; } in
+ letrec {
+ m_a5gYq :: LabelMap CmmBlock
+ [LclId]
+ m_a5gYq = toBlockMap g_a5gYp; } in
+ letrec {
+ ds_d5hqj :: Unit CmmBlock
+ [LclId]
+ ds_d5hqj
+ = let {
+ fail_d5hqr :: ghc-prim-0.6.1:GHC.Prim.Void# -> Unit CmmBlock
+ [LclId]
+ fail_d5hqr
+ = \ (ds_d5hqs [OS=OneShot] :: ghc-prim-0.6.1:GHC.Prim.Void#) ->
+ Control.Exception.Base.patError
+ @ 'ghc-prim-0.6.1:GHC.Types.LiftedRep
+ @ (Unit CmmBlock)
+ "E:\\ghc_inferTags\\compiler\\GHC\\Cmm\\Utils.hs:541:5-43|Just entry_block"# } in
+ let {
+ ds_d5hqk :: Maybe CmmBlock
+ [LclId]
+ ds_d5hqk
+ = mapLookup
+ @ LabelMap
+ $dIsMap_a5heD
+ @ CmmBlock
+ (entry_id_a5gYr
+ `cast` (Sub (Sym (GHC.Cmm.Dataflow.Label.D:R:KeyOfLabelMap[0]))
+ :: Label ~R# KeyOf LabelMap))
+ m_a5gYq } in
+ case ds_d5hqk of wild_00 {
+ __DEFAULT -> fail_d5hqr ghc-prim-0.6.1:GHC.Prim.void#;
+ Just entry_block_a5gYs -> (entry_block_a5gYs)
+ };
+ entry_block_a5gYs :: CmmBlock
+ [LclId]
+ entry_block_a5gYs
+ = case ds_d5hqj of ds_d5hqj { (entry_block_a5gYs) ->
+ entry_block_a5gYs
+ }; } in
+ letrec {
+ others_a5gYt :: [Block CmmNode C C]
+ [LclId]
+ others_a5gYt
+ = filter
+ @ (Block CmmNode C C)
+ (. @ BlockId
+ @ Bool
+ @ (Block CmmNode C C)
+ (let {
+ ds_d5hqi :: BlockId
+ [LclId]
+ ds_d5hqi = entry_id_a5gYr } in
+ \ (ds_d5hqh :: BlockId) ->
+ /= @ BlockId $dEq_a5heN ds_d5hqh ds_d5hqi)
+ (entryLabel @ (Block CmmNode) $dNonLocal_a5heQ @ C))
+ (mapElems @ LabelMap $dIsMap_a5heT @ CmmBlock m_a5gYq); } in
+ let {
+ fail_d5hqf :: ghc-prim-0.6.1:GHC.Prim.Void# -> [CmmBlock]
+ [LclId]
+ fail_d5hqf
+ = \ (ds_d5hqg [OS=OneShot] :: ghc-prim-0.6.1:GHC.Prim.Void#) ->
+ ghc-prim-0.6.1:GHC.Types.:
+ @ CmmBlock entry_block_a5gYs others_a5gYt } in
+ case mapNull @ LabelMap $dIsMap_a5heZ @ CmmBlock m_a5gYq
+ of wild_00 {
+ False -> fail_d5hqf ghc-prim-0.6.1:GHC.Prim.void#;
+ True -> ghc-prim-0.6.1:GHC.Types.[] @ CmmBlock
+ }
+
+-- RHS size: {terms: 111, types: 94, coercions: 12, joins: 0/14}
+toBlockListEntryFirstFalseFallthrough :: CmmGraph -> [CmmBlock]
+[LclIdX]
+toBlockListEntryFirstFalseFallthrough
+ = \ (g_a5gYu :: CmmGraph) ->
+ letrec {
+ entry_id_a5gYw :: BlockId
+ [LclId]
+ entry_id_a5gYw = g_entry @ CmmNode g_a5gYu; } in
+ letrec {
+ m_a5gYv :: LabelMap CmmBlock
+ [LclId]
+ m_a5gYv = toBlockMap g_a5gYu; } in
+ letrec {
+ ds_d5hra :: Unit CmmBlock
+ [LclId]
+ ds_d5hra
+ = let {
+ fail_d5hri :: ghc-prim-0.6.1:GHC.Prim.Void# -> Unit CmmBlock
+ [LclId]
+ fail_d5hri
+ = \ (ds_d5hrj [OS=OneShot] :: ghc-prim-0.6.1:GHC.Prim.Void#) ->
+ Control.Exception.Base.patError
+ @ 'ghc-prim-0.6.1:GHC.Types.LiftedRep
+ @ (Unit CmmBlock)
+ "E:\\ghc_inferTags\\compiler\\GHC\\Cmm\\Utils.hs:559:5-43|Just entry_block"# } in
+ let {
+ ds_d5hrb :: Maybe CmmBlock
+ [LclId]
+ ds_d5hrb
+ = mapLookup
+ @ LabelMap
+ $dIsMap_a5hfr
+ @ CmmBlock
+ (entry_id_a5gYw
+ `cast` (Sub (Sym (GHC.Cmm.Dataflow.Label.D:R:KeyOfLabelMap[0]))
+ :: Label ~R# KeyOf LabelMap))
+ m_a5gYv } in
+ case ds_d5hrb of wild_00 {
+ __DEFAULT -> fail_d5hri ghc-prim-0.6.1:GHC.Prim.void#;
+ Just entry_block_a5gYx -> (entry_block_a5gYx)
+ };
+ entry_block_a5gYx :: CmmBlock
+ [LclId]
+ entry_block_a5gYx
+ = case ds_d5hra of ds_d5hra { (entry_block_a5gYx) ->
+ entry_block_a5gYx
+ }; } in
+ letrec {
+ dfs_a5gYy :: LabelSet -> [CmmBlock] -> [CmmBlock]
+ [LclId]
+ dfs_a5gYy
+ = \ (ds_d5hqE :: LabelSet) (ds_d5hqF :: [CmmBlock]) ->
+ let {
+ visited_a5gYz :: LabelSet
+ [LclId]
+ visited_a5gYz = ds_d5hqE } in
+ case ds_d5hqF of wild_00 {
+ [] -> ghc-prim-0.6.1:GHC.Types.[] @ CmmBlock;
+ : block_a5gYA bs_a5gYB ->
+ letrec {
+ add_id_a5gYE :: Label -> [CmmBlock] -> [CmmBlock]
+ [LclId]
+ add_id_a5gYE
+ = \ (id_a5gYF :: Label) (bs_a5gYG :: [CmmBlock]) ->
+ let {
+ ds_d5hqY :: Maybe CmmBlock
+ [LclId]
+ ds_d5hqY
+ = mapLookup
+ @ LabelMap
+ $dIsMap_a5hfG
+ @ CmmBlock
+ (id_a5gYF
+ `cast` (Sub (Sym (GHC.Cmm.Dataflow.Label.D:R:KeyOfLabelMap[0]))
+ :: Label ~R# KeyOf LabelMap))
+ m_a5gYv } in
+ case ds_d5hqY of wild_00 {
+ Nothing -> bs_a5gYG;
+ Just b_a5gYH ->
+ ghc-prim-0.6.1:GHC.Types.: @ CmmBlock b_a5gYH bs_a5gYG
+ }; } in
+ letrec {
+ bs'_a5gYD :: [CmmBlock]
+ [LclId]
+ bs'_a5gYD
+ = foldr
+ @ []
+ $dFoldable_a5hfR
+ @ Label
+ @ [CmmBlock]
+ add_id_a5gYE
+ bs_a5gYB
+ (successors
+ @ (Block CmmNode) $dNonLocal_a5hfW @ C block_a5gYA); } in
+ letrec {
+ id_a5gYC :: Label
+ [LclId]
+ id_a5gYC
+ = entryLabel
+ @ (Block CmmNode) $dNonLocal_a5hg3 @ C block_a5gYA; } in
+ let {
+ fail_d5hqW :: ghc-prim-0.6.1:GHC.Prim.Void# -> [CmmBlock]
+ [LclId]
+ fail_d5hqW
+ = \ (ds_d5hqX [OS=OneShot] :: ghc-prim-0.6.1:GHC.Prim.Void#) ->
+ ghc-prim-0.6.1:GHC.Types.:
+ @ CmmBlock
+ block_a5gYA
+ (dfs_a5gYy
+ (setInsert
+ @ LabelSet
+ $dIsSet_a5hgc
+ (id_a5gYC
+ `cast` (Sub (Sym (GHC.Cmm.Dataflow.Label.D:R:ElemOfLabelSet[0]))
+ :: Label ~R# ElemOf LabelSet))
+ visited_a5gYz)
+ bs'_a5gYD) } in
+ case setMember
+ @ LabelSet
+ $dIsSet_a5hg8
+ (id_a5gYC
+ `cast` (Sub (Sym (GHC.Cmm.Dataflow.Label.D:R:ElemOfLabelSet[0]))
+ :: Label ~R# ElemOf LabelSet))
+ visited_a5gYz
+ of wild_00 {
+ False -> fail_d5hqW ghc-prim-0.6.1:GHC.Prim.void#;
+ True -> dfs_a5gYy visited_a5gYz bs_a5gYB
+ }
+ }; } in
+ let {
+ fail_d5hqC :: ghc-prim-0.6.1:GHC.Prim.Void# -> [CmmBlock]
+ [LclId]
+ fail_d5hqC
+ = \ (ds_d5hqD [OS=OneShot] :: ghc-prim-0.6.1:GHC.Prim.Void#) ->
+ dfs_a5gYy
+ (setEmpty @ LabelSet $dIsSet_a5hgj)
+ (GHC.Base.build
+ @ CmmBlock
+ (\ (@ a_d5hqt)
+ (c_d5hqu :: CmmBlock -> a_d5hqt -> a_d5hqt)
+ (n_d5hqv :: a_d5hqt) ->
+ c_d5hqu entry_block_a5gYx n_d5hqv)) } in
+ case mapNull @ LabelMap $dIsMap_a5hgf @ CmmBlock m_a5gYv
+ of wild_00 {
+ False -> fail_d5hqC ghc-prim-0.6.1:GHC.Prim.void#;
+ True -> ghc-prim-0.6.1:GHC.Types.[] @ CmmBlock
+ }
+
+-- RHS size: {terms: 23, types: 100, coercions: 0, joins: 0/0}
+mapGraphNodes
+ :: (CmmNode C O -> CmmNode C O, CmmNode O O -> CmmNode O O,
+ CmmNode O C -> CmmNode O C)
+ -> CmmGraph -> CmmGraph
+[LclIdX]
+mapGraphNodes
+ = \ (funs_a5gYM
+ :: (CmmNode C O -> CmmNode C O, CmmNode O O -> CmmNode O O,
+ CmmNode O C -> CmmNode O C))
+ (g_a5gYO :: CmmGraph) ->
+ case funs_a5gYM of wild_00 { (mf_a5gYN, ds_d5hru, ds_d5hrv) ->
+ $ @ 'ghc-prim-0.6.1:GHC.Types.LiftedRep
+ @ (LabelMap CmmBlock)
+ @ CmmGraph
+ (ofBlockMap
+ ($ @ 'ghc-prim-0.6.1:GHC.Types.LiftedRep
+ @ (CmmNode C O)
+ @ Label
+ (entryLabel @ CmmNode $dNonLocal_a5hgp @ O)
+ ($ @ 'ghc-prim-0.6.1:GHC.Types.LiftedRep
+ @ (CmmNode C O)
+ @ (CmmNode C O)
+ mf_a5gYN
+ (GHC.Cmm.Node.$WCmmEntry
+ (g_entry @ CmmNode g_a5gYO) GHC.Cmm.Node.GlobalScope))))
+ ($ @ 'ghc-prim-0.6.1:GHC.Types.LiftedRep
+ @ (LabelMap (Block CmmNode C C))
+ @ (LabelMap (Block CmmNode C C))
+ (mapMap
+ @ LabelMap
+ $dIsMap_a5hgB
+ @ (Block CmmNode C C)
+ @ (Block CmmNode C C)
+ (mapBlock3' @ CmmNode @ CmmNode @ C @ C funs_a5gYM))
+ (toBlockMap g_a5gYO))
+ }
+
+-- RHS size: {terms: 13, types: 16, coercions: 0, joins: 0/1}
+foldlGraphBlocks
+ :: forall a. (a -> CmmBlock -> a) -> a -> CmmGraph -> a
+[LclIdX]
+foldlGraphBlocks
+ = \ (@ a_a5hgN) ->
+ let {
+ $dIsMap_a5hgT :: IsMap LabelMap
+ [LclId]
+ $dIsMap_a5hgT = $dIsMap_a5hdt } in
+ \ (k_a5gYQ :: a_a5hgN -> CmmBlock -> a_a5hgN)
+ (z_a5gYR :: a_a5hgN)
+ (g_a5gYS :: CmmGraph) ->
+ $ @ 'ghc-prim-0.6.1:GHC.Types.LiftedRep
+ @ (LabelMap CmmBlock)
+ @ a_a5hgN
+ (mapFoldl
+ @ LabelMap $dIsMap_a5hgT @ a_a5hgN @ CmmBlock k_a5gYQ z_a5gYR)
+ (toBlockMap g_a5gYS)
+
+-- RHS size: {terms: 7, types: 4, coercions: 0, joins: 0/0}
+revPostorder :: CmmGraph -> [CmmBlock]
+[LclIdX]
+revPostorder
+ = \ (g_a5gYT :: CmmGraph) ->
+ revPostorderFrom
+ @ (Block CmmNode)
+ $dNonLocal_a5hh1
+ (toBlockMap g_a5gYT)
+ (g_entry @ CmmNode g_a5gYT)
+
+-- RHS size: {terms: 10, types: 19, coercions: 0, joins: 0/0}
+modifyGraph
+ :: forall (n :: Extensibility -> Extensibility -> *)
+ (n' :: Extensibility -> Extensibility -> *).
+ (Graph n C C -> Graph n' C C) -> GenCmmGraph n -> GenCmmGraph n'
+[LclIdX]
+modifyGraph
+ = \ (@ (n_a5hh3 :: Extensibility -> Extensibility -> *))
+ (@ (n'_a5hh4 :: Extensibility -> Extensibility -> *))
+ (f_a5gYj :: Graph n_a5hh3 C C -> Graph n'_a5hh4 C C)
+ (g_a5gYk :: GenCmmGraph n_a5hh3) ->
+ GHC.Cmm.CmmGraph
+ @ n'_a5hh4
+ (g_entry @ n_a5hh3 g_a5gYk)
+ (f_a5gYj (g_graph @ n_a5hh3 g_a5gYk))
+
+-- RHS size: {terms: 6, types: 18, coercions: 0, joins: 0/0}
+mapGraphNodes1
+ :: (forall (e :: Extensibility) (x :: Extensibility).
+ CmmNode e x -> CmmNode e x)
+ -> CmmGraph -> CmmGraph
+[LclIdX]
+mapGraphNodes1
+ = \ (f_a5gYP
+ :: forall (e :: Extensibility) (x :: Extensibility).
+ CmmNode e x -> CmmNode e x) ->
+ modifyGraph
+ @ CmmNode
+ @ CmmNode
+ (mapGraph
+ @ CmmNode
+ @ CmmNode
+ @ C
+ @ C
+ (\ (@ (e1_a5hhm :: Extensibility))
+ (@ (x1_a5hhn :: Extensibility)) ->
+ f_a5gYP @ e1_a5hhm @ x1_a5hhn))
+
+-- RHS size: {terms: 42, types: 23, coercions: 0, joins: 0/5}
+mkLiveness :: Platform -> [LocalReg] -> Liveness
+[LclIdX]
+mkLiveness
+ = \ (ds_d5hrw :: Platform) (ds_d5hrx :: [LocalReg]) ->
+ let {
+ platform_a5gYc :: Platform
+ [LclId]
+ platform_a5gYc = ds_d5hrw } in
+ case ds_d5hrx of wild_00 {
+ [] -> ghc-prim-0.6.1:GHC.Types.[] @ Bool;
+ : reg_a5gYd regs_a5gYe ->
+ letrec {
+ is_non_ptr_a5gYi :: Bool
+ [LclId]
+ is_non_ptr_a5gYi
+ = $ @ 'ghc-prim-0.6.1:GHC.Types.LiftedRep
+ @ Bool
+ @ Bool
+ not
+ (isGcPtrType (localRegType reg_a5gYd)); } in
+ letrec {
+ word_size_a5gYf :: Int
+ [LclId]
+ word_size_a5gYf = platformWordSizeInBytes platform_a5gYc; } in
+ letrec {
+ sizeW_a5gYg :: Int
+ [LclId]
+ sizeW_a5gYg
+ = quot
+ @ Int
+ $dIntegral_a5hhI
+ (- @ Int
+ $dNum_a5hhK
+ (+ @ Int
+ $dNum_a5hhM
+ (widthInBytes (typeWidth (localRegType reg_a5gYd)))
+ word_size_a5gYf)
+ (ghc-prim-0.6.1:GHC.Types.I# 1#))
+ word_size_a5gYf; } in
+ letrec {
+ bits_a5gYh :: [Bool]
+ [LclId]
+ bits_a5gYh = replicate @ Bool sizeW_a5gYg is_non_ptr_a5gYi; } in
+ ++ @ Bool bits_a5gYh (mkLiveness platform_a5gYc regs_a5gYe)
+ }
+
+-- RHS size: {terms: 55, types: 25, coercions: 0, joins: 0/5}
+regsOverlap :: Platform -> CmmReg -> CmmReg -> Bool
+[LclIdX]
+regsOverlap
+ = \ (platform_a5gXV :: Platform)
+ (ds_d5hrI :: CmmReg)
+ (ds_d5hrJ :: CmmReg) ->
+ let {
+ reg_a5gY0 :: CmmReg
+ [LclId]
+ reg_a5gY0 = ds_d5hrI } in
+ let {
+ fail_d5ht8 :: ghc-prim-0.6.1:GHC.Prim.Void# -> Bool
+ [LclId]
+ fail_d5ht8
+ = \ (ds_d5ht9 [OS=OneShot] :: ghc-prim-0.6.1:GHC.Prim.Void#) ->
+ let {
+ reg'_a5gY1 :: CmmReg
+ [LclId]
+ reg'_a5gY1 = ds_d5hrJ } in
+ == @ CmmReg $dEq_a5hi8 reg_a5gY0 reg'_a5gY1 } in
+ case ds_d5hrI of wild_00 {
+ __DEFAULT -> fail_d5ht8 ghc-prim-0.6.1:GHC.Prim.void#;
+ CmmGlobal g_a5gXW ->
+ case ds_d5hrJ of wild_00 {
+ __DEFAULT -> fail_d5ht8 ghc-prim-0.6.1:GHC.Prim.void#;
+ CmmGlobal g'_a5gXX ->
+ let {
+ ds_d5hrO :: Maybe GHC.Platform.Reg.RealReg
+ [LclId]
+ ds_d5hrO = globalRegMaybe platform_a5gXV g_a5gXW } in
+ case ds_d5hrO of wild_00 {
+ __DEFAULT -> fail_d5ht8 ghc-prim-0.6.1:GHC.Prim.void#;
+ Just real_a5gXY ->
+ let {
+ ds_d5hrS :: Maybe GHC.Platform.Reg.RealReg
+ [LclId]
+ ds_d5hrS = globalRegMaybe platform_a5gXV g'_a5gXX } in
+ case ds_d5hrS of wild_00 {
+ __DEFAULT -> fail_d5ht8 ghc-prim-0.6.1:GHC.Prim.void#;
+ Just real'_a5gXZ ->
+ case ==
+ @ GHC.Platform.Reg.RealReg $dEq_a5hi6 real_a5gXY real'_a5gXZ
+ of wild_00 {
+ False -> fail_d5ht8 ghc-prim-0.6.1:GHC.Prim.void#;
+ True -> ghc-prim-0.6.1:GHC.Types.True
+ }
+ }
+ }
+ }
+ }
+
+-- RHS size: {terms: 43, types: 26, coercions: 0, joins: 0/6}
+regUsedIn :: Platform -> CmmReg -> CmmExpr -> Bool
+[LclIdX]
+regUsedIn
+ = \ (platform_a5gY2 :: Platform) ->
+ letrec {
+ regUsedIn__a5gY3 :: CmmReg -> CmmExpr -> Bool
+ [LclId]
+ regUsedIn__a5gY3
+ = \ (ds_d5hta :: CmmReg) (ds_d5htb :: CmmExpr) ->
+ let {
+ reg_a5gY4 :: CmmReg
+ [LclId]
+ reg_a5gY4 = ds_d5hta } in
+ let {
+ reg_a5gY6 :: CmmReg
+ [LclId]
+ reg_a5gY6 = ds_d5hta } in
+ let {
+ reg_a5gY8 :: CmmReg
+ [LclId]
+ reg_a5gY8 = ds_d5hta } in
+ let {
+ reg_a5gYa :: CmmReg
+ [LclId]
+ reg_a5gYa = ds_d5hta } in
+ case ds_d5htb of wild_00 {
+ CmmLit ds_d5hvx -> ghc-prim-0.6.1:GHC.Types.False;
+ CmmLoad e_a5gY5 ds_d5hvy -> regUsedIn__a5gY3 reg_a5gY4 e_a5gY5;
+ CmmReg reg'_a5gY7 ->
+ regsOverlap platform_a5gY2 reg_a5gY6 reg'_a5gY7;
+ CmmMachOp ds_d5hvA es_a5gYb ->
+ any
+ @ []
+ @ CmmExpr
+ $dFoldable_a5hiv
+ (let {
+ ds_d5htq :: CmmReg
+ [LclId]
+ ds_d5htq = reg_a5gYa } in
+ \ (ds_d5htr :: CmmExpr) -> regUsedIn__a5gY3 ds_d5htq ds_d5htr)
+ es_a5gYb;
+ CmmStackSlot ds_d5hvB ds_d5hvC -> ghc-prim-0.6.1:GHC.Types.False;
+ CmmRegOff reg'_a5gY9 ds_d5hvz ->
+ regsOverlap platform_a5gY2 reg_a5gY8 reg'_a5gY9
+ }; } in
+ regUsedIn__a5gY3
+
+-- RHS size: {terms: 12, types: 3, coercions: 0, joins: 0/0}
+tAG_MASK :: Platform -> Int
+[LclIdX]
+tAG_MASK
+ = \ (platform_a5gXJ :: Platform) ->
+ - @ Int
+ $dNum_a5hiy
+ (shiftL
+ @ Int
+ $dBits_a5hiA
+ (ghc-prim-0.6.1:GHC.Types.I# 1#)
+ (pc_TAG_BITS (platformConstants platform_a5gXJ)))
+ (ghc-prim-0.6.1:GHC.Types.I# 1#)
+
+-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
+mAX_PTR_TAG :: Platform -> Int
+[LclIdX]
+mAX_PTR_TAG = tAG_MASK
+
+-- RHS size: {terms: 12, types: 8, coercions: 0, joins: 0/1}
+isComparisonExpr :: CmmExpr -> Bool
+[LclIdX]
+isComparisonExpr
+ = \ (ds_d5hvD :: CmmExpr) ->
+ let {
+ fail_d5hvO :: ghc-prim-0.6.1:GHC.Prim.Void# -> Bool
+ [LclId]
+ fail_d5hvO
+ = \ (ds_d5hvP [OS=OneShot] :: ghc-prim-0.6.1:GHC.Prim.Void#) ->
+ ghc-prim-0.6.1:GHC.Types.False } in
+ case ds_d5hvD of wild_00 {
+ __DEFAULT -> fail_d5hvO ghc-prim-0.6.1:GHC.Prim.void#;
+ CmmMachOp op_a5gXI ds_d5hvN -> isComparisonMachOp op_a5gXI
+ }
+
+-- RHS size: {terms: 11, types: 6, coercions: 0, joins: 0/1}
+isLit :: CmmExpr -> Bool
+[LclIdX]
+isLit
+ = \ (ds_d5hvQ :: CmmExpr) ->
+ let {
+ fail_d5hws :: ghc-prim-0.6.1:GHC.Prim.Void# -> Bool
+ [LclId]
+ fail_d5hws
+ = \ (ds_d5hwt [OS=OneShot] :: ghc-prim-0.6.1:GHC.Prim.Void#) ->
+ ghc-prim-0.6.1:GHC.Types.False } in
+ case ds_d5hvQ of wild_00 {
+ __DEFAULT -> fail_d5hws ghc-prim-0.6.1:GHC.Prim.void#;
+ CmmLit ds_d5hwr -> ghc-prim-0.6.1:GHC.Types.True
+ }
+
+-- RHS size: {terms: 35, types: 20, coercions: 0, joins: 0/1}
+hasNoGlobalRegs :: CmmExpr -> Bool
+[LclIdX]
+hasNoGlobalRegs
+ = \ (ds_d5hwu :: CmmExpr) ->
+ let {
+ fail_d5hzs :: ghc-prim-0.6.1:GHC.Prim.Void# -> Bool
+ [LclId]
+ fail_d5hzs
+ = \ (ds_d5hzt [OS=OneShot] :: ghc-prim-0.6.1:GHC.Prim.Void#) ->
+ ghc-prim-0.6.1:GHC.Types.False } in
+ case ds_d5hwu of wild_00 {
+ __DEFAULT -> fail_d5hzs ghc-prim-0.6.1:GHC.Prim.void#;
+ CmmLit ds_d5hzm -> ghc-prim-0.6.1:GHC.Types.True;
+ CmmLoad e_a5gXG ds_d5hzk -> hasNoGlobalRegs e_a5gXG;
+ CmmReg ds_d5hzn ->
+ case ds_d5hzn of wild_00 {
+ __DEFAULT -> fail_d5hzs ghc-prim-0.6.1:GHC.Prim.void#;
+ CmmLocal ds_d5hzo -> ghc-prim-0.6.1:GHC.Types.True
+ };
+ CmmMachOp ds_d5hzl es_a5gXH ->
+ all @ [] @ CmmExpr $dFoldable_a5hiP hasNoGlobalRegs es_a5gXH;
+ CmmRegOff ds_d5hzp ds_d5hzq ->
+ case ds_d5hzp of wild_00 {
+ __DEFAULT -> fail_d5hzs ghc-prim-0.6.1:GHC.Prim.void#;
+ CmmLocal ds_d5hzr -> ghc-prim-0.6.1:GHC.Types.True
+ }
+ }
+
+-- RHS size: {terms: 17, types: 14, coercions: 0, joins: 0/0}
+isTrivialCmmExpr :: CmmExpr -> Bool
+[LclIdX]
+isTrivialCmmExpr
+ = \ (ds_d5hzu :: CmmExpr) ->
+ case ds_d5hzu of wild_00 {
+ CmmLit ds_d5hBC -> ghc-prim-0.6.1:GHC.Types.True;
+ CmmLoad ds_d5hBy ds_d5hBz -> ghc-prim-0.6.1:GHC.Types.False;
+ CmmReg ds_d5hBD -> ghc-prim-0.6.1:GHC.Types.True;
+ CmmMachOp ds_d5hBA ds_d5hBB -> ghc-prim-0.6.1:GHC.Types.False;
+ CmmStackSlot ds_d5hBG ds_d5hBH ->
+ panic
+ @ Bool
+ (ghc-prim-0.6.1:GHC.CString.unpackCString#
+ "isTrivialCmmExpr CmmStackSlot"#);
+ CmmRegOff ds_d5hBE ds_d5hBF -> ghc-prim-0.6.1:GHC.Types.True
+ }
+
+-- RHS size: {terms: 21, types: 10, coercions: 0, joins: 0/2}
+cmmMkAssign
+ :: Platform -> CmmExpr -> Unique -> (CmmNode O O, CmmExpr)
+[LclIdX]
+cmmMkAssign
+ = \ (platform_a5gXB :: Platform)
+ (expr_a5gXC :: CmmExpr)
+ (uq_a5gXD :: Unique) ->
+ letrec {
+ ty_a5gXE :: CmmType
+ [LclId]
+ ty_a5gXE = cmmExprType platform_a5gXB expr_a5gXC; } in
+ case ty_a5gXE of ty_a5gXE { __DEFAULT ->
+ letrec {
+ reg_a5gXF :: CmmReg
+ [LclId]
+ reg_a5gXF
+ = GHC.Cmm.Expr.$WCmmLocal
+ (GHC.Cmm.Expr.$WLocalReg uq_a5gXD ty_a5gXE); } in
+ (GHC.Cmm.Node.$WCmmAssign reg_a5gXF expr_a5gXC,
+ GHC.Cmm.Expr.$WCmmReg reg_a5gXF)
+ }
+
+-- RHS size: {terms: 32, types: 16, coercions: 0, joins: 0/3}
+cmmToWord :: Platform -> CmmExpr -> CmmExpr
+[LclIdX]
+cmmToWord
+ = \ (platform_a5gXx :: Platform) (e_a5gXy :: CmmExpr) ->
+ letrec {
+ word_a5gXA :: Width
+ [LclId]
+ word_a5gXA = wordWidth platform_a5gXx; } in
+ letrec {
+ w_a5gXz :: Width
+ [LclId]
+ w_a5gXz = cmmExprWidth platform_a5gXx e_a5gXy; } in
+ let {
+ fail_d5hBR :: ghc-prim-0.6.1:GHC.Prim.Void# -> CmmExpr
+ [LclId]
+ fail_d5hBR
+ = \ (ds_d5hBS [OS=OneShot] :: ghc-prim-0.6.1:GHC.Prim.Void#) ->
+ GHC.Cmm.Expr.CmmMachOp
+ (GHC.Cmm.MachOp.MO_UU_Conv w_a5gXz word_a5gXA)
+ (GHC.Base.build
+ @ CmmExpr
+ (\ (@ a_d5hBI)
+ (c_d5hBJ :: CmmExpr -> a_d5hBI -> a_d5hBI)
+ (n_d5hBK :: a_d5hBI) ->
+ c_d5hBJ e_a5gXy n_d5hBK)) } in
+ case == @ Width $dEq_a5hjd w_a5gXz word_a5gXA of wild_00 {
+ False -> fail_d5hBR ghc-prim-0.6.1:GHC.Prim.void#;
+ True -> e_a5gXy
+ }
+
+-- RHS size: {terms: 36, types: 19, coercions: 0, joins: 0/2}
+cmmNegate :: Platform -> CmmExpr -> CmmExpr
+[LclIdX]
+cmmNegate
+ = \ (platform_a5gXt :: Platform) (ds_d5hBT :: CmmExpr) ->
+ let {
+ e_a5gXw :: CmmExpr
+ [LclId]
+ e_a5gXw = ds_d5hBT } in
+ let {
+ fail_d5hCJ :: ghc-prim-0.6.1:GHC.Prim.Void# -> CmmExpr
+ [LclId]
+ fail_d5hCJ
+ = \ (ds_d5hCK [OS=OneShot] :: ghc-prim-0.6.1:GHC.Prim.Void#) ->
+ GHC.Cmm.Expr.CmmMachOp
+ (GHC.Cmm.MachOp.MO_S_Neg (cmmExprWidth platform_a5gXt e_a5gXw))
+ (GHC.Base.build
+ @ CmmExpr
+ (\ (@ a_d5hBZ)
+ (c_d5hC0 :: CmmExpr -> a_d5hBZ -> a_d5hBZ)
+ (n_d5hC1 :: a_d5hBZ) ->
+ c_d5hC0 e_a5gXw n_d5hC1)) } in
+ case ds_d5hBT of wild_00 {
+ __DEFAULT -> fail_d5hCJ ghc-prim-0.6.1:GHC.Prim.void#;
+ CmmLit ds_d5hCI ->
+ case ds_d5hCI of wild_00 {
+ __DEFAULT -> fail_d5hCJ ghc-prim-0.6.1:GHC.Prim.void#;
+ CmmInt n_a5gXu rep_a5gXv ->
+ GHC.Cmm.Expr.CmmLit
+ (GHC.Cmm.Expr.$WCmmInt
+ (negate @ Integer $dNum_a5hjl n_a5gXu) rep_a5gXv)
+ }
+ }
+
+-- RHS size: {terms: 15, types: 10, coercions: 0, joins: 0/0}
+cmmQuotWord :: Platform -> CmmExpr -> CmmExpr -> CmmExpr
+[LclIdX]
+cmmQuotWord
+ = \ (platform_a5gXq :: Platform)
+ (e1_a5gXr :: CmmExpr)
+ (e2_a5gXs :: CmmExpr) ->
+ GHC.Cmm.Expr.CmmMachOp
+ (mo_wordUQuot platform_a5gXq)
+ (GHC.Base.build
+ @ CmmExpr
+ (\ (@ a_d5hCL)
+ (c_d5hCM :: CmmExpr -> a_d5hCL -> a_d5hCL)
+ (n_d5hCN :: a_d5hCL) ->
+ c_d5hCM e1_a5gXr (c_d5hCM e2_a5gXs n_d5hCN)))
+
+-- RHS size: {terms: 15, types: 10, coercions: 0, joins: 0/0}
+cmmMulWord :: Platform -> CmmExpr -> CmmExpr -> CmmExpr
+[LclIdX]
+cmmMulWord
+ = \ (platform_a5gXn :: Platform)
+ (e1_a5gXo :: CmmExpr)
+ (e2_a5gXp :: CmmExpr) ->
+ GHC.Cmm.Expr.CmmMachOp
+ (mo_wordMul platform_a5gXn)
+ (GHC.Base.build
+ @ CmmExpr
+ (\ (@ a_d5hCO)
+ (c_d5hCP :: CmmExpr -> a_d5hCO -> a_d5hCO)
+ (n_d5hCQ :: a_d5hCO) ->
+ c_d5hCP e1_a5gXo (c_d5hCP e2_a5gXp n_d5hCQ)))
+
+-- RHS size: {terms: 15, types: 10, coercions: 0, joins: 0/0}
+cmmSubWord :: Platform -> CmmExpr -> CmmExpr -> CmmExpr
+[LclIdX]
+cmmSubWord
+ = \ (platform_a5gXk :: Platform)
+ (e1_a5gXl :: CmmExpr)
+ (e2_a5gXm :: CmmExpr) ->
+ GHC.Cmm.Expr.CmmMachOp
+ (mo_wordSub platform_a5gXk)
+ (GHC.Base.build
+ @ CmmExpr
+ (\ (@ a_d5hCR)
+ (c_d5hCS :: CmmExpr -> a_d5hCR -> a_d5hCR)
+ (n_d5hCT :: a_d5hCR) ->
+ c_d5hCS e1_a5gXl (c_d5hCS e2_a5gXm n_d5hCT)))
+
+-- RHS size: {terms: 15, types: 10, coercions: 0, joins: 0/0}
+cmmAddWord :: Platform -> CmmExpr -> CmmExpr -> CmmExpr
+[LclIdX]
+cmmAddWord
+ = \ (platform_a5gXh :: Platform)
+ (e1_a5gXi :: CmmExpr)
+ (e2_a5gXj :: CmmExpr) ->
+ GHC.Cmm.Expr.CmmMachOp
+ (mo_wordAdd platform_a5gXh)
+ (GHC.Base.build
+ @ CmmExpr
+ (\ (@ a_d5hCU)
+ (c_d5hCV :: CmmExpr -> a_d5hCU -> a_d5hCU)
+ (n_d5hCW :: a_d5hCU) ->
+ c_d5hCV e1_a5gXi (c_d5hCV e2_a5gXj n_d5hCW)))
+
+-- RHS size: {terms: 15, types: 10, coercions: 0, joins: 0/0}
+cmmUShrWord :: Platform -> CmmExpr -> CmmExpr -> CmmExpr
+[LclIdX]
+cmmUShrWord
+ = \ (platform_a5gXe :: Platform)
+ (e1_a5gXf :: CmmExpr)
+ (e2_a5gXg :: CmmExpr) ->
+ GHC.Cmm.Expr.CmmMachOp
+ (mo_wordUShr platform_a5gXe)
+ (GHC.Base.build
+ @ CmmExpr
+ (\ (@ a_d5hCX)
+ (c_d5hCY :: CmmExpr -> a_d5hCX -> a_d5hCX)
+ (n_d5hCZ :: a_d5hCX) ->
+ c_d5hCY e1_a5gXf (c_d5hCY e2_a5gXg n_d5hCZ)))
+
+-- RHS size: {terms: 15, types: 10, coercions: 0, joins: 0/0}
+cmmSLtWord :: Platform -> CmmExpr -> CmmExpr -> CmmExpr
+[LclIdX]
+cmmSLtWord
+ = \ (platform_a5gXb :: Platform)
+ (e1_a5gXc :: CmmExpr)
+ (e2_a5gXd :: CmmExpr) ->
+ GHC.Cmm.Expr.CmmMachOp
+ (mo_wordSLt platform_a5gXb)
+ (GHC.Base.build
+ @ CmmExpr
+ (\ (@ a_d5hD0)
+ (c_d5hD1 :: CmmExpr -> a_d5hD0 -> a_d5hD0)
+ (n_d5hD2 :: a_d5hD0) ->
+ c_d5hD1 e1_a5gXc (c_d5hD1 e2_a5gXd n_d5hD2)))
+
+-- RHS size: {terms: 15, types: 10, coercions: 0, joins: 0/0}
+cmmUGtWord :: Platform -> CmmExpr -> CmmExpr -> CmmExpr
+[LclIdX]
+cmmUGtWord
+ = \ (platform_a5gX8 :: Platform)
+ (e1_a5gX9 :: CmmExpr)
+ (e2_a5gXa :: CmmExpr) ->
+ GHC.Cmm.Expr.CmmMachOp
+ (mo_wordUGt platform_a5gX8)
+ (GHC.Base.build
+ @ CmmExpr
+ (\ (@ a_d5hD3)
+ (c_d5hD4 :: CmmExpr -> a_d5hD3 -> a_d5hD3)
+ (n_d5hD5 :: a_d5hD3) ->
+ c_d5hD4 e1_a5gX9 (c_d5hD4 e2_a5gXa n_d5hD5)))
+
+-- RHS size: {terms: 15, types: 10, coercions: 0, joins: 0/0}
+cmmUGeWord :: Platform -> CmmExpr -> CmmExpr -> CmmExpr
+[LclIdX]
+cmmUGeWord
+ = \ (platform_a5gX5 :: Platform)
+ (e1_a5gX6 :: CmmExpr)
+ (e2_a5gX7 :: CmmExpr) ->
+ GHC.Cmm.Expr.CmmMachOp
+ (mo_wordUGe platform_a5gX5)
+ (GHC.Base.build
+ @ CmmExpr
+ (\ (@ a_d5hD6)
+ (c_d5hD7 :: CmmExpr -> a_d5hD6 -> a_d5hD6)
+ (n_d5hD8 :: a_d5hD6) ->
+ c_d5hD7 e1_a5gX6 (c_d5hD7 e2_a5gX7 n_d5hD8)))
+
+-- RHS size: {terms: 15, types: 10, coercions: 0, joins: 0/0}
+cmmULtWord :: Platform -> CmmExpr -> CmmExpr -> CmmExpr
+[LclIdX]
+cmmULtWord
+ = \ (platform_a5gX2 :: Platform)
+ (e1_a5gX3 :: CmmExpr)
+ (e2_a5gX4 :: CmmExpr) ->
+ GHC.Cmm.Expr.CmmMachOp
+ (mo_wordULt platform_a5gX2)
+ (GHC.Base.build
+ @ CmmExpr
+ (\ (@ a_d5hD9)
+ (c_d5hDa :: CmmExpr -> a_d5hD9 -> a_d5hD9)
+ (n_d5hDb :: a_d5hD9) ->
+ c_d5hDa e1_a5gX3 (c_d5hDa e2_a5gX4 n_d5hDb)))
+
+-- RHS size: {terms: 15, types: 10, coercions: 0, joins: 0/0}
+cmmEqWord :: Platform -> CmmExpr -> CmmExpr -> CmmExpr
+[LclIdX]
+cmmEqWord
+ = \ (platform_a5gWZ :: Platform)
+ (e1_a5gX0 :: CmmExpr)
+ (e2_a5gX1 :: CmmExpr) ->
+ GHC.Cmm.Expr.CmmMachOp
+ (mo_wordEq platform_a5gWZ)
+ (GHC.Base.build
+ @ CmmExpr
+ (\ (@ a_d5hDc)
+ (c_d5hDd :: CmmExpr -> a_d5hDc -> a_d5hDc)
+ (n_d5hDe :: a_d5hDc) ->
+ c_d5hDd e1_a5gX0 (c_d5hDd e2_a5gX1 n_d5hDe)))
+
+-- RHS size: {terms: 15, types: 10, coercions: 0, joins: 0/0}
+cmmNeWord :: Platform -> CmmExpr -> CmmExpr -> CmmExpr
+[LclIdX]
+cmmNeWord
+ = \ (platform_a5gWW :: Platform)
+ (e1_a5gWX :: CmmExpr)
+ (e2_a5gWY :: CmmExpr) ->
+ GHC.Cmm.Expr.CmmMachOp
+ (mo_wordNe platform_a5gWW)
+ (GHC.Base.build
+ @ CmmExpr
+ (\ (@ a_d5hDf)
+ (c_d5hDg :: CmmExpr -> a_d5hDf -> a_d5hDf)
+ (n_d5hDh :: a_d5hDf) ->
+ c_d5hDg e1_a5gWX (c_d5hDg e2_a5gWY n_d5hDh)))
+
+-- RHS size: {terms: 15, types: 10, coercions: 0, joins: 0/0}
+cmmAndWord :: Platform -> CmmExpr -> CmmExpr -> CmmExpr
+[LclIdX]
+cmmAndWord
+ = \ (platform_a5gWT :: Platform)
+ (e1_a5gWU :: CmmExpr)
+ (e2_a5gWV :: CmmExpr) ->
+ GHC.Cmm.Expr.CmmMachOp
+ (mo_wordAnd platform_a5gWT)
+ (GHC.Base.build
+ @ CmmExpr
+ (\ (@ a_d5hDi)
+ (c_d5hDj :: CmmExpr -> a_d5hDi -> a_d5hDi)
+ (n_d5hDk :: a_d5hDi) ->
+ c_d5hDj e1_a5gWU (c_d5hDj e2_a5gWV n_d5hDk)))
+
+-- RHS size: {terms: 15, types: 10, coercions: 0, joins: 0/0}
+cmmOrWord :: Platform -> CmmExpr -> CmmExpr -> CmmExpr
+[LclIdX]
+cmmOrWord
+ = \ (platform_a5gWQ :: Platform)
+ (e1_a5gWR :: CmmExpr)
+ (e2_a5gWS :: CmmExpr) ->
+ GHC.Cmm.Expr.CmmMachOp
+ (mo_wordOr platform_a5gWQ)
+ (GHC.Base.build
+ @ CmmExpr
+ (\ (@ a_d5hDl)
+ (c_d5hDm :: CmmExpr -> a_d5hDl -> a_d5hDl)
+ (n_d5hDn :: a_d5hDl) ->
+ c_d5hDm e1_a5gWR (c_d5hDm e2_a5gWS n_d5hDn)))
+
+-- RHS size: {terms: 22, types: 10, coercions: 0, joins: 0/3}
+cmmLabelOff :: CLabel -> Int -> CmmLit
+[LclIdX]
+cmmLabelOff
+ = \ (lbl_a5gW9 :: CLabel) (ds_d5hDo :: Int) ->
+ let {
+ lbl_a5gWa :: CLabel
+ [LclId]
+ lbl_a5gWa = lbl_a5gW9 } in
+ let {
+ byte_off_a5gWb :: Int
+ [LclId]
+ byte_off_a5gWb = ds_d5hDo } in
+ let {
+ fail_d5hDw :: ghc-prim-0.6.1:GHC.Prim.Void# -> CmmLit
+ [LclId]
+ fail_d5hDw
+ = \ (ds_d5hDx [OS=OneShot] :: ghc-prim-0.6.1:GHC.Prim.Void#) ->
+ GHC.Cmm.Expr.CmmLabelOff lbl_a5gWa byte_off_a5gWb } in
+ case ds_d5hDo of wild_00 { ghc-prim-0.6.1:GHC.Types.I# ds_d5hDv ->
+ case ds_d5hDv of ds_d5hDv {
+ __DEFAULT -> fail_d5hDw ghc-prim-0.6.1:GHC.Prim.void#;
+ 0# -> GHC.Cmm.Expr.CmmLabel lbl_a5gW9
+ }
+ }
+
+-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
+cmmLabelOffB :: CLabel -> ByteOff -> CmmLit
+[LclIdX]
+cmmLabelOffB = cmmLabelOff
+
+-- RHS size: {terms: 9, types: 4, coercions: 0, joins: 0/0}
+cmmLabelOffW :: Platform -> CLabel -> WordOff -> CmmLit
+[LclIdX]
+cmmLabelOffW
+ = \ (platform_a5gWJ :: Platform)
+ (lbl_a5gWK :: CLabel)
+ (wd_off_a5gWL :: WordOff) ->
+ cmmLabelOffB
+ lbl_a5gWK
+ (wordsToBytes @ WordOff $dNum_a5hjM platform_a5gWJ wd_off_a5gWL)
+
+-- RHS size: {terms: 54, types: 26, coercions: 0, joins: 0/5}
+cmmOffsetLit :: CmmLit -> Int -> CmmLit
+[LclIdX]
+cmmOffsetLit
+ = \ (ds_d5hDy :: CmmLit) (byte_off_a5gVW :: Int) ->
+ let {
+ fail_d5hEq :: ghc-prim-0.6.1:GHC.Prim.Void# -> CmmLit
+ [LclId]
+ fail_d5hEq
+ = \ (ds_d5hEr [OS=OneShot] :: ghc-prim-0.6.1:GHC.Prim.Void#) ->
+ let {
+ byte_off_a5gW8 :: Int
+ [LclId]
+ byte_off_a5gW8 = byte_off_a5gVW } in
+ pprPanic
+ @ CmmLit
+ $dIP_a5hjZ
+ (ghc-prim-0.6.1:GHC.CString.unpackCString# "cmmOffsetLit"#)
+ (ppr @ Int $dOutputable_a5hk1 byte_off_a5gW8) } in
+ case ds_d5hDy of wild_00 {
+ __DEFAULT -> fail_d5hEq ghc-prim-0.6.1:GHC.Prim.void#;
+ CmmInt m_a5gW5 rep_a5gW6 ->
+ let {
+ byte_off_a5gW7 :: Int
+ [LclId]
+ byte_off_a5gW7 = byte_off_a5gVW } in
+ GHC.Cmm.Expr.$WCmmInt
+ (+ @ Integer
+ $dNum_a5hjT
+ m_a5gW5
+ (fromIntegral
+ @ Int @ Integer $dIntegral_a5hjW $dNum_a5hjX byte_off_a5gW7))
+ rep_a5gW6;
+ CmmLabel l_a5gVV -> cmmLabelOff l_a5gVV byte_off_a5gVW;
+ CmmLabelOff l_a5gVX m_a5gVY ->
+ let {
+ byte_off_a5gVZ :: Int
+ [LclId]
+ byte_off_a5gVZ = byte_off_a5gVW } in
+ cmmLabelOff l_a5gVX (+ @ Int $dNum_a5hjP m_a5gVY byte_off_a5gVZ);
+ CmmLabelDiffOff l1_a5gW0 l2_a5gW1 m_a5gW2 w_a5gW3 ->
+ let {
+ byte_off_a5gW4 :: Int
+ [LclId]
+ byte_off_a5gW4 = byte_off_a5gVW } in
+ GHC.Cmm.Expr.CmmLabelDiffOff
+ l1_a5gW0
+ l2_a5gW1
+ (+ @ Int $dNum_a5hjR m_a5gW2 byte_off_a5gW4)
+ w_a5gW3
+ }
+
+-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
+cmmOffsetLitB :: CmmLit -> ByteOff -> CmmLit
+[LclIdX]
+cmmOffsetLitB = cmmOffsetLit
+
+-- RHS size: {terms: 9, types: 4, coercions: 0, joins: 0/0}
+cmmOffsetLitW :: Platform -> CmmLit -> WordOff -> CmmLit
+[LclIdX]
+cmmOffsetLitW
+ = \ (platform_a5gWG :: Platform)
+ (lit_a5gWH :: CmmLit)
+ (wd_off_a5gWI :: WordOff) ->
+ cmmOffsetLitB
+ lit_a5gWH
+ (wordsToBytes @ WordOff $dNum_a5hk5 platform_a5gWG wd_off_a5gWI)
+
+-- RHS size: {terms: 22, types: 10, coercions: 0, joins: 0/3}
+cmmRegOff :: CmmReg -> Int -> CmmExpr
+[LclIdX]
+cmmRegOff
+ = \ (reg_a5gVS :: CmmReg) (ds_d5hEs :: Int) ->
+ let {
+ reg_a5gVT :: CmmReg
+ [LclId]
+ reg_a5gVT = reg_a5gVS } in
+ let {
+ byte_off_a5gVU :: Int
+ [LclId]
+ byte_off_a5gVU = ds_d5hEs } in
+ let {
+ fail_d5hEA :: ghc-prim-0.6.1:GHC.Prim.Void# -> CmmExpr
+ [LclId]
+ fail_d5hEA
+ = \ (ds_d5hEB [OS=OneShot] :: ghc-prim-0.6.1:GHC.Prim.Void#) ->
+ GHC.Cmm.Expr.$WCmmRegOff reg_a5gVT byte_off_a5gVU } in
+ case ds_d5hEs of wild_00 { ghc-prim-0.6.1:GHC.Types.I# ds_d5hEz ->
+ case ds_d5hEz of ds_d5hEz {
+ __DEFAULT -> fail_d5hEA ghc-prim-0.6.1:GHC.Prim.void#;
+ 0# -> GHC.Cmm.Expr.$WCmmReg reg_a5gVS
+ }
+ }
+
+-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
+cmmRegOffB :: CmmReg -> ByteOff -> CmmExpr
+[LclIdX]
+cmmRegOffB = cmmRegOff
+
+-- RHS size: {terms: 9, types: 4, coercions: 0, joins: 0/0}
+cmmRegOffW :: Platform -> CmmReg -> WordOff -> CmmExpr
+[LclIdX]
+cmmRegOffW
+ = \ (platform_a5gWD :: Platform)
+ (reg_a5gWE :: CmmReg)
+ (wd_off_a5gWF :: WordOff) ->
+ cmmRegOffB
+ reg_a5gWE
+ (wordsToBytes @ WordOff $dNum_a5hki platform_a5gWD wd_off_a5gWF)
+
+-- RHS size: {terms: 131, types: 65, coercions: 0, joins: 0/7}
+cmmOffset :: Platform -> CmmExpr -> Int -> CmmExpr
+[LclIdX]
+cmmOffset
+ = \ (_platform_a5gVC :: Platform)
+ (e_a5gVD :: CmmExpr)
+ (ds_d5hEC :: Int) ->
+ let {
+ platform_a5gVE :: Platform
+ [LclId]
+ platform_a5gVE = _platform_a5gVC } in
+ let {
+ e_a5gVF :: CmmExpr
+ [LclId]
+ e_a5gVF = e_a5gVD } in
+ let {
+ byte_off_a5gVG :: Int
+ [LclId]
+ byte_off_a5gVG = ds_d5hEC } in
+ let {
+ fail_d5hIE :: ghc-prim-0.6.1:GHC.Prim.Void# -> CmmExpr
+ [LclId]
+ fail_d5hIE
+ = \ (ds_d5hIF [OS=OneShot] :: ghc-prim-0.6.1:GHC.Prim.Void#) ->
+ let {
+ ds_d5hEF :: CmmExpr
+ [LclId]
+ ds_d5hEF = e_a5gVF } in
+ let {
+ fail_d5hIx :: ghc-prim-0.6.1:GHC.Prim.Void# -> CmmExpr
+ [LclId]
+ fail_d5hIx
+ = \ (ds_d5hIy [OS=OneShot] :: ghc-prim-0.6.1:GHC.Prim.Void#) ->
+ letrec {
+ width_a5gVR :: Width
+ [LclId]
+ width_a5gVR = cmmExprWidth platform_a5gVE e_a5gVF; } in
+ GHC.Cmm.Expr.CmmMachOp
+ (GHC.Cmm.MachOp.MO_Add width_a5gVR)
+ (GHC.Base.build
+ @ CmmExpr
+ (\ (@ a_d5hFb)
+ (c_d5hFc :: CmmExpr -> a_d5hFb -> a_d5hFb)
+ (n_d5hFd :: a_d5hFb) ->
+ c_d5hFc
+ e_a5gVF
+ (c_d5hFc
+ (GHC.Cmm.Expr.CmmLit
+ (GHC.Cmm.Expr.$WCmmInt
+ (toInteger @ Int $dIntegral_a5hkH byte_off_a5gVG)
+ width_a5gVR))
+ n_d5hFd))) } in
+ case ds_d5hEF of wild_00 {
+ __DEFAULT -> fail_d5hIx ghc-prim-0.6.1:GHC.Prim.void#;
+ CmmLit lit_a5gVK ->
+ GHC.Cmm.Expr.CmmLit (cmmOffsetLit lit_a5gVK byte_off_a5gVG);
+ CmmReg reg_a5gVH -> cmmRegOff reg_a5gVH byte_off_a5gVG;
+ CmmMachOp ds_d5hIr ds_d5hIs ->
+ case ds_d5hIr of wild_00 {
+ __DEFAULT -> fail_d5hIx ghc-prim-0.6.1:GHC.Prim.void#;
+ MO_Add rep_a5gVN ->
+ case ds_d5hIs of wild_00 {
+ __DEFAULT -> fail_d5hIx ghc-prim-0.6.1:GHC.Prim.void#;
+ : expr_a5gVO ds_d5hIt ->
+ case ds_d5hIt of wild_00 {
+ __DEFAULT -> fail_d5hIx ghc-prim-0.6.1:GHC.Prim.void#;
+ : ds_d5hIu ds_d5hIv ->
+ case ds_d5hIu of wild_00 {
+ __DEFAULT -> fail_d5hIx ghc-prim-0.6.1:GHC.Prim.void#;
+ CmmLit ds_d5hIw ->
+ case ds_d5hIw of wild_00 {
+ __DEFAULT -> fail_d5hIx ghc-prim-0.6.1:GHC.Prim.void#;
+ CmmInt byte_off1_a5gVP _rep_a5gVQ ->
+ case ds_d5hIv of wild_00 {
+ __DEFAULT -> fail_d5hIx ghc-prim-0.6.1:GHC.Prim.void#;
+ [] ->
+ GHC.Cmm.Expr.CmmMachOp
+ (GHC.Cmm.MachOp.MO_Add rep_a5gVN)
+ (GHC.Base.build
+ @ CmmExpr
+ (\ (@ a_d5hF8)
+ (c_d5hF9 :: CmmExpr -> a_d5hF8 -> a_d5hF8)
+ (n_d5hFa :: a_d5hF8) ->
+ c_d5hF9
+ expr_a5gVO
+ (c_d5hF9
+ (GHC.Cmm.Expr.CmmLit
+ (GHC.Cmm.Expr.$WCmmInt
+ (+ @ Integer
+ $dNum_a5hkz
+ byte_off1_a5gVP
+ (toInteger
+ @ Int
+ $dIntegral_a5hkB
+ byte_off_a5gVG))
+ rep_a5gVN))
+ n_d5hFa)))
+ }
+ }
+ }
+ }
+ }
+ };
+ CmmStackSlot area_a5gVL off_a5gVM ->
+ GHC.Cmm.Expr.$WCmmStackSlot
+ area_a5gVL (- @ Int $dNum_a5hkx off_a5gVM byte_off_a5gVG);
+ CmmRegOff reg_a5gVI m_a5gVJ ->
+ cmmRegOff reg_a5gVI (+ @ Int $dNum_a5hkv m_a5gVJ byte_off_a5gVG)
+ } } in
+ case ds_d5hEC of wild_00 { ghc-prim-0.6.1:GHC.Types.I# ds_d5hID ->
+ case ds_d5hID of ds_d5hID {
+ __DEFAULT -> fail_d5hIE ghc-prim-0.6.1:GHC.Prim.void#;
+ 0# -> e_a5gVD
+ }
+ }
+
+-- RHS size: {terms: 12, types: 5, coercions: 0, joins: 0/0}
+cmmIndex :: Platform -> Width -> CmmExpr -> Int -> CmmExpr
+[LclIdX]
+cmmIndex
+ = \ (platform_a5gWc :: Platform)
+ (width_a5gWd :: Width)
+ (base_a5gWe :: CmmExpr)
+ (idx_a5gWf :: Int) ->
+ cmmOffset
+ platform_a5gWc
+ base_a5gWe
+ (* @ Int $dNum_a5hkK idx_a5gWf (widthInBytes width_a5gWd))
+
+-- RHS size: {terms: 12, types: 4, coercions: 0, joins: 0/0}
+cmmLoadIndex :: Platform -> CmmType -> CmmExpr -> Int -> CmmExpr
+[LclIdX]
+cmmLoadIndex
+ = \ (platform_a5gWq :: Platform)
+ (ty_a5gWr :: CmmType)
+ (expr_a5gWs :: CmmExpr)
+ (ix_a5gWt :: Int) ->
+ GHC.Cmm.Expr.$WCmmLoad
+ (cmmIndex platform_a5gWq (typeWidth ty_a5gWr) expr_a5gWs ix_a5gWt)
+ ty_a5gWr
+
+-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
+cmmOffsetB :: Platform -> CmmExpr -> ByteOff -> CmmExpr
+[LclIdX]
+cmmOffsetB = cmmOffset
+
+-- RHS size: {terms: 10, types: 4, coercions: 0, joins: 0/0}
+cmmOffsetW :: Platform -> CmmExpr -> WordOff -> CmmExpr
+[LclIdX]
+cmmOffsetW
+ = \ (platform_a5gWA :: Platform)
+ (e_a5gWB :: CmmExpr)
+ (n_a5gWC :: WordOff) ->
+ cmmOffsetB
+ platform_a5gWA
+ e_a5gWB
+ (wordsToBytes @ WordOff $dNum_a5hkP platform_a5gWA n_a5gWC)
+
+-- RHS size: {terms: 10, types: 4, coercions: 0, joins: 0/0}
+cmmLoadIndexW :: Platform -> CmmExpr -> Int -> CmmType -> CmmExpr
+[LclIdX]
+cmmLoadIndexW
+ = \ (platform_a5gWM :: Platform)
+ (base_a5gWN :: CmmExpr)
+ (off_a5gWO :: Int)
+ (ty_a5gWP :: CmmType) ->
+ GHC.Cmm.Expr.$WCmmLoad
+ (cmmOffsetW platform_a5gWM base_a5gWN off_a5gWO) ty_a5gWP
+
+-- RHS size: {terms: 43, types: 22, coercions: 0, joins: 0/4}
+cmmOffsetExpr :: Platform -> CmmExpr -> CmmExpr -> CmmExpr
+[LclIdX]
+cmmOffsetExpr
+ = \ (platform_a5gVw :: Platform)
+ (e_a5gVx :: CmmExpr)
+ (ds_d5hIG :: CmmExpr) ->
+ let {
+ platform_a5gVz :: Platform
+ [LclId]
+ platform_a5gVz = platform_a5gVw } in
+ let {
+ e_a5gVA :: CmmExpr
+ [LclId]
+ e_a5gVA = e_a5gVx } in
+ let {
+ byte_off_a5gVB :: CmmExpr
+ [LclId]
+ byte_off_a5gVB = ds_d5hIG } in
+ let {
+ fail_d5hJz :: ghc-prim-0.6.1:GHC.Prim.Void# -> CmmExpr
+ [LclId]
+ fail_d5hJz
+ = \ (ds_d5hJA [OS=OneShot] :: ghc-prim-0.6.1:GHC.Prim.Void#) ->
+ GHC.Cmm.Expr.CmmMachOp
+ (GHC.Cmm.MachOp.MO_Add (cmmExprWidth platform_a5gVz e_a5gVA))
+ (GHC.Base.build
+ @ CmmExpr
+ (\ (@ a_d5hIN)
+ (c_d5hIO :: CmmExpr -> a_d5hIN -> a_d5hIN)
+ (n_d5hIP :: a_d5hIN) ->
+ c_d5hIO e_a5gVA (c_d5hIO byte_off_a5gVB n_d5hIP))) } in
+ case ds_d5hIG of wild_00 {
+ __DEFAULT -> fail_d5hJz ghc-prim-0.6.1:GHC.Prim.void#;
+ CmmLit ds_d5hJx ->
+ case ds_d5hJx of wild_00 {
+ __DEFAULT -> fail_d5hJz ghc-prim-0.6.1:GHC.Prim.void#;
+ CmmInt n_a5gVy ds_d5hJy ->
+ cmmOffset
+ platform_a5gVw e_a5gVx (fromInteger @ Int $dNum_a5hkT n_a5gVy)
+ }
+ }
+
+-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
+cmmOffsetExprB :: Platform -> CmmExpr -> CmmExpr -> CmmExpr
+[LclIdX]
+cmmOffsetExprB = cmmOffsetExpr
+
+-- RHS size: {terms: 4, types: 1, coercions: 0, joins: 0/0}
+mkLblExpr :: CLabel -> CmmExpr
+[LclIdX]
+mkLblExpr
+ = \ (lbl_a5gVv :: CLabel) ->
+ GHC.Cmm.Expr.CmmLit (GHC.Cmm.Expr.CmmLabel lbl_a5gVv)
+
+-- RHS size: {terms: 7, types: 2, coercions: 0, joins: 0/0}
+mkStgWordCLit :: Platform -> StgWord -> CmmLit
+[LclIdX]
+mkStgWordCLit
+ = \ (platform_a5gVo :: Platform) (wd_a5gVp :: StgWord) ->
+ GHC.Cmm.Expr.$WCmmInt
+ (fromStgWord wd_a5gVp) (wordWidth platform_a5gVo)
+
+-- RHS size: {terms: 14, types: 21, coercions: 0, joins: 0/0}
+mkDataLits
+ :: forall (raw :: Bool) info stmt.
+ Section
+ -> CLabel -> [CmmLit] -> GenCmmDecl (GenCmmStatics raw) info stmt
+[LclIdX]
+mkDataLits
+ = \ (@ (raw_a5hkX :: Bool))
+ (@ info_a5hkY)
+ (@ stmt_a5hkZ)
+ (section_a5gVh :: Section)
+ (lbl_a5gVi :: CLabel)
+ (lits_a5gVj :: [CmmLit]) ->
+ GHC.Cmm.CmmData
+ @ (GenCmmStatics raw_a5hkX)
+ @ info_a5hkY
+ @ stmt_a5hkZ
+ section_a5gVh
+ ($ @ 'ghc-prim-0.6.1:GHC.Types.LiftedRep
+ @ [CmmStatic]
+ @ (GenCmmStatics raw_a5hkX)
+ (GHC.Cmm.CmmStaticsRaw @ raw_a5hkX lbl_a5gVi)
+ (map @ CmmLit @ CmmStatic GHC.Cmm.CmmStaticLit lits_a5gVj))
+
+-- RHS size: {terms: 45, types: 32, coercions: 0, joins: 0/6}
+mkRODataLits
+ :: forall (raw :: Bool) info stmt.
+ CLabel -> [CmmLit] -> GenCmmDecl (GenCmmStatics raw) info stmt
+[LclIdX]
+mkRODataLits
+ = \ (@ (raw_a5hld :: Bool)) (@ info_a5hle) (@ stmt_a5hlf) ->
+ let {
+ $dFoldable_a5hly :: Foldable []
+ [LclId]
+ $dFoldable_a5hly = $dFoldable_a5hdz } in
+ \ (lbl_a5gVk :: CLabel) (lits_a5gVl :: [CmmLit]) ->
+ letrec {
+ needsRelocation_a5gVn :: CmmLit -> Bool
+ [LclId]
+ needsRelocation_a5gVn
+ = letrec {
+ needsRelocation_a5hlp :: CmmLit -> Bool
+ [LclId]
+ needsRelocation_a5hlp
+ = \ (ds_d5hJJ :: CmmLit) ->
+ let {
+ fail_d5hKp :: ghc-prim-0.6.1:GHC.Prim.Void# -> Bool
+ [LclId]
+ fail_d5hKp
+ = \ (ds_d5hKq [OS=OneShot] :: ghc-prim-0.6.1:GHC.Prim.Void#) ->
+ ghc-prim-0.6.1:GHC.Types.False } in
+ case ds_d5hJJ of wild_00 {
+ __DEFAULT -> fail_d5hKp ghc-prim-0.6.1:GHC.Prim.void#;
+ CmmLabel ds_d5hKm -> ghc-prim-0.6.1:GHC.Types.True;
+ CmmLabelOff ds_d5hKn ds_d5hKo -> ghc-prim-0.6.1:GHC.Types.True
+ }; } in
+ needsRelocation_a5hlp; } in
+ letrec {
+ section_a5gVm :: Section
+ [LclId]
+ section_a5gVm
+ = let {
+ fail_d5hJH :: ghc-prim-0.6.1:GHC.Prim.Void# -> Section
+ [LclId]
+ fail_d5hJH
+ = \ (ds_d5hJI [OS=OneShot] :: ghc-prim-0.6.1:GHC.Prim.Void#) ->
+ GHC.Cmm.Section GHC.Cmm.ReadOnlyData lbl_a5gVk } in
+ case any
+ @ [] @ CmmLit $dFoldable_a5hly needsRelocation_a5gVn lits_a5gVl
+ of wild_00 {
+ False -> fail_d5hJH ghc-prim-0.6.1:GHC.Prim.void#;
+ True -> GHC.Cmm.Section GHC.Cmm.RelocatableReadOnlyData lbl_a5gVk
+ }; } in
+ mkDataLits
+ @ raw_a5hld
+ @ info_a5hle
+ @ stmt_a5hlf
+ section_a5gVm
+ lbl_a5gVk
+ lits_a5gVl
+
+-- RHS size: {terms: 22, types: 25, coercions: 0, joins: 0/0}
+mkFileEmbedLit
+ :: forall (raw :: Bool) info stmt.
+ CLabel
+ -> FilePath -> (CmmLit, GenCmmDecl (GenCmmStatics raw) info stmt)
+[LclIdX]
+mkFileEmbedLit
+ = \ (@ (raw_a5hlE :: Bool))
+ (@ info_a5hlF)
+ (@ stmt_a5hlG)
+ (lbl_a5gVf :: CLabel)
+ (path_a5gVg :: FilePath) ->
+ (GHC.Cmm.Expr.CmmLabel lbl_a5gVf,
+ GHC.Cmm.CmmData
+ @ (GenCmmStatics raw_a5hlE)
+ @ info_a5hlF
+ @ stmt_a5hlG
+ (GHC.Cmm.Section GHC.Cmm.ReadOnlyData lbl_a5gVf)
+ (GHC.Cmm.CmmStaticsRaw
+ @ raw_a5hlE
+ lbl_a5gVf
+ (GHC.Base.build
+ @ CmmStatic
+ (\ (@ a_d5hKr)
+ (c_d5hKs :: CmmStatic -> a_d5hKr -> a_d5hKr)
+ (n_d5hKt :: a_d5hKr) ->
+ c_d5hKs (GHC.Cmm.CmmFileEmbed path_a5gVg) n_d5hKt))))
+
+-- RHS size: {terms: 36, types: 38, coercions: 0, joins: 0/2}
+mkByteStringCLit
+ :: forall (raw :: Bool) info stmt.
+ CLabel
+ -> ByteString -> (CmmLit, GenCmmDecl (GenCmmStatics raw) info stmt)
+[LclIdX]
+mkByteStringCLit
+ = \ (@ (raw_a5hlM :: Bool)) (@ info_a5hlN) (@ stmt_a5hlO) ->
+ let {
+ $dNum_a5hlV :: Num GHC.Word.Word8
+ [LclId]
+ $dNum_a5hlV = GHC.Word.$fNumWord8 } in
+ \ (lbl_a5gVc :: CLabel) (bytes_a5gVd :: ByteString) ->
+ letrec {
+ sec_a5gVe :: SectionType
+ [LclId]
+ sec_a5gVe
+ = case BS.elem
+ (fromInteger @ GHC.Word.Word8 $dNum_a5hlV 0) bytes_a5gVd
+ of wild_00 {
+ False -> GHC.Cmm.CString;
+ True -> GHC.Cmm.ReadOnlyData
+ }; } in
+ (GHC.Cmm.Expr.CmmLabel lbl_a5gVc,
+ $ @ 'ghc-prim-0.6.1:GHC.Types.LiftedRep
+ @ (GenCmmStatics raw_a5hlM)
+ @ (GenCmmDecl (GenCmmStatics raw_a5hlM) info_a5hlN stmt_a5hlO)
+ (GHC.Cmm.CmmData
+ @ (GenCmmStatics raw_a5hlM)
+ @ info_a5hlN
+ @ stmt_a5hlO
+ (GHC.Cmm.Section sec_a5gVe lbl_a5gVc))
+ (GHC.Cmm.CmmStaticsRaw
+ @ raw_a5hlM
+ lbl_a5gVc
+ (GHC.Base.build
+ @ CmmStatic
+ (\ (@ a_d5hKu)
+ (c_d5hKv :: CmmStatic -> a_d5hKu -> a_d5hKu)
+ (n_d5hKw :: a_d5hKu) ->
+ c_d5hKv (GHC.Cmm.CmmString bytes_a5gVd) n_d5hKw))))
+
+-- RHS size: {terms: 6, types: 2, coercions: 0, joins: 0/0}
+mkWordCLit :: Platform -> Integer -> CmmLit
+[LclIdX]
+mkWordCLit
+ = \ (platform_a5gVa :: Platform) (wd_a5gVb :: Integer) ->
+ GHC.Cmm.Expr.$WCmmInt wd_a5gVb (wordWidth platform_a5gVa)
+
+-- RHS size: {terms: 36, types: 11, coercions: 0, joins: 0/3}
+packHalfWordsCLit
+ :: Platform -> StgHalfWord -> StgHalfWord -> CmmLit
+[LclIdX]
+packHalfWordsCLit
+ = \ (platform_a5gVq :: Platform)
+ (lower_half_word_a5gVr :: StgHalfWord)
+ (upper_half_word_a5gVs :: StgHalfWord) ->
+ letrec {
+ u_a5gVu :: Integer
+ [LclId]
+ u_a5gVu = fromStgHalfWord upper_half_word_a5gVs; } in
+ letrec {
+ l_a5gVt :: Integer
+ [LclId]
+ l_a5gVt = fromStgHalfWord lower_half_word_a5gVr; } in
+ let {
+ ds_d5hKx :: ByteOrder
+ [LclId]
+ ds_d5hKx = platformByteOrder platform_a5gVq } in
+ case ds_d5hKx of wild_00 {
+ BigEndian ->
+ mkWordCLit
+ platform_a5gVq
+ (.|.
+ @ Integer
+ $dBits_a5hmj
+ (shiftL
+ @ Integer $dBits_a5hml l_a5gVt (halfWordSizeInBits platform_a5gVq))
+ u_a5gVu);
+ LittleEndian ->
+ mkWordCLit
+ platform_a5gVq
+ (.|.
+ @ Integer
+ $dBits_a5hmn
+ l_a5gVt
+ (shiftL
+ @ Integer
+ $dBits_a5hmp
+ u_a5gVu
+ (halfWordSizeInBits platform_a5gVq)))
+ }
+
+-- RHS size: {terms: 5, types: 1, coercions: 0, joins: 0/0}
+zeroCLit :: Platform -> CmmLit
+[LclIdX]
+zeroCLit
+ = \ (platform_a5gV8 :: Platform) ->
+ GHC.Cmm.Expr.$WCmmInt 0 (wordWidth platform_a5gV8)
+
+-- RHS size: {terms: 4, types: 1, coercions: 0, joins: 0/0}
+zeroExpr :: Platform -> CmmExpr
+[LclIdX]
+zeroExpr
+ = \ (platform_a5gV9 :: Platform) ->
+ GHC.Cmm.Expr.CmmLit (zeroCLit platform_a5gV9)
+
+-- RHS size: {terms: 8, types: 3, coercions: 0, joins: 0/0}
+mkIntCLit :: Platform -> Int -> CmmLit
+[LclIdX]
+mkIntCLit
+ = \ (platform_a5gV4 :: Platform) (i_a5gV5 :: Int) ->
+ GHC.Cmm.Expr.$WCmmInt
+ (toInteger @ Int $dIntegral_a5hmu i_a5gV5)
+ (wordWidth platform_a5gV4)
+
+-- RHS size: {terms: 7, types: 5, coercions: 0, joins: 0/0}
+mkIntExpr :: Platform -> Int -> CmmExpr
+[LclIdX]
+mkIntExpr
+ = \ (platform_a5gV6 :: Platform) (i_a5gV7 :: Int) ->
+ $!
+ @ 'ghc-prim-0.6.1:GHC.Types.LiftedRep
+ @ CmmLit
+ @ CmmExpr
+ GHC.Cmm.Expr.CmmLit
+ (mkIntCLit platform_a5gV6 i_a5gV7)
+
+-- RHS size: {terms: 57, types: 26, coercions: 0, joins: 0/7}
+cmmIndexExpr :: Platform -> Width -> CmmExpr -> CmmExpr -> CmmExpr
+[LclIdX]
+cmmIndexExpr
+ = \ (platform_a5gWg :: Platform)
+ (width_a5gWh :: Width)
+ (base_a5gWi :: CmmExpr)
+ (ds_d5hKJ :: CmmExpr) ->
+ let {
+ platform_a5gWk :: Platform
+ [LclId]
+ platform_a5gWk = platform_a5gWg } in
+ let {
+ width_a5gWl :: Width
+ [LclId]
+ width_a5gWl = width_a5gWh } in
+ let {
+ base_a5gWm :: CmmExpr
+ [LclId]
+ base_a5gWm = base_a5gWi } in
+ let {
+ idx_a5gWn :: CmmExpr
+ [LclId]
+ idx_a5gWn = ds_d5hKJ } in
+ let {
+ fail_d5hLC :: ghc-prim-0.6.1:GHC.Prim.Void# -> CmmExpr
+ [LclId]
+ fail_d5hLC
+ = \ (ds_d5hLD [OS=OneShot] :: ghc-prim-0.6.1:GHC.Prim.Void#) ->
+ letrec {
+ idx_w_a5gWo :: Width
+ [LclId]
+ idx_w_a5gWo = cmmExprWidth platform_a5gWk idx_a5gWn; } in
+ letrec {
+ byte_off_a5gWp :: CmmExpr
+ [LclId]
+ byte_off_a5gWp
+ = GHC.Cmm.Expr.CmmMachOp
+ (GHC.Cmm.MachOp.MO_Shl idx_w_a5gWo)
+ (GHC.Base.build
+ @ CmmExpr
+ (\ (@ a_d5hLz)
+ (c_d5hLA :: CmmExpr -> a_d5hLz -> a_d5hLz)
+ (n_d5hLB :: a_d5hLz) ->
+ c_d5hLA
+ idx_a5gWn
+ (c_d5hLA
+ (mkIntExpr platform_a5gWk (widthInLog width_a5gWl))
+ n_d5hLB))); } in
+ cmmOffsetExpr platform_a5gWk base_a5gWm byte_off_a5gWp } in
+ case ds_d5hKJ of wild_00 {
+ __DEFAULT -> fail_d5hLC ghc-prim-0.6.1:GHC.Prim.void#;
+ CmmLit ds_d5hLx ->
+ case ds_d5hLx of wild_00 {
+ __DEFAULT -> fail_d5hLC ghc-prim-0.6.1:GHC.Prim.void#;
+ CmmInt n_a5gWj ds_d5hLy ->
+ cmmIndex
+ platform_a5gWg
+ width_a5gWh
+ base_a5gWi
+ (fromInteger @ Int $dNum_a5hmB n_a5gWj)
+ }
+ }
+
+-- RHS size: {terms: 35, types: 15, coercions: 0, joins: 0/4}
+cmmOffsetExprW :: Platform -> CmmExpr -> CmmExpr -> CmmExpr
+[LclIdX]
+cmmOffsetExprW
+ = \ (platform_a5gWu :: Platform)
+ (e_a5gWv :: CmmExpr)
+ (ds_d5hLE :: CmmExpr) ->
+ let {
+ platform_a5gWx :: Platform
+ [LclId]
+ platform_a5gWx = platform_a5gWu } in
+ let {
+ e_a5gWy :: CmmExpr
+ [LclId]
+ e_a5gWy = e_a5gWv } in
+ let {
+ wd_off_a5gWz :: CmmExpr
+ [LclId]
+ wd_off_a5gWz = ds_d5hLE } in
+ let {
+ fail_d5hMu :: ghc-prim-0.6.1:GHC.Prim.Void# -> CmmExpr
+ [LclId]
+ fail_d5hMu
+ = \ (ds_d5hMv [OS=OneShot] :: ghc-prim-0.6.1:GHC.Prim.Void#) ->
+ cmmIndexExpr
+ platform_a5gWx (wordWidth platform_a5gWx) e_a5gWy wd_off_a5gWz } in
+ case ds_d5hLE of wild_00 {
+ __DEFAULT -> fail_d5hMu ghc-prim-0.6.1:GHC.Prim.void#;
+ CmmLit ds_d5hMs ->
+ case ds_d5hMs of wild_00 {
+ __DEFAULT -> fail_d5hMu ghc-prim-0.6.1:GHC.Prim.void#;
+ CmmInt n_a5gWw ds_d5hMt ->
+ cmmOffsetW
+ platform_a5gWu e_a5gWv (fromInteger @ WordOff $dNum_a5hmM n_a5gWw)
+ }
+ }
+
+-- RHS size: {terms: 5, types: 1, coercions: 0, joins: 0/0}
+cmmTagMask :: Platform -> CmmExpr
+[LclIdX]
+cmmTagMask
+ = \ (platform_a5gXK :: Platform) ->
+ mkIntExpr platform_a5gXK (tAG_MASK platform_a5gXK)
+
+-- RHS size: {terms: 11, types: 2, coercions: 0, joins: 0/0}
+cmmIsTagged :: Platform -> CmmExpr -> CmmExpr
+[LclIdX]
+cmmIsTagged
+ = \ (platform_a5gXP :: Platform) (e_a5gXQ :: CmmExpr) ->
+ cmmNeWord
+ platform_a5gXP
+ (cmmAndWord platform_a5gXP e_a5gXQ (cmmTagMask platform_a5gXP))
+ (zeroExpr platform_a5gXP)
+
+-- RHS size: {terms: 11, types: 2, coercions: 0, joins: 0/0}
+cmmIsNotTagged :: Platform -> CmmExpr -> CmmExpr
+[LclIdX]
+cmmIsNotTagged
+ = \ (platform_a5gXR :: Platform) (e_a5gXS :: CmmExpr) ->
+ cmmEqWord
+ platform_a5gXR
+ (cmmAndWord platform_a5gXR e_a5gXS (cmmTagMask platform_a5gXR))
+ (zeroExpr platform_a5gXR)
+
+-- RHS size: {terms: 7, types: 2, coercions: 0, joins: 0/0}
+cmmConstrTag1 :: Platform -> CmmExpr -> CmmExpr
+[LclIdX]
+cmmConstrTag1
+ = \ (platform_a5gXT :: Platform) (e_a5gXU :: CmmExpr) ->
+ cmmAndWord platform_a5gXT e_a5gXU (cmmTagMask platform_a5gXT)
+
+-- RHS size: {terms: 7, types: 2, coercions: 0, joins: 0/0}
+cmmPointerMask :: Platform -> CmmExpr
+[LclIdX]
+cmmPointerMask
+ = \ (platform_a5gXL :: Platform) ->
+ mkIntExpr
+ platform_a5gXL
+ (complement @ Int $dBits_a5hmT (tAG_MASK platform_a5gXL))
+
+-- RHS size: {terms: 26, types: 11, coercions: 0, joins: 0/3}
+cmmUntag :: Platform -> CmmExpr -> CmmExpr
+[LclIdX]
+cmmUntag
+ = \ (ds_d5hMw :: Platform) (e_a5gXM :: CmmExpr) ->
+ let {
+ platform_a5gXN :: Platform
+ [LclId]
+ platform_a5gXN = ds_d5hMw } in
+ let {
+ e_a5gXO :: CmmExpr
+ [LclId]
+ e_a5gXO = e_a5gXM } in
+ let {
+ fail_d5hNt :: ghc-prim-0.6.1:GHC.Prim.Void# -> CmmExpr
+ [LclId]
+ fail_d5hNt
+ = \ (ds_d5hNu [OS=OneShot] :: ghc-prim-0.6.1:GHC.Prim.Void#) ->
+ cmmAndWord
+ platform_a5gXN e_a5gXO (cmmPointerMask platform_a5gXN) } in
+ case e_a5gXM of wild_00 {
+ __DEFAULT -> fail_d5hNt ghc-prim-0.6.1:GHC.Prim.void#;
+ CmmLit ds_d5hNr ->
+ case ds_d5hNr of wild_00 {
+ __DEFAULT -> fail_d5hNt ghc-prim-0.6.1:GHC.Prim.void#;
+ CmmLabel ds_d5hNs -> e_a5gXM
+ }
+ }
+
+-- RHS size: {terms: 13, types: 2, coercions: 0, joins: 0/0}
+slotForeignHint :: SlotTy -> ForeignHint
+[LclIdX]
+slotForeignHint
+ = \ (ds_d5hNv :: SlotTy) ->
+ case ds_d5hNv of wild_00 {
+ PtrSlot -> GHC.Cmm.Type.AddrHint;
+ WordSlot -> GHC.Cmm.Type.NoHint;
+ Word64Slot -> GHC.Cmm.Type.NoHint;
+ FloatSlot -> GHC.Cmm.Type.NoHint;
+ DoubleSlot -> GHC.Cmm.Type.NoHint
+ }
+
+-- RHS size: {terms: 39, types: 5, coercions: 0, joins: 0/0}
+primRepForeignHint :: PrimRep -> ForeignHint
+[LclIdX]
+primRepForeignHint
+ = \ (ds_d5hNK :: PrimRep) ->
+ case ds_d5hNK of wild_00 {
+ VoidRep ->
+ panic
+ @ ForeignHint
+ (ghc-prim-0.6.1:GHC.CString.unpackCString#
+ "primRepForeignHint:VoidRep"#);
+ LiftedRep -> GHC.Cmm.Type.AddrHint;
+ UnliftedRep -> GHC.Cmm.Type.AddrHint;
+ Int8Rep -> GHC.Cmm.Type.SignedHint;
+ Int16Rep -> GHC.Cmm.Type.SignedHint;
+ Int32Rep -> GHC.Cmm.Type.SignedHint;
+ Int64Rep -> GHC.Cmm.Type.SignedHint;
+ IntRep -> GHC.Cmm.Type.SignedHint;
+ Word8Rep -> GHC.Cmm.Type.NoHint;
+ Word16Rep -> GHC.Cmm.Type.NoHint;
+ Word32Rep -> GHC.Cmm.Type.NoHint;
+ Word64Rep -> GHC.Cmm.Type.NoHint;
+ WordRep -> GHC.Cmm.Type.NoHint;
+ AddrRep -> GHC.Cmm.Type.AddrHint;
+ FloatRep -> GHC.Cmm.Type.NoHint;
+ DoubleRep -> GHC.Cmm.Type.NoHint;
+ VecRep ds_d5hOt ds_d5hOu -> GHC.Cmm.Type.NoHint
+ }
+
+-- RHS size: {terms: 4, types: 3, coercions: 0, joins: 0/0}
+typeForeignHint :: UnaryType -> ForeignHint
+[LclIdX]
+typeForeignHint
+ = . @ PrimRep
+ @ ForeignHint
+ @ UnaryType
+ primRepForeignHint
+ (typePrimRep1 $d(%%)_a5hn2)
+
+-- RHS size: {terms: 23, types: 2, coercions: 0, joins: 0/0}
+primElemRepCmmType :: PrimElemRep -> CmmType
+[LclIdX]
+primElemRepCmmType
+ = \ (ds_d5hOv :: PrimElemRep) ->
+ case ds_d5hOv of wild_00 {
+ Int8ElemRep -> b8;
+ Int16ElemRep -> b16;
+ Int32ElemRep -> b32;
+ Int64ElemRep -> b64;
+ Word8ElemRep -> b8;
+ Word16ElemRep -> b16;
+ Word32ElemRep -> b32;
+ Word64ElemRep -> b64;
+ FloatElemRep -> f32;
+ DoubleElemRep -> f64
+ }
+
+-- RHS size: {terms: 16, types: 3, coercions: 0, joins: 0/0}
+slotCmmType :: Platform -> SlotTy -> CmmType
+[LclIdX]
+slotCmmType
+ = \ (platform_a5gV1 :: Platform) (ds_d5hOU :: SlotTy) ->
+ case ds_d5hOU of wild_00 {
+ PtrSlot -> gcWord platform_a5gV1;
+ WordSlot -> bWord platform_a5gV1;
+ Word64Slot -> b64;
+ FloatSlot -> f32;
+ DoubleSlot -> f64
+ }
+
+-- RHS size: {terms: 48, types: 6, coercions: 0, joins: 0/0}
+primRepCmmType :: Platform -> PrimRep -> CmmType
+[LclIdX]
+primRepCmmType
+ = \ (platform_a5gUY :: Platform) (ds_d5hP9 :: PrimRep) ->
+ case ds_d5hP9 of wild_00 {
+ VoidRep ->
+ panic
+ @ CmmType
+ (ghc-prim-0.6.1:GHC.CString.unpackCString#
+ "primRepCmmType:VoidRep"#);
+ LiftedRep -> gcWord platform_a5gUY;
+ UnliftedRep -> gcWord platform_a5gUY;
+ Int8Rep -> b8;
+ Int16Rep -> b16;
+ Int32Rep -> b32;
+ Int64Rep -> b64;
+ IntRep -> bWord platform_a5gUY;
+ Word8Rep -> b8;
+ Word16Rep -> b16;
+ Word32Rep -> b32;
+ Word64Rep -> b64;
+ WordRep -> bWord platform_a5gUY;
+ AddrRep -> bWord platform_a5gUY;
+ FloatRep -> f32;
+ DoubleRep -> f64;
+ VecRep len_a5gUZ rep_a5gV0 ->
+ vec len_a5gUZ (primElemRepCmmType rep_a5gV0)
+ }
+
+-- RHS size: {terms: 7, types: 2, coercions: 0, joins: 0/0}
+typeCmmType :: Platform -> UnaryType -> CmmType
+[LclIdX]
+typeCmmType
+ = \ (platform_a5gV2 :: Platform) (ty_a5gV3 :: UnaryType) ->
+ primRepCmmType platform_a5gV2 (typePrimRep1 $d(%%)_a5hn8 ty_a5gV3)
+end Rec }
+
+
diff --git a/compiler/GHC/Cmm/Utils.hs b/compiler/GHC/Cmm/Utils.hs
index 356fb4e138..38872f3f49 100644
--- a/compiler/GHC/Cmm/Utils.hs
+++ b/compiler/GHC/Cmm/Utils.hs
@@ -4,6 +4,7 @@
{-# OPTIONS_GHC -Wno-incomplete-uni-patterns #-}
+
-----------------------------------------------------------------------------
--
-- Cmm utilities.
@@ -47,7 +48,7 @@ module GHC.Cmm.Utils(
currentTSOExpr, currentNurseryExpr, cccsExpr,
-- Tagging
- cmmTagMask, cmmPointerMask, cmmUntag, cmmIsTagged,
+ cmmTagMask, cmmPointerMask, cmmUntag, cmmIsTagged, cmmIsNotTagged,
cmmConstrTag1, mAX_PTR_TAG, tAG_MASK,
-- Overlap and usage
@@ -441,13 +442,14 @@ cmmPointerMask platform = mkIntExpr platform (complement (tAG_MASK platform))
-- Used to untag a possibly tagged pointer
-- A static label need not be untagged
-cmmUntag, cmmIsTagged, cmmConstrTag1 :: Platform -> CmmExpr -> CmmExpr
+cmmUntag, cmmIsTagged, cmmIsNotTagged, cmmConstrTag1 :: Platform -> CmmExpr -> CmmExpr
cmmUntag _ e@(CmmLit (CmmLabel _)) = e
-- Default case
cmmUntag platform e = cmmAndWord platform e (cmmPointerMask platform)
-- Test if a closure pointer is untagged
cmmIsTagged platform e = cmmNeWord platform (cmmAndWord platform e (cmmTagMask platform)) (zeroExpr platform)
+cmmIsNotTagged platform e = cmmEqWord platform (cmmAndWord platform e (cmmTagMask platform)) (zeroExpr platform)
-- Get constructor tag, but one based.
cmmConstrTag1 platform e = cmmAndWord platform e (cmmTagMask platform)
diff --git a/compiler/GHC/Core/DataCon.hs b/compiler/GHC/Core/DataCon.hs
index adbdc144c3..9f71a59db9 100644
--- a/compiler/GHC/Core/DataCon.hs
+++ b/compiler/GHC/Core/DataCon.hs
@@ -60,7 +60,11 @@ module GHC.Core.DataCon (
specialPromotedDc,
-- ** Promotion related functions
- promoteDataCon
+ promoteDataCon,
+
+ -- ** Utility functions
+ getStrictConArgs, mapStrictConArgs
+
) where
#include "HsVersions.h"
@@ -1590,3 +1594,29 @@ splitDataProductType_maybe ty
= Just (tycon, ty_args, con, dataConInstArgTys con ty_args)
| otherwise
= Nothing
+
+{-
+************************************************************************
+* *
+ Data con utility functions
+* *
+************************************************************************
+-}
+
+-- | Given a DataCon and list of args passed to it, return the ids we expect to be strict.
+-- We use this to determine which of these require evaluation
+-- MkT A1 !A2 A3
+-- getStrictConArgs MkT [1,2,3] = [2]
+getStrictConArgs :: DataCon -> [a] -> [a]
+getStrictConArgs con args =
+ filterByList strictArgs args
+ where
+ strictArgs = map isMarkedStrict $ dataConRepStrictness con
+
+-- | MkT A1 !A2 A3
+-- mapStrictConArgs MkT not [True,True,True] = [True,False,True]
+mapStrictConArgs :: DataCon -> (a -> a) -> [a] -> [a]
+mapStrictConArgs con f args =
+ zipWith (\arg s -> if isMarkedStrict s then f arg else arg) args conReps
+ where
+ conReps = dataConRepStrictness con
diff --git a/compiler/GHC/Core/Make.hs b/compiler/GHC/Core/Make.hs
index 6d6dd38b29..862b25a147 100644
--- a/compiler/GHC/Core/Make.hs
+++ b/compiler/GHC/Core/Make.hs
@@ -999,15 +999,39 @@ It might seem a bit surprising that seq on absentError is simply erased
but that should be okay; since there's no pattern match we can't really
be relying on anything from it.
+
+We also want to give absentError a special strictness signature.
+This allows us to determine if a binding is just an absentError for imported
+ids. Especially when we don't have an unfolding or when there is an indirection
+involved.
+
+Why do we do this? Tag inference - See Note [Tag Inferrence - The basic idea]
+in GHC.STG.InferTags - relies critically on being able to reenter closures in
+order to tag them. Reentering a closure is always legal *except* in the case
+of absentError. In which case it will kill the program. We solve this as follows:
+
+If the use and definition site is the same the inference can just look at the
+functions key to check for absentError, just like the simplifier does.
+
+But if definition and use site are different modules the rhs might not be exposed.
+We solve this by giving `impossible` the "Absent" divergence property. In turn any
+binding that is a direct (or indirect) call to `impossible` will get the same
+property. And we can just check bindings for this during tag inference and things
+work out.
+
+These bindings are also constructed by the compiler itself. So their shape is fairly
+predictable and we can be sure that demand analysis will deal with them properly.
+
-}
aBSENT_ERROR_ID
- = mkVanillaGlobalWithInfo absentErrorName absent_ty arity_info
+ = mkVanillaGlobalWithInfo absentErrorName absent_ty id_info
where
absent_ty = mkSpecForAllTys [alphaTyVar] (mkVisFunTyMany addrPrimTy alphaTy)
-- Not runtime-rep polymorphic. aBSENT_ERROR_ID is only used for
-- lifted-type things; see Note [Absent errors] in GHC.Core.Opt.WorkWrap.Utils
- arity_info = vanillaIdInfo `setArityInfo` 1
+ id_info = vanillaIdInfo `setArityInfo` 1
+ `setStrictnessInfo` mkClosedStrictSig [seqDmd] Absent
-- NB: no bottoming strictness info, unlike other error-ids.
-- See Note [aBSENT_ERROR_ID]
diff --git a/compiler/GHC/Core/Opt/Arity.hs b/compiler/GHC/Core/Opt/Arity.hs
index fed664d6fb..284368962d 100644
--- a/compiler/GHC/Core/Opt/Arity.hs
+++ b/compiler/GHC/Core/Opt/Arity.hs
@@ -569,6 +569,7 @@ instance Outputable ArityType where
pp_div Diverges = char '⊥'
pp_div ExnOrDiv = char 'x'
pp_div Dunno = char 'T'
+ pp_div Absent = char 'A'
pp_os OneShotLam = char '1'
pp_os NoOneShotInfo = char '?'
diff --git a/compiler/GHC/Core/Opt/DmdAnal.hs b/compiler/GHC/Core/Opt/DmdAnal.hs
index c8776d8788..42d68aab79 100644
--- a/compiler/GHC/Core/Opt/DmdAnal.hs
+++ b/compiler/GHC/Core/Opt/DmdAnal.hs
@@ -44,6 +44,9 @@ import GHC.Builtin.PrimOps
import GHC.Builtin.Types.Prim ( realWorldStatePrimTy )
import GHC.Types.Unique.Set
+-- Debugging
+-- import GHC.Driver.Ppr
+
{-
************************************************************************
* *
@@ -169,7 +172,8 @@ dmdAnal' _ _ (Coercion co)
= (unitDmdType (coercionDmdEnv co), Coercion co)
dmdAnal' env dmd (Var var)
- = (dmdTransform env var dmd, Var var)
+ = -- pprTrace "dmdAnalVar" (ppr var <+> (ppr $ dmdTransform env var dmd)) $
+ (dmdTransform env var dmd, Var var)
dmdAnal' env dmd (Cast e co)
= (dmd_ty `bothDmdType` mkBothDmdArg (coercionDmdEnv co), Cast e' co)
@@ -182,7 +186,8 @@ dmdAnal' env dmd (Tick t e)
(dmd_ty, e') = dmdAnal env dmd e
dmdAnal' env dmd (App fun (Type ty))
- = (fun_ty, App fun' (Type ty))
+ = -- pprTrace "dmdAnalAppTy" (ppr fun <+> ppr ty) $
+ (fun_ty, App fun' (Type ty))
where
(fun_ty, fun') = dmdAnal env dmd fun
@@ -297,7 +302,8 @@ dmdAnal' env dmd (Case scrut case_bndr ty alts)
-- This is the LetUp rule in the paper “Higher-Order Cardinality Analysis”.
dmdAnal' env dmd (Let (NonRec id rhs) body)
| useLetUp id
- = (final_ty, Let (NonRec id' rhs') body')
+ = -- pprTrace "LetUpOn" (ppr id)
+ (final_ty, Let (NonRec id' rhs') body')
where
(body_ty, body') = dmdAnal env dmd body
(body_ty', id_dmd) = findBndrDmd env notArgOfDfun body_ty id
@@ -494,17 +500,27 @@ dmdTransform :: AnalEnv -- The strictness environment
dmdTransform env var dmd
-- Data constructors
| isDataConWorkId var
- = dmdTransformDataConSig (idArity var) dmd
+ = -- pprTrace "dmdTransform1" empty $
+ dmdTransformDataConSig (idArity var) dmd
-- Dictionary component selectors
-- Used to be controlled by a flag.
-- See #18429 for some perf measurements.
| Just _ <- isClassOpId_maybe var
- = dmdTransformDictSelSig (idStrictness var) dmd
+ = -- pprTrace "dmdTransform2" empty $
+ dmdTransformDictSelSig (idStrictness var) dmd
-- Imported functions
+ -- | getUnique var == impossibleIdKey
+ -- = panic "impossible"
| isGlobalId var
, let res = dmdTransformSig (idStrictness var) dmd
- = -- pprTrace "dmdTransform:import" (vcat [ppr var, ppr (idStrictness var), ppr dmd, ppr res])
- res
+ =
+ -- pprTrace "dmdTransform:import"
+ -- (vcat [ppr var
+ -- , ppr (idStrictness var)
+ -- , ppr dmd
+ -- , ppr res
+ -- ])
+ res
-- Top-level or local let-bound thing for which we use LetDown ('useLetUp').
-- In that case, we have a strictness signature to unleash in our AnalEnv.
| Just (sig, top_lvl) <- lookupSigEnv env var
@@ -518,7 +534,7 @@ dmdTransform env var dmd
-- * Lambda binders
-- * Case and constructor field binders
| otherwise
- = -- pprTrace "dmdTransform:other" (vcat [ppr var, ppr sig, ppr dmd, ppr res]) $
+ = -- pprTrace "dmdTransform:other" (vcat [ppr var]) $
unitDmdType (unitVarEnv var (mkOnceUsedDmd dmd))
{- *********************************************************************
@@ -548,7 +564,17 @@ dmdAnalRhsLetDown
-- to the Id, and augment the environment with the signature as well.
-- See Note [NOINLINE and strictness]
dmdAnalRhsLetDown rec_flag env let_dmd id rhs
- = (lazy_fv, sig, rhs')
+ =
+ -- pprTrace "dmdAnalRhsLetDown"
+ -- (ppr id $$
+ -- text "sig:" <+> ppr sig $$
+ -- -- text "rhs:" <+> ppr rhs' $$
+ -- text "rhs_dmd" <+> ppr rhs_dmd $$
+ -- -- text "_dmdAnalRes:" <+> ppr _dmdAnalRes $$
+ -- text "div:" <+> ppr rhs_div
+ -- -- text "thunk:" <+> ppr is_thunk
+ -- )
+ (lazy_fv, sig, rhs')
where
rhs_arity = idArity id
rhs_dmd -- See Note [Demand analysis for join points]
diff --git a/compiler/GHC/Core/Opt/Simplify.hs b/compiler/GHC/Core/Opt/Simplify.hs
index d72455c742..e88ec97ab9 100644
--- a/compiler/GHC/Core/Opt/Simplify.hs
+++ b/compiler/GHC/Core/Opt/Simplify.hs
@@ -794,6 +794,7 @@ completeBind env top_lvl mb_cont old_bndr new_bndr new_rhs
addLetBndrInfo :: OutId -> ArityType -> Unfolding -> OutId
addLetBndrInfo new_bndr new_arity_type new_unf
+ | otherwise
= new_bndr `setIdInfo` info5
where
AT oss div = new_arity_type
@@ -2580,6 +2581,8 @@ rebuildCase, reallyRebuildCase
--------------------------------------------------
rebuildCase env scrut case_bndr alts cont
+ -- | pprTrace "rebuildCase" (ppr scrut) False
+ -- = undefined
| Lit lit <- scrut -- No need for same treatment as constructors
-- because literals are inlined more vigorously
, not (litIsLifted lit)
@@ -2708,8 +2711,8 @@ doCaseToLet scrut case_bndr
= exprOkForSpeculation scrut
| otherwise -- Scrut has a lifted type
- = exprIsHNF scrut
- || isStrictDmd (idDemandInfo case_bndr)
+ = --pprTrace "doCaseToLet:" (ppr (scrut, case_bndr)) $
+ exprIsHNF scrut || isStrictDmd (idDemandInfo case_bndr)
-- See Note [Case-to-let for strictly-used binders]
--------------------------------------------------
diff --git a/compiler/GHC/Core/Opt/WorkWrap/Utils.hs b/compiler/GHC/Core/Opt/WorkWrap/Utils.hs
index 99f3147ba1..726a5cdc4e 100644
--- a/compiler/GHC/Core/Opt/WorkWrap/Utils.hs
+++ b/compiler/GHC/Core/Opt/WorkWrap/Utils.hs
@@ -1013,7 +1013,8 @@ findTypeShape :: FamInstEnvs -> Type -> TypeShape
-- The data type TypeShape is defined in GHC.Types.Demand
-- See Note [Trimming a demand to a type] in GHC.Core.Opt.DmdAnal
findTypeShape fam_envs ty
- = go (setRecTcMaxBound 2 initRecTc) ty
+ = {-# SCC findTypeShape #-}
+ go (setRecTcMaxBound 2 initRecTc) ty
-- You might think this bound of 2 is low, but actually
-- I think even 1 would be fine. This only bites for recursive
-- product types, which are rare, and we really don't want
diff --git a/compiler/GHC/Core/Utils.hs b/compiler/GHC/Core/Utils.hs
index 2e40ddc659..bc9e1ac4c7 100644
--- a/compiler/GHC/Core/Utils.hs
+++ b/compiler/GHC/Core/Utils.hs
@@ -1892,7 +1892,11 @@ exprIsConLike = exprIsHNFlike isConLikeId isConLikeUnfolding
-- or PAPs.
--
exprIsHNFlike :: (Var -> Bool) -> (Unfolding -> Bool) -> CoreExpr -> Bool
-exprIsHNFlike is_con is_con_unf = is_hnf_like
+exprIsHNFlike is_con is_con_unf expr =
+ let res = is_hnf_like expr
+ in
+ -- pprTrace "exprIsHNFlike:" (text "expr:" <+> ppr expr $$ text "res:" <+> ppr res)
+ res
where
is_hnf_like (Var v) -- NB: There are no value args at this point
= id_app_is_value v 0 -- Catches nullary constructors,
@@ -2602,8 +2606,10 @@ dumpIdInfoOfProgram ppr_id_info binds = vcat (map printId ids)
ids = sortBy (stableNameCmp `on` getName) (concatMap getIds binds)
getIds (NonRec i _) = [ i ]
getIds (Rec bs) = map fst bs
- printId id | isExportedId id = ppr id <> colon <+> (ppr_id_info (idInfo id))
- | otherwise = empty
+ printId id = ppr id <> colon <+> (ppr_id_info (idInfo id))
+
+ -- printId id | isExportedId id = ppr id <> colon <+> (ppr_id_info (idInfo id))
+ -- | otherwise = empty
{- *********************************************************************
diff --git a/compiler/GHC/CoreToStg.hs b/compiler/GHC/CoreToStg.hs
index e0c7ef2521..c0ca58b887 100644
--- a/compiler/GHC/CoreToStg.hs
+++ b/compiler/GHC/CoreToStg.hs
@@ -18,10 +18,11 @@ module GHC.CoreToStg ( coreToStg ) where
import GHC.Prelude
import GHC.Core
-import GHC.Core.Utils ( exprType, findDefault, isJoinBind
+import GHC.Core.Utils ( exprType, isJoinBind
, exprIsTickedString_maybe )
import GHC.Core.Opt.Arity ( manifestArity )
import GHC.Stg.Syntax
+import GHC.Stg.Utils
import GHC.Core.Type
import GHC.Types.RepType
@@ -47,7 +48,7 @@ import GHC.Platform.Ways
import GHC.Driver.Ppr
import GHC.Types.ForeignCall
import GHC.Types.Demand ( isUsedOnce )
-import GHC.Builtin.PrimOps ( PrimCall(..) )
+import GHC.Builtin.PrimOps ( PrimCall(..), primOpWrapperId )
import GHC.Types.SrcLoc ( mkGeneralSrcSpan )
import GHC.Builtin.Names ( unsafeEqualityProofName )
@@ -434,8 +435,8 @@ coreToStgExpr e0@(Case scrut bndr _ alts) = do
let stg = StgCase scrut2 bndr (mkStgAltType bndr alts) alts2
-- See (U2) in Note [Implementing unsafeCoerce] in base:Unsafe.Coerce
case scrut2 of
- StgApp id [] | idName id == unsafeEqualityProofName
- , isDeadBinder bndr ->
+ StgApp _ id [] | idName id == unsafeEqualityProofName
+ , isDeadBinder bndr ->
-- We can only discard the case if the case-binder is dead
-- It usually is, but see #18227
case alts2 of
@@ -467,46 +468,6 @@ coreToStgExpr e0@(Case scrut bndr _ alts) = do
coreToStgExpr (Let bind body) = coreToStgLet bind body
coreToStgExpr e = pprPanic "coreToStgExpr" (ppr e)
-mkStgAltType :: Id -> [CoreAlt] -> AltType
-mkStgAltType bndr alts
- | isUnboxedTupleType bndr_ty || isUnboxedSumType bndr_ty
- = MultiValAlt (length prim_reps) -- always use MultiValAlt for unboxed tuples
-
- | otherwise
- = case prim_reps of
- [LiftedRep] -> case tyConAppTyCon_maybe (unwrapType bndr_ty) of
- Just tc
- | isAbstractTyCon tc -> look_for_better_tycon
- | isAlgTyCon tc -> AlgAlt tc
- | otherwise -> ASSERT2( _is_poly_alt_tycon tc, ppr tc )
- PolyAlt
- Nothing -> PolyAlt
- [unlifted] -> PrimAlt unlifted
- not_unary -> MultiValAlt (length not_unary)
- where
- bndr_ty = idType bndr
- prim_reps = typePrimRep bndr_ty
-
- _is_poly_alt_tycon tc
- = isFunTyCon tc
- || isPrimTyCon tc -- "Any" is lifted but primitive
- || isFamilyTyCon tc -- Type family; e.g. Any, or arising from strict
- -- function application where argument has a
- -- type-family type
-
- -- Sometimes, the TyCon is a AbstractTyCon which may not have any
- -- constructors inside it. Then we may get a better TyCon by
- -- grabbing the one from a constructor alternative
- -- if one exists.
- look_for_better_tycon
- | ((DataAlt con, _, _) : _) <- data_alts =
- AlgAlt (dataConTyCon con)
- | otherwise =
- ASSERT(null data_alts)
- PolyAlt
- where
- (data_alts, _deflt) = findDefault alts
-
-- ---------------------------------------------------------------------------
-- Applications
-- ---------------------------------------------------------------------------
@@ -535,14 +496,15 @@ coreToStgApp f args ticks = do
res_ty = exprType (mkApps (Var f) args)
app = case idDetails f of
DataConWorkId dc
- | saturated -> StgConApp dc args'
+ | saturated -> StgConApp noExtFieldSilent dc args'
(dropRuntimeRepArgs (fromMaybe [] (tyConAppArgs_maybe res_ty)))
-- Some primitive operator that might be implemented as a library call.
-- As noted by Note [Eta expanding primops] in GHC.Builtin.PrimOps
-- we require that primop applications be saturated.
- PrimOpId op -> ASSERT( saturated )
- StgOpApp (StgPrimOp op) args' res_ty
+ PrimOpId op -- TODO: Are calls guaranteed to be saturated already here?
+ | saturated -> StgOpApp (StgPrimOp op) args' res_ty
+ | otherwise -> StgApp MayEnter (primOpWrapperId op) args'
-- A call to some primitive Cmm function.
FCallId (CCall (CCallSpec (StaticTarget _ lbl (Just pkgId) True)
@@ -555,7 +517,7 @@ coreToStgApp f args ticks = do
StgOpApp (StgFCallOp call (idType f)) args' res_ty
TickBoxOpId {} -> pprPanic "coreToStg TickBox" $ ppr (f,args')
- _other -> StgApp f args'
+ _other -> StgApp MayEnter f args'
tapp = foldr StgTick app (ticks ++ ticks')
@@ -591,8 +553,8 @@ coreToStgArgs (arg : args) = do -- Non-type argument
let
(aticks, arg'') = stripStgTicksTop tickishFloatable arg'
stg_arg = case arg'' of
- StgApp v [] -> StgVarArg v
- StgConApp con [] _ -> StgVarArg (dataConWorkId con)
+ StgApp _ext v [] -> StgVarArg v
+ StgConApp _ con [] _ -> StgVarArg (dataConWorkId con)
StgLit lit -> StgLitArg lit
_ -> pprPanic "coreToStgArgs" (ppr arg)
@@ -690,13 +652,13 @@ mkTopStgRhs dflags this_mod ccs bndr rhs
(toList bndrs) body
, ccs )
- | StgConApp con args _ <- unticked_rhs
+ | StgConApp _ con args _ <- unticked_rhs
, -- Dynamic StgConApps are updatable
not (isDllConApp dflags this_mod con args)
= -- CorePrep does this right, but just to make sure
ASSERT2( not (isUnboxedTupleDataCon con || isUnboxedSumDataCon con)
, ppr bndr $$ ppr con $$ ppr args)
- ( StgRhsCon dontCareCCS con args, ccs )
+ ( StgRhsCon noExtFieldSilent dontCareCCS con args, ccs )
-- Otherwise it's a CAF, see Note [Cost-centre initialization plan].
| gopt Opt_AutoSccsOnIndividualCafs dflags
@@ -746,8 +708,8 @@ mkStgRhs bndr rhs
ReEntrant -- ignored for LNE
[] rhs
- | StgConApp con args _ <- unticked_rhs
- = StgRhsCon currentCCS con args
+ | StgConApp _ext con args _ <- unticked_rhs
+ = StgRhsCon noExtFieldSilent currentCCS con args
| otherwise
= StgRhsClosure noExtFieldSilent
diff --git a/compiler/GHC/Data/EnumSet.hs b/compiler/GHC/Data/EnumSet.hs
index a7949c7e71..d97bf63662 100644
--- a/compiler/GHC/Data/EnumSet.hs
+++ b/compiler/GHC/Data/EnumSet.hs
@@ -1,3 +1,5 @@
+{-# LANGUAGE GeneralizedNewtypeDeriving #-}
+
-- | A tiny wrapper around 'IntSet.IntSet' for representing sets of 'Enum'
-- things.
module GHC.Data.EnumSet
@@ -15,7 +17,7 @@ import GHC.Prelude
import qualified Data.IntSet as IntSet
-newtype EnumSet a = EnumSet IntSet.IntSet
+newtype EnumSet a = EnumSet IntSet.IntSet deriving (Semigroup, Monoid)
member :: Enum a => a -> EnumSet a -> Bool
member x (EnumSet s) = IntSet.member (fromEnum x) s
diff --git a/compiler/GHC/Data/TrieMap.hs b/compiler/GHC/Data/TrieMap.hs
index 340828ee95..3c2507cb6f 100644
--- a/compiler/GHC/Data/TrieMap.hs
+++ b/compiler/GHC/Data/TrieMap.hs
@@ -11,6 +11,8 @@
module GHC.Data.TrieMap(
-- * Maps over 'Maybe' values
MaybeMap,
+ -- * Maps over 'Either' values
+ EitherMap,
-- * Maps over 'List' values
ListMap,
-- * Maps over 'Literal's
@@ -24,7 +26,7 @@ module GHC.Data.TrieMap(
-- * Map for leaf compression
GenMap,
lkG, xtG, mapG, fdG,
- xtList, lkList
+ xtList, lkList, deMaybe
) where
@@ -251,6 +253,30 @@ fdMaybe k m = foldMaybe k (mm_nothing m)
{-
************************************************************************
* *
+ Either
+* *
+************************************************************************
+-}
+
+data EitherMap ml mr a = EM { em_left :: ml a, em_right :: mr a }
+
+instance (TrieMap ml, TrieMap mr) => Functor (EitherMap ml mr) where
+ fmap f (EM l r) = EM (mapTM f l) (mapTM f r)
+
+instance (TrieMap ml, TrieMap mr) => TrieMap (EitherMap ml mr) where
+ type Key (EitherMap ml mr) = Either (Key ml) (Key mr)
+ emptyTM = EM { em_left = emptyTM, em_right = emptyTM }
+ lookupTM (Left k) em = lookupTM k (em_left em)
+ lookupTM (Right k) em = lookupTM k (em_right em)
+ alterTM k f em
+ | Left kl <- k = em { em_left = alterTM kl f (em_left em) }
+ | Right kr <- k = em { em_right = alterTM kr f (em_right em) }
+ foldTM f (EM lm rm) acc = foldTM f lm (foldTM f rm acc)
+ mapTM = fmap
+
+{-
+************************************************************************
+* *
Lists
* *
************************************************************************
diff --git a/compiler/GHC/Driver/Flags.hs b/compiler/GHC/Driver/Flags.hs
index b7d3d4d459..5fbbf892a3 100644
--- a/compiler/GHC/Driver/Flags.hs
+++ b/compiler/GHC/Driver/Flags.hs
@@ -71,6 +71,7 @@ data DumpFlag
| Opt_D_dump_stg_from_core -- ^ Initial STG (CoreToStg output)
| Opt_D_dump_stg_unarised -- ^ STG after unarise
| Opt_D_dump_stg_final -- ^ Final STG (after stg2stg)
+ | Opt_D_dump_stg_tag_nodes
| Opt_D_dump_call_arity
| Opt_D_dump_exitify
| Opt_D_dump_stranal
@@ -202,6 +203,9 @@ data GeneralFlag
| Opt_CatchBottoms
| Opt_NumConstantFolding
+ -- Inference flags
+ | Opt_DoTagInferenceChecks
+
-- PreInlining is on by default. The option is there just to see how
-- bad things get if you turn it off!
| Opt_SimplPreInlining
diff --git a/compiler/GHC/Driver/Main.hs b/compiler/GHC/Driver/Main.hs
index e924826b0c..3c0c47be58 100644
--- a/compiler/GHC/Driver/Main.hs
+++ b/compiler/GHC/Driver/Main.hs
@@ -224,8 +224,17 @@ import Data.Functor
import Control.DeepSeq (force)
import Data.Bifunctor (first, bimap)
+-- Tag infer perf debugging
+import System.CPUTime
+import GHC.Stg.Utils (seqTopBinds)
+import GHC.Stg.InferTags
#include "HsVersions.h"
+-- In ms
+getTime :: IO Double
+getTime = do
+ !time <- getCPUTime
+ return $! (fromIntegral time) / (1000000000 :: Double)
{- **********************************************************************
%* *
@@ -1644,8 +1653,16 @@ doCodeGen hsc_env this_mod data_tycons
cost_centre_info stg_binds hpc_info = do
let dflags = hsc_dflags hsc_env
platform = targetPlatform dflags
+ return $! seqTopBinds stg_binds
+ -- let stg_binds_w_fvs = annTopBindingsFreeVars stg_binds
- let stg_binds_w_fvs = annTopBindingsFreeVars stg_binds
+ !start <- getTime
+
+ let (!stg_binds_w_tags, _exports) = {-# SCC "StgTagFields" #-}
+ findTags dflags this_mod stg_binds
+ !end <- getTime
+ putStrLn $! "Time(ms) taken by findTags:" ++ (show $ end - start)
+ let stg_binds_w_fvs = annTopBindingsFreeVars stg_binds_w_tags
dumpIfSet_dyn dflags Opt_D_dump_stg_final "Final STG:" FormatSTG (pprGenStgTopBindings (initStgPprOpts dflags) stg_binds_w_fvs)
diff --git a/compiler/GHC/Driver/Session.hs b/compiler/GHC/Driver/Session.hs
index 687c6e1598..1c47242af6 100644
--- a/compiler/GHC/Driver/Session.hs
+++ b/compiler/GHC/Driver/Session.hs
@@ -2594,6 +2594,8 @@ dynamic_flags_deps = [
, make_dep_flag defGhcFlag "ddump-stg"
(setDumpFlag Opt_D_dump_stg_from_core)
"Use `-ddump-stg-from-core` or `-ddump-stg-final` instead"
+ , make_ord_flag defGhcFlag "ddump-stg-tag-nodes"
+ (setDumpFlag Opt_D_dump_stg_tag_nodes)
, make_ord_flag defGhcFlag "ddump-call-arity"
(setDumpFlag Opt_D_dump_call_arity)
, make_ord_flag defGhcFlag "ddump-exitify"
@@ -2686,6 +2688,8 @@ dynamic_flags_deps = [
(NoArg (setGeneralFlag Opt_DoAsmLinting))
, make_ord_flag defGhcFlag "dannot-lint"
(NoArg (setGeneralFlag Opt_DoAnnotationLinting))
+ , make_ord_flag defGhcFlag "dtag-inference-checks"
+ (NoArg (setGeneralFlag Opt_DoTagInferenceChecks))
, make_ord_flag defGhcFlag "dshow-passes"
(NoArg $ forceRecompile >> (setVerbosity $ Just 2))
, make_ord_flag defGhcFlag "dfaststring-stats"
diff --git a/compiler/GHC/Stg/CSE.hs b/compiler/GHC/Stg/CSE.hs
index 61362053f5..19b1dfd483 100644
--- a/compiler/GHC/Stg/CSE.hs
+++ b/compiler/GHC/Stg/CSE.hs
@@ -290,8 +290,8 @@ stgCseTopLvlRhs :: InScopeSet -> InStgRhs -> OutStgRhs
stgCseTopLvlRhs in_scope (StgRhsClosure ext ccs upd args body)
= let body' = stgCseExpr (initEnv in_scope) body
in StgRhsClosure ext ccs upd args body'
-stgCseTopLvlRhs _ (StgRhsCon ccs dataCon args)
- = StgRhsCon ccs dataCon args
+stgCseTopLvlRhs _ (StgRhsCon ext ccs dataCon args)
+ = StgRhsCon ext ccs dataCon args
------------------------------
-- The actual AST traversal --
@@ -299,8 +299,8 @@ stgCseTopLvlRhs _ (StgRhsCon ccs dataCon args)
-- Trivial cases
stgCseExpr :: CseEnv -> InStgExpr -> OutStgExpr
-stgCseExpr env (StgApp fun args)
- = StgApp fun' args'
+stgCseExpr env (StgApp ext fun args)
+ = StgApp ext fun' args'
where fun' = substVar env fun
args' = substArgs env args
stgCseExpr _ (StgLit lit)
@@ -318,7 +318,7 @@ stgCseExpr env (StgCase scrut bndr ty alts)
where
scrut' = stgCseExpr env scrut
(env1, bndr') = substBndr env bndr
- env2 | StgApp trivial_scrut [] <- scrut' = addTrivCaseBndr bndr trivial_scrut env1
+ env2 | StgApp _ trivial_scrut [] <- scrut' = addTrivCaseBndr bndr trivial_scrut env1
-- See Note [Trivial case scrutinee]
| otherwise = env1
alts' = map (stgCseAlt env2 ty bndr') alts
@@ -326,11 +326,11 @@ stgCseExpr env (StgCase scrut bndr ty alts)
-- A constructor application.
-- To be removed by a variable use when found in the CSE environment
-stgCseExpr env (StgConApp dataCon args tys)
+stgCseExpr env (StgConApp ext dataCon args tys)
| Just bndr' <- envLookup dataCon args' env
- = StgApp bndr' []
+ = StgApp noEnterInfo bndr' []
| otherwise
- = StgConApp dataCon args' tys
+ = StgConApp ext dataCon args' tys
where args' = substArgs env args
-- Let bindings
@@ -395,7 +395,7 @@ stgCsePairs env0 ((b,e):pairs)
-- The RHS of a binding.
-- If it is a constructor application, either short-cut it or extend the environment
stgCseRhs :: CseEnv -> OutId -> InStgRhs -> (Maybe (OutId, OutStgRhs), CseEnv)
-stgCseRhs env bndr (StgRhsCon ccs dataCon args)
+stgCseRhs env bndr (StgRhsCon ext ccs dataCon args)
| Just other_bndr <- envLookup dataCon args' env
, not (isWeakLoopBreaker (idOccInfo bndr)) -- See Note [Care with loop breakers]
= let env' = addSubst bndr other_bndr env
@@ -403,7 +403,7 @@ stgCseRhs env bndr (StgRhsCon ccs dataCon args)
| otherwise
= let env' = addDataCon bndr dataCon args' env
-- see note [Case 1: CSEing allocated closures]
- pair = (bndr, StgRhsCon ccs dataCon args')
+ pair = (bndr, StgRhsCon ext ccs dataCon args')
in (Just pair, env')
where args' = substArgs env args
@@ -420,8 +420,8 @@ mkStgCase scrut bndr ty alts | all isBndr alts = scrut
where
-- see Note [All alternatives are the binder]
- isBndr (_, _, StgApp f []) = f == bndr
- isBndr _ = False
+ isBndr (_, _, StgApp _ f []) = f == bndr
+ isBndr _ = False
{- Note [Care with loop breakers]
diff --git a/compiler/GHC/Stg/DepAnal.hs b/compiler/GHC/Stg/DepAnal.hs
index 223ab0c5bb..39f538c05f 100644
--- a/compiler/GHC/Stg/DepAnal.hs
+++ b/compiler/GHC/Stg/DepAnal.hs
@@ -5,6 +5,7 @@ module GHC.Stg.DepAnal (depSortStgPgm) where
import GHC.Prelude
import GHC.Stg.Syntax
+import GHC.Stg.Utils
import GHC.Types.Id
import GHC.Types.Name (Name, nameIsLocalOrFrom)
import GHC.Types.Name.Env
@@ -62,7 +63,7 @@ annTopBindingsDeps this_mod bs = zip bs (map top_bind bs)
rhs bounds (StgRhsClosure _ _ _ as e) =
expr (extendVarSetList bounds as) e
- rhs bounds (StgRhsCon _ _ as) =
+ rhs bounds (StgRhsCon _ _ _ as) =
args bounds as
var :: BVs -> Var -> FVs
@@ -81,13 +82,13 @@ annTopBindingsDeps this_mod bs = zip bs (map top_bind bs)
args bounds as = unionVarSets (map (arg bounds) as)
expr :: BVs -> StgExpr -> FVs
- expr bounds (StgApp f as) =
+ expr bounds (StgApp _ f as) =
var bounds f `unionVarSet` args bounds as
expr _ StgLit{} =
emptyVarSet
- expr bounds (StgConApp _ as _) =
+ expr bounds (StgConApp _ _ as _) =
args bounds as
expr bounds (StgOpApp _ as _) =
args bounds as
diff --git a/compiler/GHC/Stg/FVs.hs b/compiler/GHC/Stg/FVs.hs
index 211a0cb315..b921abf5f6 100644
--- a/compiler/GHC/Stg/FVs.hs
+++ b/compiler/GHC/Stg/FVs.hs
@@ -1,3 +1,7 @@
+{-# LANGUAGE ConstraintKinds #-}
+{-# LANGUAGE GADTs #-}
+{-# LANGUAGE DataKinds #-}
+
{- |
Non-global free variable analysis on STG terms. This pass annotates
non-top-level closure bindings with captured variables. Global variables are not
@@ -59,6 +63,36 @@ newtype Env
{ locals :: IdSet
}
+{-
+ Note [The FVPass Constraint]
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+Currently the free variable pass is used in two places:
+* The late lambda lifting pass in order to estimate the size of closures
+* Before codegen to figure out the actual free variables.
+
+However we have a different parameterisation for each of these.
+In order to avoid code duplication I've added the `FVPass i o` constraint.
+
+The principle is simple: We don't modify the input except for replacing
+XRhsClosure extension points with DIdSet.
+
+FVPass encodes this fact in the form of a constraint.
+-}
+
+type FVPass i o = (BinderP i ~ Id,
+ BinderP o ~ Id,
+
+ -- The RhsClosure extension will contain the free variables afterwards
+ XRhsClosure o ~ DIdSet,
+ XRhsCon i ~ XRhsCon o,
+ XLet i ~ XLet o,
+ XLetNoEscape i ~ XLetNoEscape o,
+ XStgConApp i ~ XStgConApp o,
+ -- XStgCase i ~ XStgCase o,
+ XStgApp i ~ XStgApp o
+ )
+
emptyEnv :: Env
emptyEnv = Env emptyVarSet
@@ -67,7 +101,7 @@ addLocals bndrs env
= env { locals = extendVarSetList (locals env) bndrs }
-- | Annotates a top-level STG binding group with its free variables.
-annTopBindingsFreeVars :: [StgTopBinding] -> [CgStgTopBinding]
+annTopBindingsFreeVars :: FVPass i o => [GenStgTopBinding i] -> [GenStgTopBinding o]
annTopBindingsFreeVars = map go
where
go (StgTopStringLit id bs) = StgTopStringLit id bs
@@ -75,10 +109,10 @@ annTopBindingsFreeVars = map go
= StgTopLifted (annBindingFreeVars bind)
-- | Annotates an STG binding with its free variables.
-annBindingFreeVars :: StgBinding -> CgStgBinding
+annBindingFreeVars :: FVPass i o => GenStgBinding i -> GenStgBinding o
annBindingFreeVars = fst . binding emptyEnv emptyDVarSet
-boundIds :: StgBinding -> [Id]
+boundIds :: (BinderP i ~ Id) => GenStgBinding i -> [Id]
boundIds (StgNonRec b _) = [b]
boundIds (StgRec pairs) = map fst pairs
@@ -106,7 +140,7 @@ args env = mkFreeVarSet env . mapMaybe f
f (StgVarArg occ) = Just occ
f _ = Nothing
-binding :: Env -> DIdSet -> StgBinding -> (CgStgBinding, DIdSet)
+binding :: FVPass i o => Env -> DIdSet -> GenStgBinding i -> (GenStgBinding o, DIdSet)
binding env body_fv (StgNonRec bndr r) = (StgNonRec bndr r', fvs)
where
-- See Note [Tracking local binders]
@@ -120,13 +154,13 @@ binding env body_fv (StgRec pairs) = (StgRec pairs', fvs)
pairs' = zip bndrs rhss
fvs = delDVarSetList (unionDVarSets (body_fv:rhs_fvss)) bndrs
-expr :: Env -> StgExpr -> (CgStgExpr, DIdSet)
+expr :: FVPass i o => Env -> GenStgExpr i -> (GenStgExpr o, DIdSet)
expr env = go
where
- go (StgApp occ as)
- = (StgApp occ as, unionDVarSet (args env as) (mkFreeVarSet env [occ]))
+ go (StgApp ext occ as)
+ = (StgApp ext occ as, unionDVarSet (args env as) (mkFreeVarSet env [occ]))
go (StgLit lit) = (StgLit lit, emptyDVarSet)
- go (StgConApp dc as tys) = (StgConApp dc as tys, args env as)
+ go (StgConApp ext dc as tys) = (StgConApp ext dc as tys, args env as)
go (StgOpApp op as ty) = (StgOpApp op as ty, args env as)
go StgLam{} = pprPanic "StgFVs: StgLam" empty
go (StgCase scrut bndr ty alts) = (StgCase scrut' bndr ty alts', fvs)
@@ -152,16 +186,16 @@ expr env = go
(body', body_fvs) = expr env' body
(bind', fvs) = binding env' body_fvs bind
-rhs :: Env -> StgRhs -> (CgStgRhs, DIdSet)
+rhs :: FVPass i o => Env -> GenStgRhs i -> (GenStgRhs o, DIdSet)
rhs env (StgRhsClosure _ ccs uf bndrs body)
= (StgRhsClosure fvs ccs uf bndrs body', fvs)
where
-- See Note [Tracking local binders]
(body', body_fvs) = expr (addLocals bndrs env) body
fvs = delDVarSetList body_fvs bndrs
-rhs env (StgRhsCon ccs dc as) = (StgRhsCon ccs dc as, args env as)
+rhs env (StgRhsCon ext ccs dc as) = (StgRhsCon ext ccs dc as, args env as)
-alt :: Env -> StgAlt -> (CgStgAlt, DIdSet)
+alt :: FVPass i o => Env -> GenStgAlt i -> (GenStgAlt o, DIdSet)
alt env (con, bndrs, e) = ((con, bndrs, e'), fvs)
where
-- See Note [Tracking local binders]
diff --git a/compiler/GHC/Stg/InferTags.hs b/compiler/GHC/Stg/InferTags.hs
new file mode 100644
index 0000000000..9763340135
--- /dev/null
+++ b/compiler/GHC/Stg/InferTags.hs
@@ -0,0 +1,3121 @@
+--
+-- Copyright (c) 2019 Andreas Klebinger
+--
+
+{-# LANGUAGE CPP #-}
+{-# LANGUAGE TypeFamilies #-}
+{-# LANGUAGE RankNTypes #-}
+{-# LANGUAGE MultiParamTypeClasses #-}
+{-# LANGUAGE GADTs #-}
+{-# LANGUAGE TupleSections #-}
+{-# LANGUAGE DataKinds #-}
+{-# LANGUAGE FlexibleContexts #-}
+{-# LANGUAGE ScopedTypeVariables #-}
+{-# LANGUAGE TypeSynonymInstances #-}
+{-# LANGUAGE FlexibleInstances #-}
+{-# LANGUAGE DeriveGeneric #-}
+{-# LANGUAGE DeriveAnyClass #-}
+{-# LANGUAGE MultiWayIf #-}
+{-# LANGUAGE MagicHash #-}
+{-# LANGUAGE BangPatterns #-}
+{-# LANGUAGE UnboxedTuples #-}
+{-# LANGUAGE DeriveFunctor #-}
+{-# LANGUAGE GeneralizedNewtypeDeriving #-}
+
+{-# OPTIONS_GHC -O2 -ddump-simpl -ddump-to-file -ddump-stg -ddump-cmm -ddump-asm -ddump-stg-final #-}
+{-# OPTIONS_GHC -dsuppress-coercions -dno-suppress-type-signatures -dno-suppress-module-prefixes #-}
+-- {-# OPTIONS_GHC -fprof-auto #-}
+{-# OPTIONS_GHC -ticky -ticky-allocd -ticky-dyn-thunk #-}
+
+module GHC.Stg.InferTags (findTags, EnterLattice) where
+
+#include "HsVersions.h"
+
+import GHC.Prelude
+
+import GHC.Types.Basic
+import GHC.Utils.Binary hiding (put, get)
+import qualified GHC.Utils.Binary as B
+import GHC.Core.DataCon
+import GHC.Types.Id
+import GHC.Utils.Outputable
+import GHC.Core (AltCon(..))
+import GHC.Unit.Types (Module)
+import GHC.Core.TyCon (tyConDataCons)
+import GHC.Core.Type
+import GHC.Types.Unique.Supply
+import GHC.Types.RepType
+import GHC.Stg.Syntax as StgSyn hiding (AlwaysEnter)
+import GHC.Stg.Utils
+
+import GHC.StgToCmm.Types ( LambdaFormInfo(..) )
+import GHC.Types.Name
+import GHC.Builtin.Names
+import GHC.Builtin.Types.Prim (addrPrimTy)
+
+import GHC.Types.Demand ( Divergence ( Absent ), splitStrictSig )
+import GHC.Types.Unique
+import GHC.Types.Unique.FM
+import GHC.Utils.Misc
+-- import GHC.Utils.Monad.State -- See Note [Useless Bangs]
+import GHC.Data.Maybe
+
+import GHC.Utils.Monad
+import GHC.Generics
+import GHC.Stack
+
+import GHC.Utils.Error
+import GHC.Data.Graph.Directed
+
+import GHC.Types.Var.Env
+
+-- Fast comparisons
+import GHC.Exts (reallyUnsafePtrEquality#, isTrue#)
+
+-- Used for dumping nodes with -ddump-stg-tag-nodes
+import GHC.Driver.Session
+
+import Data.Ord (comparing)
+
+-- import Data.Int
+import Control.Applicative hiding (empty)
+import Control.Monad
+
+import Control.DeepSeq -- hiding (deepseq)
+import System.IO.Unsafe
+
+-- import Control.Monad.Trans.State.Strict
+
+-- import GHC.Utils.IO.Unsafe (inlinePerformIO)
+import GHC.Exts (State#, RealWorld, runRW# )
+import GHC.IO (IO(..))
+
+-- import System.Mem (getAllocationCounter)
+
+-- import Data.Array.IArray as U
+-- import Data.Array.MArray as M
+import Data.Array.IO as IOA
+import Data.IORef
+
+import GHC.Exts (oneShot)
+import GHC.Utils.Panic
+import GHC.Driver.Ppr (pprTraceM)
+{-
+
+ Note [Debugging Taggedness]
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+ In practice bugs happen. So I added a few ways to make issues with this code easier to debug.
+
+ * There is a flag to dump the result of this analysis (ddump-stg-tag-nodes).
+ I found this immensely helpful during developement.
+ * There is a flag to emit runtime checks to confirm the results of taggedness (dtag-inference-checks).
+ If we case on a value we expect to be tagged it adds a runtime check for the tag. If there is no tag
+ your program will terminate immediately which makes it a lot easier to find the root cause.
+ * The data flow graph can be extended with a description making it easier to work with.
+ This is disabled by default, enabled by -DDEBUG, and easily changed by defining (or not)
+ WITH_NODE_DESC. This has a significant performance impact hence is disabled by default.
+
+
+ Note [Tag Inferrence - The basic idea]
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+ This code has two goals:
+
+ * Ensure constructors with strict fields are only
+ allocated with tagged pointers in the strict fields.
+ * Infer if a given evaluation site of an id is guaranteed to
+ refer to a tagged pointer.
+
+ Id's refered to by a tagged pointer do not have to be entered
+ when used in an case expression which has massive performance
+ benefits. If we can *infer* that the pointer is tagged without
+ a runtime check we can improve performance further. In particular
+ for traversals of strict data structures where repeated checks for
+ the presence can carry a high cost.
+
+ This Module contains the code for the actual inference and upholding
+ the strict field invariant. See Note [The strict field invariant]
+ Once computed the infered tag information is stored in the extension
+ point of StgApp. This is then used in StgCmmExpr to determine if we
+ need to enter an expression.
+
+ This is essentially a form of 0CFA analysis. The correspondence is as follows:
+
+ * Labeling expressions:
+ Is done by creating a data flow node for the expression. Nodes are labeled
+ by their id's. While labeling we also set up the initial dataflow state which
+ is implicit encoded in the `node_result` field for each dataflow node.
+
+ The data flow graph is created initially by nodesTopBinds.
+
+ * Inference rules:
+ Inference rules are encoded in the `node_update` field of nodes.
+ These functions when executed update the dataflow state based on the existing
+ dataflow state. The functions themselves are created in the various `node*`
+ functions eg. `nodeLiteral`
+
+ The simpler ones just return a constant result (and hence are only run once).
+ More complicated ones might reference current values of other nodes to
+ determine their result and can be iterated often.
+
+ All node* functions have explicit documentation describing both how
+ data flows between their inputs and outputs, as well as how new
+ constraints are generated. But it's fairly informal.
+
+ * Solving of the constraints:
+ Constraints are solved by iterating node_update functions until we reach
+ a fixpoint or an iteration limit.
+
+ All inference rules have been crafted such that intermediate results are safe to use.
+ This means even if we fail to reach a fixpoint we can use the results gathered up to
+ that point safely.
+
+ The kind of information we track has it's own Note [Lattice for tag analysis].
+
+ Once the dataflow analysis has run we extract relevant information from the constraints in
+ the rewrite* (e.g. rewriteRhs) functions. This:
+ + Updates the extension points where appropriate.
+ + Inserts seq where required to uphold the strict field invariant.
+ See Note [The strict field invariant].
+
+ I found that commonly 0CFA is represented as having distinct maps
+ for variables and labels. Implementation wise we instead
+ assign all occurences refering to a local variable the same label.
+ Which is done by keeping a mapping of variables to labels. This has
+ the advantage that it works even in the presence of shadowing.
+ This is beneficial for running the analysis. But does impose some
+ overhead during creation of the data flow graph (but overall improves perf).
+ Imported ids are simply referenced by their unique instead.
+
+
+ Note [Useless Bangs]
+ ~~~~~~~~~~~~~~~~~~~~
+
+ Ghcs state monad is lazy. So to avoid space leaks I've added bangs
+ very liberally in this module. Some are bound to be useless, but this
+ still beats having space leaks.
+
+ The only place in this module where we explicitly depend on lazyness is the
+ (unused) ty for case alternatives. So there is no harm in excessive bang
+ annotations, at least not compared to space leaks.
+
+
+ Note [The strict field invariant]
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+ The code in this module transforms the STG AST such
+ that all strict fields will only contain tagged values.
+
+ We do allow two exceptions to this invariant.
+ * Functions.
+ * Values representing an absentError.
+
+ See also Note [Taggedness of absentError] for more information on
+ the later.
+
+ We uphold this invariant by inserting code for evaluation around
+ constructor allocation where needed. In practice this means sometimes
+ we will turn this RHS:
+
+ StrictTuple foo bar
+
+ into something like:
+
+ case foo of taggedFoo ->
+ case bar of taggedBar ->
+ StrictTuple taggedFoo taggedBar
+
+ The purpose of this invariant is that it allows us to eliminate
+ the tag check when casing on values coming out of strict fields.
+
+ In particular when traversing the strict spine of a data structure
+ this eliminates a significant amount of code being executed leading
+ to significant speedups. (10% and up for the traversal!)
+
+ This, on it's own, would *not* be a performance improvement.
+ However since for most strict constructor arguments we can infer
+ if a tag is present or not in practice we do not add a lot of evaluation
+ so the overhead is far lower than the payoff.
+
+ Note [Taggedness of absentError]
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+ WorkerWrapper - under certain circumstances - will determine
+ that a strict field in a constructor is not used and put a bottom
+ expression in there as placeholder which is not supposed to be
+ evaluated. See Note [Absent errors] in the WW code for why we do this.
+
+ We have to take great care to avoid evaluating these absentError
+ expresions when upholding the strict field invariant. Because
+ evaluating them would trigger a panic in the runtime.
+
+ For this purpose we treat bindings representing an absentError value
+ as being tagged. We do this with the help of strictness analysis which
+ will assign a special kind of divergence value (Absent) to such bindings.
+
+ This is similar to the simplifier treating absentError as a constructor.
+ See Note [aBSENT_ERROR_ID] for a description of the simplifier case.
+
+ This is alright, because in the absence of bugs in the rest of GHC any such value
+ should never be evaluated, and therefore can be treated as already
+ evaluated without affecting correctness.
+
+ This means we might end up with code like this:
+
+ data T a b c = MkT a b !c
+
+ $wf :: a -> b -> Result
+ $wf a b = let c = absentError "ww_absent"
+ in g (MkT a b c)
+
+ Where we know g will not use the strict field c.
+
+ We catch this kind of situation in two ways:
+ * Checking the RHS for absentError applications in the current module.
+ * Inspecting the strictness of imported ids.
+
+ We check for absentError applications in the current module because:
+ * It works with -O0 in which case the demand analyser isn't run.
+ * It's more performant to inspect the functions unique than to
+ compare the strictness.
+
+ We have to rely on the strictness analysis for imported id's since not
+ all ids provide us with an unfolding to inspect.
+
+ If we come across a let binding of absentError we simply treat the binding as
+ if it's represented by a tagged pointer.
+
+ Checking the strictness properties for imported ids is important.
+ What if we inline $wf into a module B, but don't do so for `c` which might
+ get floated out? We have to ensure that c is still treated as tagged.
+
+ Checking the RHS of local functions, and strictness of imported ones is sufficient
+ to make this work.
+ * Consider c (binding absentError) to be defined in module A
+ * $wf to be inlined into module B from module A.
+
+ This gives us four cases to consider:
+
+ A & B not optimized:
+ Since ww will not run on either, c will never be generated by the compiler.
+ A & B optimized:
+ A will be analyzed, the demand analyzer will recognise c as an absent error
+ which allows us to treat `c` as tagged inside module B.
+ A optimized, B not optimized:
+ If B is not optimized then the body of $wf can't end up in B, so this works out.
+ A not optimized, B not optimized:
+ Since A is not optimised GHC won't expose any unfoldings, so again $wf and c can't
+ end up in different modules and things work out.
+
+
+ Note [nesting Limit]
+ ~~~~~~~~~~~~~~~~~~~~
+
+ When analysing a function like `f x = x : f x` we need to widen the result to
+ ensure termination. We achieve this by analysing results only up to a depth of
+ set by the nestingLimit variable.
+
+ Analysing results nested past a few levels does not convey a real performance
+ improvement, but it does affect compile times significantly for certain code.
+
+-}
+
+
+#if defined(DEBUG)
+#define WITH_NODE_DESC
+#endif
+
+-- See Note [nesting Limit]
+nestingLimit :: Int
+nestingLimit = 10
+
+-- Shortcut comparisons if two things reference the same object.
+maybeEq :: a -> a -> Bool
+maybeEq x1 x2 = isTrue# (reallyUnsafePtrEquality# x1 x2)
+
+-- | Can we guarantee this RhsCon binding will remain a RhsCon?
+data IsRhsCon
+ = RhsCon -- ^ Local bindings, nullary constructors.
+ | MaybeClosure -- ^ Top level bindings.
+ deriving Eq
+
+-- Grow them trees:
+
+type instance BinderP 'InferTags = Id
+type instance XRhsClosure 'InferTags = NoExtFieldSilent
+-- Putting IsRhsCon into XRhsCon instead of the data flow node
+-- is done for performance reasons.
+type instance XRhsCon 'InferTags = (NodeId,IsRhsCon)
+type instance XLet 'InferTags = NoExtFieldSilent
+type instance XLetNoEscape 'InferTags = NoExtFieldSilent
+type instance XStgApp 'InferTags = NodeId
+type instance XStgConApp 'InferTags = NodeId
+
+type InferStgTopBinding = GenStgTopBinding 'InferTags
+type InferStgBinding = GenStgBinding 'InferTags
+type InferStgExpr = GenStgExpr 'InferTags
+type InferStgRhs = GenStgRhs 'InferTags
+type InferStgAlt = GenStgAlt 'InferTags
+
+data RecursionKind
+ = NoMutRecursion -- ^ No mutual recursion.
+ | OtherRecursion -- ^ Potentially mutual recursion
+ | NoRecursion
+ deriving Eq
+
+
+{-
+ Note [Lattice for tag analysis]
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+# The EnterInfo Lattice
+
+We use a lattice for the tag analysis.
+The transfer function for nodes is monotonic (towards bot)
+
+Lattice elements are cross products of two sub lattices.
+
+One lattice encodes if we have to enter an object when
+we case on it in the form of `case id of ...` and looks
+like this:
+
+
+ UndetEnterInfo
+ |
+ MaybeEnter
+ / | \
+ / | \
+ AlwaysEnter | NeverEnter
+ \ | /
+ \ | /
+ |
+ NoValue (Lattice Bottom)
+
+
+It is also called the "outer" info in some places.
+
+What these values represent is the requirement of needing
+to evaluate a binding 'val' in a context like
+
+ case val of ...
+
+Which for values coincides with a value being tagged.
+
+For functions it doesn't currently matter (operationally) how we
+treat them as they can not be entered only called.
+However we try to assign functions a value of NeverEnter,
+as it makes certain things more consistent in the code.
+
+NoValue is a special value assigned to code paths who's result can't be
+scrutinised at runtime. This is *different* from the values themselves
+being bottom. Rather the expression producing them is bottom!
+
+A common example is the tail recursive branch in a recursive function.
+See Note [Recursive Functions] for why we need this.
+If we end up assigning NoValue to a *binding's* enterInfo then
+this binding represents a computation which won't return as it
+will tail call itself forever.
+This happens for example in `f x = f x`.
+
+NeverEnter means the object referenced by the binding won't ever be
+entered as a *value*. It might be called as a function when applied
+to arguments.
+
+AlwaysEnter implies something is a thunk of some form. However since GC
+can also evaluate certain forms of thunks we do currently not utilize it.
+As other wise we might redundantly enter thunks.
+
+MaybeEnter represents the set of things for which one of these is true:
+* We don't care about the enter behaviour
+* We can't (easily) know the enter behaviour - e.g. function arguments
+* We know it could be either enter or no-enter depending on
+ branches taken at runtime.
+
+# The FieldInfo Lattice
+
+The second lattice represents information about values which are
+in the fields of an id.
+This is a mouthful so here is an example:
+
+ let x = foo
+ in case x of
+ MyCon a b -> case a of
+ <alts>
+
+ Assume we have determined foo has the field info lattice:
+ `FieldsProd [(NeverEnter,fi1), (MaybeEnter,fi2)]
+ So naturally the same is true of the binding x.
+
+ This means if we bind the second field of 'x' (here bound to 'a')
+ then 'a' will have the information (NeverEnter,fi1) associated with it.
+
+ This is independent of weither or not x needs to be entered, or even it's
+ termination. As this information can only be used if x terminates.
+
+If we have "foo = Just bar" then this lattice will
+encode the information we have about bar, potentially also with
+nested information itself. In practice we limit to nesting to a certain depth
+for performance reasons but a few levels deep can be very useful.
+
+This lattice has this shape:
+
+ FieldsUndet
+ |
+ FieldsUnknown
+ |
+ FieldsUntyped
+ / | \
+ FieldsProd | FieldsSum
+ \ | /
+ LatNoValues
+
+
+
+It's very much analog to the one for enterInfo.
+
+Again we have a placeholder for non-existing values used
+for e.g. recursive tail calls.
+See Note [Recursive Functions] for details about that.
+
+Some of these constructors represent semantically a infinite number of fields
+containing certain information:
+* FieldsUndet => each field contains a not yet determined values.
+* FieldsUnknown => each field is a real top, we can't know anything about them yet.
+* LatNoValues => each field is the result of bottom expression returning. Also used
+ if no fields are present.
+* FieldsProd/FieldsSum/FieldsUntyped encode varying information about a given
+ number of fields. Fields not explicitly present in the list are assumed NoValue.
+
+Again as example we might have
+
+ x = Just Nothing.
+
+With the enterInfo of 'x' being:
+
+ enterInfo(x) = NeverEnter <FieldsSum [NeverEnter<LatNoValues>]>
+
+When documenting this analysis we often omit the Fields* constructors for clarity.
+We would then write x's enterInfo as NeverEnter < NeverEnter >.
+
+ Note [The lattice element combinators]
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+We do use lub to combine multiple branches and this behaves as expected.
+
+For field infos we combine field information pointwise.
+
+When combining results from different branches we allow
+combinations of different field counts. Assuming NoValue for fields which
+are not present. Usually promoting the field lattice to UntypedFields.
+
+See also Note [Combining Branches].
+
+Implementation wise we join branches by having the branching expression
+take a special node as input, which then has all branches as inputs.
+This means all other nodes can have a fixed number of inputs/outputs and
+it's more obvious when multiple branches are combined when looking at the
+data flow graph.
+
+
+ Note [Combining Branches]
+ ~~~~~~~~~~~~~~~~~~~~~~~~~
+
+We use lub to combine the branches:
+
+The enterInfo of a case expression is the combination
+of all it's branches. Let's look at an easy case first:
+
+ case exp of
+ A1 -> alt1@(True,thunk)
+ A2 -> alt2@(True,False)
+
+Let's assume we already established that:
+
+ enterInfo(alt1) = NeverEnter < NeverEnter, MaybeEnter >
+ enterInfo(alt2) = NeverEnter < NeverEnter, NeverEnter >
+
+We compute lub(alt1,alt2):
+
+ lub_outer(NeverEnter,NeverEnter) = NeverEnter
+
+Then we have to combine the fields of branches pointwise:
+
+ lub_fields(FieldsProd<NeverEnter,MaybeEnter>, FieldsProd<NeverEnter,NeverEnter>) = ?
+
+ => comparing the fields pointwise
+
+ lub_field1(NeverEnter,NeverEnter) = NeverEnter
+ lub_field2(NeverEnter,MaybeEnter) = MaybeEnter
+
+ lub_fields(FieldsProd<NeverEnter,MaybeEnter>, FieldsProd<NeverEnter,NeverEnter>)
+ = FieldsProd<NeverEnter,MaybeEnter>
+
+So the overall result is:
+
+ lub(alt1,alt2) = NeverEnter < NeverEnter, MaybeEnter >
+
+If there are more than two branches than we simply compute
+
+ alt1 `lub` alt2 `lub` ... `lub` altn
+
+This is fairly straight forward so far.
+However what about this case:
+
+ case exp of
+ A1 -> alt1@Nothing
+ A2 -> alt2@Just True
+
+We established:
+
+ enterInfo(alt1) = NeverEnter
+ enterInfo(alt2) = NeverEnter < NeverEnter >
+
+and now we want to compute lub(alt1,alt2).
+We first combine the outermost information:
+
+ lub_outer(NeverEnter,NeverEnter) = NeverEnter
+
+Then we have to combine the fields of branches pointwise:
+
+ lub_fields(FieldsProd<NeverEnter>, FieldsNone) = ?
+
+But we can't combine fields pointwise when the numbers of fields
+doesn't match. To work around this we treat the branch with fewer fields
+as having exactly the right number of additional fields for a pointwise
+combination. All of the additional ones having an enterInfo of NoValue.
+
+ lub_fields(FieldsProd<NeverEnter>, FieldsNone) = ?
+
+ => Treat the second argument as having one NoValue field
+
+ lub_fields(FieldsProd<NeverEnter>, FieldsNone<NoValue>) = ?
+ lub_field1(NeverEnter, NoValue) = NeverEnter
+
+ => Giving us the final result of:
+
+ lub_fields(FieldsProd<NeverEnter>, FieldsNone<NoValue>)
+ = FieldsUntyped<NeverEnter>)
+
+ lub(alt1,alt2) = NeverEnter < NeverEnter >
+
+This works because:
+
+* NoValue represent the fact that we will never enter an expression with this enterInfo at runtime.
+* We can never enter a non-existent field of a constructor => We can treat it as NoValue.
+
+Why does this work?
+
+The basic requirement for this to work is that non-existant fields are never
+entered in correct code, and further can never be bound to a variable at runtime.
+
+
+* NonExistant fields are never entered in well-typed code and never bound to variables =>
+ + For a NoValue field to impact runtime behaviour there must be
+ a constructor for which a field is combined with an assumed NoValue field.
+ Otherwise the assumed field makes no difference to the result.
+
+ So a construct of something along the lines of:
+
+ let x = case e of
+ alt1 -> C1 e1
+ alt2 -> C2
+ in
+ ...
+ case x of
+ C1 f1 -> case f1 of ...
+ C2 -> exp2
+
+* If alt2 is taken enterInfo(f1) doesn't affect execution of the program.
+
+* Since NoValue is the bottom of the lattice:
+ enterInfo(f1) = lub(enterInfo e1, NoValue) = enterInfo(e1)
+
+* If alt1 is taken GHC's code generation will:
+ + Store the pointer representing e1 in a constructor C1, and bind it to x
+ + When scrutinizing x the generated code will bind the pointer in x's first field
+ to f1.
+ + This retains the taggedness properties this analysis cares about. So enterInfo(e1) == enterInfo(e2)
+ will hold.
+
+Hopefully sheds some light on why it is safe to use this approach.
+
+ Note [Recursive Functions]
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+Consider this function:
+
+ f x
+ | x < 0 = Just $! Nothing
+ | otherwise = f $ x-1
+
+It's fairly obvious that it will return a value who's first
+field will contain a tagged&evaluated value.
+
+That is for `case (f foo) of x` we get enterInfo(x) == NeverEnter <NeverEnter>.
+
+We deal with this by looking for branches in a functions body
+which are recursive tail calls to the function itself.
+We can treat these branches as not returning a value.
+Indeed any value eventually produced by such a function must come from a
+branch NOT consisting of a recursive tail call to itself.
+
+For any of these tail calls we assign a enter info of NoValue.
+When combining NoValue with other branches NoValue
+always "gives way" to the result of the non-recursive branch(es).
+
+This is correct as *when the function returns* it's result must be
+from one of the non-tailcalled branches.
+
+It even works our for silly things like f x = f x, we infer a value
+of noValue for `f x` which means if `f` is called in a branch somewhere else
+that branch too will give way to the terminating branches.
+
+See also Note [Combining Branches] for more details on combining branches.
+
+Beyond this we are cautios when combining the result of branches.
+Since undetermined is the top of the lattice and we use lub
+a combination of any number of branches will be undetermined until
+we have approximated a more precise result for *all* branches.
+
+Implementation wise we check for self tail calls by looking at the syntactic
+context of function applications. This is implemented in `isRecTail`
+and looks at join points (LNE) as well.
+
+This does not solve the problem of mutual recursion however, in which
+case we just throw our hands up in the air and simply assign the recursive
+branch as undetermined.
+
+TODO:
+ We can surely do better on mutual recursion. After all for mutual recursion
+ the eventual result will be that of a non-recursive branch so much of the same
+ logic applies.
+ But it's rare enough that it doesn't impact performance in a major way.
+
+ Note [Functions producing infinite values]
+ ------------------------------------------
+
+We have to deal with functions without a fixpoint in our lattice.
+These are primarily functions producing infinite values like (f x = x : f x)
+
+To handle these cases we do two things:
+* We limit processing data flow nodes for a certain depth of their fields
+ using a widening operator.
+* We stop running the analysis after a certain amount of time.
+ + However the whole analysis is designed such that intermediate results of the
+ analysis are *correct*. But they might be less precise.
+ + This means even if the analysis doesn't terminate with a fixpoint we can
+ use the results we derived so far.
+
+Intermediate results (before a fixpoint is reached) might
+be less precise than our analysis allows for. But any intermediate
+result of the analysis will result in a safe approximation for the
+program, as long as we have done at least one pass over each RHS.
+
+Why one pass?
+
+Consider this code:
+
+ let x = StrictTuple (absentError foo) True
+
+If we would stop after the initialization step then `x` would have
+enterInfo(x) == UndetEnterInfo. To uphold the strict field invariant
+we would then need to evaluate `absentError foo` before allocating the
+strict tuple which would crash at runtime. See Note [The strict field invariant].
+
+However it takes exactly one pass if we update nodes in dependency order
+ - which we do - to infer all bindings binding absentErrors as NeverEnter.
+
+This means as long as we do one pass over all data flow nodes we might be
+less precise than we could be. But we don't predict invalid enterInfo and
+therefore can use the result from the solved constraints, even if not all
+have been resolved.
+
+
+ Note [Infering recursive tail calls]
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+When creating the data flow graph we also keep track of
+the context in which an expression occurs.
+This is required to deal with shadowing of ids but also allows
+us to infer if a function application is in a tail call position.
+
+The rules are not that complicated and for the most part implemented
+in isRecTail. They are similar to
+the rules for join points.
+
+It's not a tail call if:
+ * If it's not saturated
+ * If it's in a case scrutinee
+ * If it's in a non recursive let definition
+ * If it's defined in a potentially mutually recursive binding group.
+It is a tail call if it's none of the above and in a tail call position in
+ * the body of a let
+ * the definition of a let-no-escape
+ * a case alternative
+ * a closure
+-}
+
+---------------------------------
+-- The Lattice Types --
+---------------------------------
+
+
+undetLat :: EnterLattice
+undetLat = EnterLattice UndetEnterInfo FieldsUndet
+maybeLat :: EnterLattice
+maybeLat = EnterLattice MaybeEnter FieldsUnknown
+noValue :: EnterLattice
+noValue = EnterLattice NoValue FieldsNone
+
+-- | Encode if a node needs to be entered or is already evaluated.
+data EnterInfo
+ = NoValue -- ^ E.g. direct tail recursion, impossible fields.
+ | AlwaysEnter -- ^ WILL need to be entered
+ | NeverEnter -- ^ Does NOT need to be entered.
+ | MaybeEnter -- ^ Could be either
+ | UndetEnterInfo -- ^ Not yet determined.
+ deriving (Eq,Ord,Show,Enum,Generic,NFData)
+
+instance Binary EnterInfo where
+ put_ bh info = putByte bh (fromIntegral $ fromEnum info) -- . (fromIntegral . fromEnum $ info :: Int8)
+ get h = toEnum . fromIntegral <$> getByte h
+
+instance Outputable EnterInfo where
+ ppr UndetEnterInfo = char '?'
+ ppr NoValue = text "noInfo"
+ ppr AlwaysEnter = text "ent"
+ ppr MaybeEnter = char 'm'
+ ppr NeverEnter = char 't'
+
+{- Note [Comparing Sums and Products]
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+ At a glance it makes sense that we would never compare sum and product results.
+ However consider this case:
+
+ case v of
+ True -> case x of prod -> Left prod
+ False -> case y of sum -> Right sum
+
+ Then we will infer taggedness of tagged<tagged>, which is a tagged
+ result with the first field also being tagged.
+
+ However the first field will be a prod type in one and
+ a sum type in the other case. But this does not concern
+ us as taggedness is value-level property so their types
+ don't have to match.
+
+ We could go even further still and compare the fields of
+ `prod` and `sum` against each other. And we do!
+
+ See Note [The lattice element combinators] for details.
+
+-}
+
+data EnterLattice = EnterLattice
+ { enterInfo :: !EnterInfo
+ , fieldInfo :: !FieldInfo
+ }
+ deriving (Eq, Generic, NFData)
+
+instance Binary EnterLattice where
+ put_ bh (EnterLattice enterInfo fieldInfo) = put_ bh enterInfo >> put_ bh fieldInfo
+ get h = pure EnterLattice <*> B.get h <*> B.get h
+
+-- Side note: Nullary constructors are assigned FieldsNone.
+
+data FieldInfo
+ -- | Direct tail recursion, "phantom" fields.
+ = FieldsNone
+
+ -- | The associated value has up to (length fields) fields we know something
+ -- about. But the actual value at runtime can have less fields! Or more fields!
+ -- See Note [Lattice for tag analysis].
+ | FieldsUntyped [EnterLattice]
+
+ -- Product result with up to (length fields) fields we know something about.
+ | FieldsProd [EnterLattice]
+
+ -- Sum with constructor the fields came out of
+ | FieldsSum !(Maybe DataCon) [EnterLattice]
+
+ -- | At most we can say something about the tag of the value.
+ -- The fields are impossible to known.
+ | FieldsUnknown
+
+ -- | We might find out more about the fields
+ | FieldsUndet
+ deriving (Generic)
+
+instance Eq FieldInfo where
+ -- x == y
+ -- | maybeEq x y == True
+ FieldsNone == FieldsNone = True
+ FieldsUnknown == FieldsUnknown = True
+ FieldsUndet == FieldsUndet = True
+ (FieldsSum mb_con1 flds1) == (FieldsSum mb_con2 flds2)
+ = mb_con1 == mb_con2 && eqEnterLattices flds1 flds2
+ (FieldsUntyped flds1) == (FieldsUntyped flds2)
+ = eqEnterLattices flds1 flds2
+ (FieldsProd flds1) == (FieldsProd flds2)
+ = eqEnterLattices flds1 flds2
+ _ == _ = False
+
+-- Relying on Eq [a] ends up not specializing which is quite
+-- bad for performance :( So I handwrote this after the obvious
+-- attempts failed.
+eqEnterLattices :: [EnterLattice] -> [EnterLattice] -> Bool
+eqEnterLattices [] [] = True
+eqEnterLattices (x:xs) (y:ys) =
+ x == y && eqEnterLattices xs ys
+eqEnterLattices _ _ = False
+
+instance NFData FieldInfo where
+ rnf x = seq x ()
+
+instance Outputable EnterLattice where
+ ppr (EnterLattice enterInfo fieldInfo)
+ = ppr enterInfo <> text " x " <> ppr fieldInfo
+
+instance Outputable FieldInfo where
+ ppr FieldsUnknown = text "bot"
+ ppr (FieldsUntyped fields) = text "any" <> ppr fields
+ ppr (FieldsProd fields) = text "prod" <> ppr fields
+ ppr (FieldsSum con fields) = text "sum" <> char '<' <> ppr con <> char '>' <> ppr fields
+ ppr FieldsNone = text "none"
+ ppr FieldsUndet = text "undet"
+
+{- Note [FieldInfo Binary instance]
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+Putting a data con into a interface file can cause non-trivial overhead
+as it involves type checking at load time among other things.
+
+So we convert all Sum field infos to untyped ones when serializing.
+We currently do not take advantage of the con info so this does not
+weaken the strength of the analysis.
+
+-}
+instance Binary FieldInfo where
+ put_ bh FieldsNone = putByte bh 0
+ put_ bh (FieldsUntyped fields) = putByte bh 1 >> put_ bh fields
+ put_ bh (FieldsProd fields) = putByte bh 2 >> put_ bh fields
+ -- We turn FieldSum into FieldsUntyped here,
+ -- While losing precision it means we don't have to save the con
+ put_ bh (FieldsSum _con fields) = putByte bh 1 >> put_ bh fields
+ put_ bh FieldsUnknown = putByte bh 4
+ put_ bh FieldsUndet = putByte bh 5
+
+ get bh = do
+ con <- getByte bh
+ case con of
+ 0 -> pure FieldsNone
+ 1 -> pure FieldsUntyped <*> B.get bh
+ 2 -> pure FieldsProd <*> B.get bh
+ 3 -> panic "get:FieldInfo - invalid byte"
+ 4 -> pure FieldsUnknown
+ 5 -> pure FieldsUndet
+ _ -> panic "get:FieldInfo - invalid byte"
+
+-- lub
+combineEnterInfo :: EnterInfo -> EnterInfo -> EnterInfo
+combineEnterInfo UndetEnterInfo _ = UndetEnterInfo
+combineEnterInfo _ UndetEnterInfo = UndetEnterInfo
+combineEnterInfo MaybeEnter _ = MaybeEnter
+combineEnterInfo _ MaybeEnter = MaybeEnter
+combineEnterInfo NeverEnter AlwaysEnter = MaybeEnter
+combineEnterInfo AlwaysEnter NeverEnter = MaybeEnter
+combineEnterInfo AlwaysEnter AlwaysEnter= AlwaysEnter
+combineEnterInfo NeverEnter NeverEnter = NeverEnter
+combineEnterInfo NoValue x = x
+combineEnterInfo x NoValue = x
+
+combineFieldsUntyped :: [EnterLattice] -> [EnterLattice] -> [EnterLattice]
+combineFieldsUntyped fields1 fields2 =
+ go fields1 fields2
+ where
+ go (x:xs) (y:ys) = combineLattices x y : go xs ys
+ go [] ys = ys
+ go xs [] = xs
+
+
+combineLattices :: EnterLattice -> EnterLattice -> EnterLattice
+combineLattices x1 x2 | maybeEq x1 x2 || x1 == x2 = x1
+combineLattices (EnterLattice ei1 fi1) (EnterLattice ei2 fi2)
+ = EnterLattice (combineEnterInfo ei1 ei2) (combineFieldInfos fi1 fi2)
+
+combineFieldInfos :: FieldInfo -> FieldInfo -> FieldInfo
+combineFieldInfos FieldsUndet _ = FieldsUndet
+combineFieldInfos _ FieldsUndet = FieldsUndet
+combineFieldInfos (FieldsUnknown) _ = FieldsUnknown
+combineFieldInfos _ (FieldsUnknown) = FieldsUnknown
+combineFieldInfos FieldsNone x = x
+combineFieldInfos x FieldsNone = x
+-- Combine results of different constructors
+-- See Note [Combining Branches]
+combineFieldInfos (FieldsProd fs1) (FieldsSum _ fs2) =
+ FieldsUntyped $ combineFieldsUntyped fs1 fs2
+combineFieldInfos (FieldsSum _ fs1) (FieldsProd fs2) =
+ FieldsUntyped $ combineFieldsUntyped fs1 fs2
+
+combineFieldInfos (FieldsSum c1 fs1) (FieldsSum c2 fs2)
+ | c1 /= c2 = FieldsUntyped $ combineFieldsUntyped fs1 fs2
+ | otherwise = FieldsSum c1 $
+ zipWithEqual "SumInfo:combine" combineLattices fs1 fs2
+combineFieldInfos (FieldsProd fs1) (FieldsProd fs2)
+ | l1 == l2 = FieldsProd $ combined
+ -- We might combine different types. See Note [Combining Branches]
+ | otherwise = FieldsProd $ combined ++ tail
+ where
+ combined = zipWith combineLattices fs1 fs2
+ tail
+ | l1 < l2 = drop l1 fs2
+ | l1 > l2 = drop l2 fs1
+ | otherwise = panic "combineFieldInfos: impossible"
+ !l1 = length fs1
+ !l2 = length fs2
+
+
+-- untyped v untyped
+combineFieldInfos (FieldsUntyped fs1) (FieldsUntyped fs2) =
+ FieldsUntyped $ combineFieldsUntyped fs1 fs2
+-- untyped v sum
+combineFieldInfos (FieldsSum _ fs1) (FieldsUntyped fs2) =
+ FieldsUntyped $ combineFieldsUntyped fs1 fs2
+combineFieldInfos (FieldsUntyped fs1) (FieldsSum _ fs2) =
+ FieldsUntyped $ combineFieldsUntyped fs1 fs2
+-- untyped v prod
+combineFieldInfos (FieldsProd fs1) (FieldsUntyped fs2) =
+ FieldsUntyped $ combineFieldsUntyped fs1 fs2
+combineFieldInfos (FieldsUntyped fs1) (FieldsProd fs2) =
+ FieldsUntyped $ combineFieldsUntyped fs1 fs2
+
+------------------------------------------------------------
+-- Utility functions to deal with lattices --
+------------------------------------------------------------
+
+
+-- Lattice of which we know, and can only know, the outer layer.
+flatLattice :: EnterInfo -> EnterLattice
+flatLattice x = EnterLattice x FieldsUnknown
+
+-- Lattice where we know there are no inner values.
+nullaryLattice :: EnterInfo -> EnterLattice
+nullaryLattice enterInfo = EnterLattice enterInfo FieldsNone
+
+-- Set (outermost) enterInfo
+setEnterInfo :: HasDebugCallStack => EnterLattice -> EnterInfo -> EnterLattice
+setEnterInfo lat@(EnterLattice enter fields) newEnter
+ | enter == newEnter
+ = lat
+ | otherwise = EnterLattice newEnter fields
+
+-- Lookup nth-field of the returned valued.
+-- Defaulting towards undetLat
+-- Zero indexed
+indexField :: EnterLattice -> Int -> EnterLattice
+indexField lat n =
+ case fieldInfo lat of
+ FieldsUndet -> undetLat
+ FieldsUnknown -> maybeLat
+ FieldsNone -> noValue
+ FieldsSum _ fields -> getField fields
+ FieldsProd fields -> getField fields
+ FieldsUntyped fields -> getField fields
+ where
+ getField fields =
+ case drop n fields of
+ -- We treat [] equal to [undetLat, undetLat, undetLat, ...]
+ [] -> undetLat
+ (x:_xs) -> x
+
+hasOuterTag :: EnterLattice -> Bool
+hasOuterTag lat = enterInfo lat == NeverEnter
+
+-- We use these to stop iterating on nodes which are already at the bot of the lattice.
+
+hasFinalFields :: EnterLattice -> Bool
+hasFinalFields lat =
+ case (fieldInfo lat) of
+ (FieldsUnknown ) -> True
+ (FieldsNone ) -> False
+ (FieldsUndet) -> False
+ (FieldsProd fields) -> all isFinalValue fields
+ (FieldsSum _ fields) -> all isFinalValue fields
+ (FieldsUntyped fields) -> all isFinalValue fields
+
+isFinalValue :: EnterLattice -> Bool
+isFinalValue lat = enterInfo lat == MaybeEnter && hasFinalFields lat
+
+nestingLevelOver :: EnterLattice -> Int -> Bool
+nestingLevelOver _ 0 = True
+nestingLevelOver (EnterLattice _ (FieldsProd fields)) n
+ = any (`nestingLevelOver` (n-1)) fields
+nestingLevelOver (EnterLattice _ (FieldsSum _ fields)) n
+ = any (`nestingLevelOver` (n-1)) fields
+nestingLevelOver (EnterLattice _ (FieldsUntyped fields)) n
+ = any (`nestingLevelOver` (n-1)) fields
+nestingLevelOver _ _ = False
+
+widenToNestingLevel :: Int -> EnterLattice -> EnterLattice
+widenToNestingLevel n l
+ | nestingLevelOver l n = -- pprTrace "capping" (ppr l) $
+ widenToNestingLevel' n l
+ | otherwise = l
+
+widenToNestingLevel' :: Int -> EnterLattice -> EnterLattice
+widenToNestingLevel' _ l@(EnterLattice _ FieldsUnknown ) = l
+widenToNestingLevel' _ l@(EnterLattice _ FieldsNone ) = l
+widenToNestingLevel' _ l@(EnterLattice _ FieldsUndet ) = l
+widenToNestingLevel' 0 _ = maybeLat
+widenToNestingLevel' n (EnterLattice e (FieldsProd fields)) =
+ EnterLattice e (FieldsProd $! (map (widenToNestingLevel' (n-1)) fields))
+widenToNestingLevel' n (EnterLattice e (FieldsSum c fields)) =
+ EnterLattice e (FieldsSum c $! map (widenToNestingLevel' (n-1)) fields)
+widenToNestingLevel' n (EnterLattice e (FieldsUntyped fields)) =
+ EnterLattice e (FieldsUntyped $! map (widenToNestingLevel' (n-1)) fields)
+
+
+-- Node IDs are generally *just* uniques created during the creation
+-- of the data flow graph.
+newtype NodeId = NodeId { nid_unique :: Unique } -- ^ Other nodes
+ deriving (Eq, Generic)
+
+instance Ord NodeId where
+ compare = comparing (getKey . nid_unique)
+
+instance Outputable NodeId where
+ ppr (NodeId i) = ppr i
+
+instance NFData NodeId where
+ rnf x = seq x ()
+
+instance Uniquable NodeId where
+ getUnique = nid_unique
+
+instance Uniquable FlowNode where
+ getUnique = getUnique . node_id
+
+data FlowState
+ = FlowState
+ { fs_idNodeMap :: !(UniqFM Id NodeId) -- ^ Map of imported id nodes (indexed by `Id`).
+ , fs_uqNodeMap :: !(UniqFM NodeId FlowNode) -- ^ Transient results, index by `NodeId`
+ , fs_doneNodes :: !(UniqFM NodeId FlowNode) -- ^ We can be sure these will no longer change, index by `NodeId`
+ }
+
+fromUEnv :: UFlowState -> FlowState
+fromUEnv (# id_map, uq_map, done_map #) =
+ FlowState {
+ fs_idNodeMap = id_map,
+ fs_uqNodeMap = uq_map,
+ fs_doneNodes = done_map }
+
+toUEnv :: FlowState -> UFlowState
+toUEnv !env = (# fs_idNodeMap env, fs_uqNodeMap env, fs_doneNodes env #)
+
+type UFlowState = (# (UniqFM Id NodeId), (UniqFM NodeId FlowNode), (UniqFM NodeId FlowNode) #)
+
+newtype AM a = AM { runAM :: UFlowState -> State# RealWorld
+ -> (# a, UFlowState, State# RealWorld #)
+ } deriving Functor
+
+instance Applicative AM where
+ {-# INLINE pure #-}
+ pure x = AM $ oneShot $ \env s -> (# x, env, s #)
+ {-# INLINE (<*>) #-}
+ m <*> n = AM $ oneShot $ \env s -> case runAM m env s of
+ (# f, env', s' #) -> case runAM n env' s' of
+ (# x, env'', s'' #) -> (# f x, env'', s'' #)
+
+instance Monad AM where
+ {-# INLINE (>>=) #-}
+ m >>= n = AM $ oneShot $ \env s -> case runAM m env s of
+ (# !x, env', s' #) -> runAM (n x) env' s'
+ {-# INLINE return #-}
+ return = pure
+
+get :: AM FlowState
+get = AM $ oneShot $ \env s -> (# fromUEnv env, env, s #)
+
+put :: FlowState -> AM ()
+put !env = AM $ oneShot $ \_ s -> (# (), toUEnv env, s #)
+
+evalAM :: FlowState -> AM a -> a
+evalAM env (AM f) = runRW# $ \s ->
+ case f (toUEnv env) s of
+ (# x, _env', _s' #) -> x
+
+instance MonadIO AM where
+ liftIO (IO f) =
+ AM $ oneShot $ \env s ->
+ case f s of
+ (# s', !x #) -> (# x, env, s' #)
+
+
+-- TODO: Add to list in UniqSupply
+inferenceUniqueKey :: Char
+inferenceUniqueKey = 't'
+
+instance MonadUnique AM where
+ getUniqueSupplyM = do
+ liftIO $! mkSplitUniqSupply inferenceUniqueKey
+
+ getUniqueM = do
+ liftIO $! uniqFromMask inferenceUniqueKey
+
+isDone :: Bool
+isDone = True
+notDone :: Bool
+notDone = False
+
+-- | Add new node, maybe mark it done.
+addNode :: Bool -> FlowNode -> AM ()
+addNode done node = do
+ s <- get
+ if done
+ then put $! s { fs_doneNodes = addToUFM (fs_doneNodes s) (node_id node) node
+ , fs_uqNodeMap = delFromUFM (fs_uqNodeMap s) (node_id node) }
+ else do
+ ASSERTM( not <$> isMarkedDone (node_id node))
+ put $! s { fs_uqNodeMap = addToUFM (fs_uqNodeMap s) (node_id node) node }
+
+-- Update existing node
+-- Kept separate in case we want to refactor later.
+updateNode :: Bool -> FlowNode -> AM ()
+updateNode done node = do
+ addNode done node
+
+-- | Move the node from the updateable to the finished set
+markDone :: FlowNode -> AM ()
+markDone node = do
+ updateNode isDone node
+
+-- | Pessimistic check, defaulting to False when it's not clear.
+isMarkedDone :: HasDebugCallStack => NodeId -> AM Bool
+isMarkedDone id = do
+ s <- get
+ return $! elemUFM id (fs_doneNodes s)
+
+updateNodeResult :: NodeId -> EnterLattice -> AM ()
+updateNodeResult id result = do
+ node <- (getNode id)
+ updateNode notDone (node {node_result = result})
+
+
+getNode :: HasDebugCallStack => NodeId -> AM FlowNode
+getNode node_id = do
+ s <- get
+ return $! fromMaybe
+ (pprPanic "Node not found" (ppr node_id))
+ (lookupUFM (fs_doneNodes s) node_id <|> lookupUFM (fs_uqNodeMap s) node_id)
+
+
+-- We will never use this function to query for
+-- non-existing nodes in the absence of bugs.
+lookupNodeResult :: HasDebugCallStack => NodeId -> AM EnterLattice
+lookupNodeResult node_id = do
+ s <- get
+ let node = (lookupUFM (fs_uqNodeMap s) node_id <|>
+ lookupUFM (fs_doneNodes s) node_id)
+ case node of
+ Nothing -> do
+ when debugIsOn $
+ pprTraceM ("lookpupNodeResult: Nothing\n" ++ prettyCallStack callStack) (ppr node_id)
+ return undetLat
+ Just n -> return $! node_result n
+
+{-
+ Note [Field information of function ids]
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+Consider this code:
+
+f x :: a -> (Maybe Int,a)
+f x = (Just 1, a)
+
+We can infer the taggedness of all but the second field of the tuple.
+
+However if we have code like this:
+
+f x :: a -> (Maybe Int,a)
+f x = (Just 1, a)
+
+g _ =
+ let v = Just f
+ ...
+ in
+ case v of
+ Just f' -> f' True
+ Nothing -> f False
+
+If we keep the field information of f when stored inside a constructor then
+we can eventually figure out that f' == f, so all branches have the same return taggedness info
+which is the same as the one of f. So we could infer as the taggedness of g's result:
+
+ enterInfo(g) = NeverEnter < NeverEnter < NeverEnter >, MaybeEnter>
+ ^ func ^ Just ^ 1 ^ "a"
+
+However currently when when we bind a function to a variable we throw away any field information
+of the functions result. We do not *have* to strip this information, it's merely done for performance.
+
+TODO:
+ This could be done, at the expense of compile time. We should benchmark this as future work
+ to figure out of it's worth and do it if useful.
+
+ Same thing for keeping track of the original function. Potentially removing some unknown calls.
+
+-}
+
+-- | If we use a *function* as an unapplied argument to a constructor we throw
+-- away nested information and make do with NeverEnter Top for now.
+-- See Note [Field information of function ids]
+getConArgNodeId :: HasDebugCallStack => ContextStack -> StgArg -> AM NodeId
+getConArgNodeId _ (StgLitArg _ ) = return litNodeId
+getConArgNodeId ctxt (StgVarArg v )
+ | isFunTy (unwrapType $ idType v)
+ = return neverNodeId
+ | otherwise
+ = getIdNodeId ctxt v
+
+-- Potential performance improvements.
+-- TODO: We could put the result into it's own map of NodeId -> EnterLattice
+-- or even an array. But that complicates the code somewhat and performance
+-- doesn't seem to be an issue currently.
+--
+-- TODO: We could remove the node_id field completely as well. When allocating the node
+-- we do know the node_id and capture it in a closure/the key of the map if needed.
+-- Anyone querying the node also knows which id he queries for.
+-- However adding an unused field seems to only increase allocations for *findTags*
+-- by ~0,3% and helps a lot with debugging. So no good reason to do so currently.
+data FlowNode
+ = FlowNode
+ { node_id :: {-# UNPACK #-} !NodeId -- ^ Node id
+ , node_inputs :: [NodeId] -- ^ Input dependencies
+ , node_result :: !(EnterLattice) -- ^ Cached result
+ , node_update :: (AM EnterLattice) -- ^ Calculates a new value for the node
+ -- AND updates the value in the environment.
+#if defined(WITH_NODE_DESC)
+ , _node_desc :: SDoc -- ^ Debugging purposes
+#endif
+ }
+
+node_desc :: FlowNode -> SDoc
+#if defined(WITH_NODE_DESC)
+node_desc n = _node_desc n
+#else
+node_desc _n = empty
+#endif
+
+instance NFData FlowNode where
+ rnf ( FlowNode
+ { node_id = _
+ , node_inputs = node_inputs
+ -- , node_done = _
+ , node_result = node_result
+ , node_update = _
+#if defined(WITH_NODE_DESC)
+ , _node_desc = _
+#endif
+ }) = deepseq (node_inputs,node_result) ()
+
+instance Outputable FlowNode where
+ ppr node =
+ hang
+ (text "node_" <> pprId node <-> pprDone node <-> (node_desc node) )
+ 2
+ ( (ppr $ node_inputs node) <> parens (ppr $ node_result node) )
+ where
+ pprId node =
+ case node_id node of
+ NodeId uq -> ppr uq
+ pprDone _node = empty
+ -- if node_done node then text "done" else empty
+
+data IsLNE = LNE | NotLNE deriving (Eq)
+
+instance Outputable IsLNE where
+ -- ppr :: IsLNE -> SDoc
+ ppr NotLNE = empty
+ ppr LNE = text "-LNE"
+
+-- Syntactic context of the construct the node represents.
+-- For most cases including a mapping
+-- of in-scope ids to their data flow nodes/labels.
+--
+-- Primarily used to avoid shadowing. But CCaseScrut is also
+-- needed to determine tail recursive calls.
+-- See also Note [Recursive Functions]
+data SynContext
+ = CTopLevel !(VarEnv NodeId)
+ -- | letrec x = <here> in body
+ | CLetRec !(VarEnv NodeId) !IsLNE
+ -- | letrec x = e in <here>
+ | CLetRecBody !(VarEnv NodeId) !IsLNE
+ | CLet !(VarEnv NodeId) !IsLNE
+ | CLetBody !(VarEnv NodeId) !IsLNE
+ | CClosureBody !(VarEnv NodeId)
+ | CCaseScrut
+ | CCaseBndr !(VarEnv NodeId)
+ | CAlt !(VarEnv NodeId)
+ deriving Eq
+
+type ContextStack = [SynContext]
+
+getCtxtIdMap :: SynContext -> Maybe (VarEnv NodeId)
+getCtxtIdMap (CClosureBody m) = Just m
+getCtxtIdMap (CCaseBndr m) = Just $ m
+getCtxtIdMap (CCaseScrut) = Nothing
+getCtxtIdMap (CAlt m) = Just m
+getCtxtIdMap (CLetRec m _) = Just m
+getCtxtIdMap (CLetRecBody m _) = Just m
+getCtxtIdMap (CLet m _) = Just m
+getCtxtIdMap (CLetBody m _) = Just m
+getCtxtIdMap (CTopLevel m) = Just m
+
+extendCtxt :: SynContext -> ContextStack -> ContextStack
+extendCtxt c ctxt = c : ctxt
+
+instance Outputable SynContext where
+ ppr (CTopLevel map) = text "CTop" <> ppr map
+ ppr (CAlt map) = text "CAlt" <> ppr map
+ ppr CCaseScrut = text "CCaseScrut"
+ ppr (CCaseBndr map) = text "CCaseBndr" <> ppr map
+ ppr (CClosureBody map) = text "CClosure" <> ppr map
+ ppr (CLetRec ids lne) = text "CLetRec" <> ppr lne <> ppr ids
+ ppr (CLetRecBody ids lne) = text "CLetRecBody" <> ppr lne <> ppr ids
+ ppr (CLet id lne) = text "CLet" <> ppr lne <> ppr id
+ ppr (CLetBody id lne) = text "CLetBody" <> ppr lne <> ppr id
+
+-- | Is the given id mapped to a data flow node in the given context?
+idMappedInCtxt :: Id -> ContextStack -> Maybe NodeId
+idMappedInCtxt id ctxt
+ = go ctxt
+ where
+ go (ctxt:_)
+ | Just argMap <- getCtxtIdMap ctxt
+ , Just node <- lookupVarEnv argMap id
+ = Just $! node
+ go (_:todo) = go todo
+ go [] = Nothing
+
+-- `isRecTail f ctxt`
+-- Determine if f called in context ctxt is a recursive tail call.
+-- If so it's result will be NoValue.
+-- See Note [Recursive Functions]
+isRecTail :: Id -> ContextStack -> Bool
+isRecTail _f (CTopLevel _ : _) = False
+isRecTail f (CLetRec bnds _: _)
+ | isSingleMapOf f bnds
+ = True
+isRecTail f (CLetRec _ LNE : ctxt) = isRecTail f ctxt
+isRecTail _f (CLetRec _ NotLNE : _ ) = False
+isRecTail f (CLetRecBody bnds _ :ctxt)
+ -- `let x = e in .. -> x`
+ -- is not a recursive tail call
+ | f `elemVarEnv` bnds = False
+ | otherwise = isRecTail f ctxt
+isRecTail f (CLet _ LNE : ctxt) = isRecTail f ctxt
+isRecTail _f (CLet _ NotLNE : _) = False
+isRecTail f (CLetBody bnds _ : ctxt)
+ | elemVarEnv f bnds = False
+ | otherwise = isRecTail f ctxt
+isRecTail f (CClosureBody args : ctxt)
+ | f `elemVarEnv` args = False
+ | otherwise = isRecTail f ctxt
+isRecTail _f (CCaseScrut : _) = False
+isRecTail f (CCaseBndr bnd : ctxt )
+ | elemVarEnv f bnd
+ = False
+ | otherwise
+ = isRecTail f ctxt
+isRecTail f (CAlt bnds : ctxt)
+ | f `elemVarEnv` bnds = False
+ | otherwise = isRecTail f ctxt
+isRecTail f x = pprPanic "Incomplete" $ ppr (f,x)
+
+-- | isSingleMapOf v env == fromList [(v',_)] && v == v'
+--
+-- Used to determine recursive calls.
+isSingleMapOf :: Id -> VarEnv NodeId -> Bool
+isSingleMapOf v env =
+ isSingletonUFM env && elemVarEnv v env
+
+-- | Create a data flow note which combines multiple branches.
+-- See Note [The lattice element combinators]
+mkJoinNode :: [NodeId] -> AM NodeId
+mkJoinNode [] = return unknownNodeId
+mkJoinNode [node] = return node
+mkJoinNode inputs = do
+ node_id <- mkUniqueId
+ let updater = do
+ input_results <- mapM lookupNodeResult inputs
+ let result = foldl1' combineLattices input_results
+ if isFinalValue result
+ then do
+ node <- getNode node_id
+ markDone $ node { node_result = result }
+ else updateNodeResult node_id result
+ return $! result
+
+ addNode notDone $ FlowNode { node_id = node_id, node_result = undetLat
+ , node_inputs = inputs -- , node_done = False
+ , node_update = updater
+#if defined(WITH_NODE_DESC)
+ , _node_desc = text "branches"
+#endif
+ }
+ return $! node_id
+
+-- | Compute the taggedness result of applying a constructor to the given arguments
+-- *and* applying the strict field invariant. Marking all strict fields as tagged.
+mkOutConLattice :: DataCon -> EnterInfo -> [EnterLattice] -> EnterLattice
+mkOutConLattice con outer fields
+ | null fields = EnterLattice outer $ FieldsNone
+ | conCount == 1 = EnterLattice outer $ FieldsProd out_fields
+ | conCount > 1 = EnterLattice outer $ FieldsSum (Just con) out_fields
+ | otherwise = panic "mkOutConLattice"
+ where
+ out_fields = mapStrictConArgs con (`setEnterInfo` NeverEnter) fields
+ conCount = length (tyConDataCons $ dataConTyCon con)
+
+{-# NOINLINE findTags #-}
+findTags :: DynFlags -> Module -> [StgTopBinding] -> ([TgStgTopBinding], [(Id,EnterLattice)])
+-- findTags this_mod us binds = passTopBinds binds
+findTags dflags this_mod binds =
+ let state = FlowState {
+ fs_idNodeMap = mempty,
+ fs_uqNodeMap = emptyUFM,
+ fs_doneNodes = emptyUFM }
+ -- Run the analysis
+ analysis :: AM ([TgStgTopBinding], [(Id, EnterLattice)])
+ analysis = do
+ addConstantNodes
+ (binds',_mapping) <- {-# SCC "mkFlowNodes" #-}
+ nodesTopBinds this_mod binds
+ {-# SCC "solveConstraints" #-} (solveConstraints dflags)
+ -- exports <- exportTaggedness mapping
+ exports <- return mempty -- Should probably remove this
+ !finalBinds <- {-# SCC "rewriteAST" #-}
+ rewriteTopBinds binds'
+ return (finalBinds, exports)
+ (!binds', exports) = evalAM state $ analysis
+ in (seqTopBinds binds') `seq`
+ -- pprTrace "foundBinds" (ppr this_mod)
+ (binds',exports)
+
+-- Constant mappings
+addConstantNodes :: AM ()
+addConstantNodes = do
+ markDone litNode
+ markDone addrNode
+ markDone $ mkConstNode undetNodeId undetLat (text "undet")
+ markDone $ mkConstNode unknownNodeId maybeLat (text "bot")
+ markDone $ neverEnterNode
+ markDone $ maybeEnterNode
+ markDone $ alwaysEnterNode
+
+
+mkConstNode :: NodeId -> EnterLattice -> SDoc -> FlowNode
+mkConstNode id !val _desc =
+ FlowNode
+ { node_id = id
+ , node_inputs = []
+ --, node_done = True
+ , node_result = val
+ , node_update = (return $! val)
+#if defined(WITH_NODE_DESC)
+ , _node_desc = _desc
+#endif
+
+ }
+
+-- Some nodes we can reuse.
+litNodeId, undetNodeId, unknownNodeId, neverNodeId, maybeNodeId,
+ alwaysNodeId, addrNodeId, nullaryConNodeId :: NodeId
+litNodeId = NodeId $ mkUnique 'c' 2
+undetNodeId = NodeId $ mkUnique 'c' 3 -- Always returns undetLat
+unknownNodeId = NodeId $ mkUnique 'c' 4
+neverNodeId = NodeId $ mkUnique 'c' 5
+maybeNodeId = NodeId $ mkUnique 'c' 6
+alwaysNodeId = NodeId $ mkUnique 'c' 7
+addrNodeId = NodeId $ mkUnique 'c' 8
+nullaryConNodeId = NodeId $ mkUnique 'c' 9
+
+alwaysEnterNode, maybeEnterNode, neverEnterNode, litNode, addrNode, nullaryConNode :: FlowNode
+alwaysEnterNode = mkConstNode alwaysNodeId (flatLattice AlwaysEnter) (text "always")
+maybeEnterNode = mkConstNode maybeNodeId (flatLattice MaybeEnter) (text "maybe")
+neverEnterNode = mkConstNode neverNodeId (flatLattice NeverEnter) (text "never")
+litNode = mkConstNode litNodeId (nullaryLattice NeverEnter) (text "lit")
+addrNode = mkConstNode addrNodeId (nullaryLattice NeverEnter) (text "c_str")
+nullaryConNode = mkConstNode nullaryConNodeId (nullaryLattice NeverEnter) (text "nullCon")
+
+{- Note [Imported Ids]
+ ~~~~~~~~~~~~~~~~~~~
+
+# Assigning data flow nodes to imported ids.
+
+We want to keep our Ids a simple newtype around Unique.
+This is "easy" for things brought into scope by the AST we work with.
+We simply put a mapping from the Id to the NodeId into SynContext.
+We can then map ids to their data flow nodes based on the SynContext
+we are in.
+
+However imported Id's can show up in any place in the AST and we want to
+avoid traversing the whole AST twice just to gather them up beforehand.
+We solve this by creating a Node and NodeId for each imported
+id when we come across the id the first time.
+
+The next time we come across the same id getIdNodeId will check
+fs_idNodeMap, find the node we created earlier and return the
+same node.
+
+!! Note that the Unique of an ID, and it's corresponding NodeId !!
+!! are not correlated. !!
+
+# Taggedness of imported ids
+
+This is currently determined fully in addImportedNode since
+the result of tag inference is not exported in interface files.
+
+The rules are simply:
+ * Field info is always Unknown
+
+ Enterinfo is:
+ * NeverEnter for functions with known Arity
+ * NeverEnter for nullarry constructors
+ * NeverEnter for ids with Absent divergence. (absentError expressions)
+ * AlwaysEnter for Thunks - Technically the RTS might evaluate them so *always* is a lie here.
+ * MaybeEnter otherwise.
+
+ Note [Shadowing and NodeIds]
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+Shadowing makes things more complex.
+
+While constructing the data flow graph we have to be able to relate
+every variable v to a data flow node describing v's value.
+However the same variable can have different values in different because
+of shadowing. For this reason we keep around a context which allows us to
+map variables to nodes. Whenever a new variable comes into scope this context
+is extended.
+
+We then use getIdNodeId to get the node associated with an specific Id in
+an specific context. It also takes care of imported Ids (See Note [Imported Ids]).
+
+When we want to get the nodeId for a particular id which *must*
+already present in a context we use getKnownIdNodeId.
+
+-}
+
+-- See Note [Shadowing and NodeIds]
+getIdNodeId :: HasDebugCallStack => ContextStack -> Id -> AM NodeId
+getIdNodeId ctxt id
+ | Just node <- idMappedInCtxt id ctxt
+ = return $! node
+ | otherwise = do
+ s <- get
+ return $! fromMaybe (pprPanic "Unmapped id" (ppr id)) $
+ lookupUFM (fs_idNodeMap s) id
+
+-- See Note [Shadowing and NodeIds]
+getKnownIdNodeId :: HasDebugCallStack => ContextStack -> Id -> NodeId
+getKnownIdNodeId ctxt id
+ | Just node <- idMappedInCtxt id ctxt
+ = node
+ | otherwise = pprPanic "Local id not mapped:" (ppr id)
+
+mkUniqueId :: AM NodeId
+mkUniqueId = NodeId <$> getUniqueM
+
+
+-- | This adds a node containing information about an imported id.
+-- Logic mimics somewhat what we do in StgCmmClosure.hs:mkLFImported
+-- See also Note [Imported Ids]
+addImportedNode :: Module -> Id -> AM ()
+addImportedNode this_mod id
+ -- Local id, it has to be mapped to an id via SynContext
+ | nameIsLocalOrFrom this_mod (idName id) = return ()
+ | otherwise = do
+ -- Check if it is already cached.
+ s <- get
+ let idNodes = fs_idNodeMap s
+ -- If not make up a new node.
+ when (not $ elemUFM id idNodes) $ do
+ new_node_id <- mkUniqueId
+ let node
+ -- Functions tagged with arity are never entered, only applied.
+ | idFunRepArity id > 0
+ = set_if_desc neverEnterNode new_node_id (text "ext_func" <-> ppr id)
+
+ -- Known Nullarry constructors are also never entered
+ -- but for them it's important to preserve the information
+ -- of no fields.
+ | Just con <- (isDataConWorkId_maybe id)
+ , isNullaryRepDataCon con
+ = set_if_desc nullaryConNode new_node_id (text "ext_nullCon" <-> ppr id)
+
+ -- Imported binding of absentError
+ | (_, Absent) <- splitStrictSig (idStrictness id)
+ = set_if_desc neverEnterNode new_node_id (text "ext_absent_error" <-> ppr id)
+
+ | Just lf_info <- idLFInfo_maybe id
+ = case lf_info of
+ -- Function, applied not entered.
+ LFReEntrant {}
+ -> set_if_desc neverEnterNode new_node_id (text "ext_lf_func" <-> ppr id)
+ -- Thunks need to be entered.
+ LFThunk {}
+ -> set_if_desc alwaysEnterNode new_node_id (text "ext_lf_thunk" <-> ppr id)
+ -- Constructors, already tagged.
+ LFCon {}
+ -- If we ever bind the fields we can infer the tags
+ -- based on the fields strictness. So a flat lattice
+ -- is fine.
+ -> set_if_desc neverEnterNode new_node_id (text "ext_lf_con" <-> ppr id)
+ LFUnknown {}
+ -> set_if_desc maybeEnterNode new_node_id (text "ext_lf_unknown" <-> ppr id)
+ LFUnlifted {}
+ -> set_if_desc neverEnterNode new_node_id (text "ext_lf_unlifted" <-> ppr id)
+ -- Shouldn't be possible. I don't think we can export letNoEscapes
+ LFLetNoEscape {}
+ -> set_if_desc maybeEnterNode new_node_id (text "ext_lf_lne" <-> ppr id)
+
+ -- General case, a potentially unevaluated imported id.
+ | not isFun
+ = set_if_desc maybeEnterNode new_node_id (text "ext_unknown_enter" <-> ppr id)
+
+ -- May or may not be entered.
+ | otherwise
+ = set_if_desc maybeEnterNode new_node_id (text "ext_unknown" <-> ppr id)
+ put $!
+ s { fs_idNodeMap = addToUFM (fs_idNodeMap s) id new_node_id
+ , fs_doneNodes = addToUFM (fs_doneNodes s) new_node_id node }
+ where
+ isFun = isFunTy (unwrapType $ idType id)
+ -- | When we don't use descriptions we can avoid creating
+ -- a new node for e.g. each literal string. So we set the
+ -- id only if descriptions are enabled.
+ set_if_desc :: FlowNode -> NodeId -> SDoc -> FlowNode
+#if defined(WITH_NODE_DESC)
+ set_if_desc node node_id desc = node { _node_desc = desc, node_id = node_id}
+#else
+ set_if_desc node _id _desc = node
+#endif
+
+-- | Returns the nodeId for a given imported Id.
+importedFuncNode_Maybe :: Module -> Id -> AM (Maybe NodeId)
+importedFuncNode_Maybe this_mod var_id
+ -- Not an imported function
+ | nameIsLocalOrFrom this_mod (idName var_id)
+ = return Nothing
+ | otherwise = do
+ s <- get
+ case lookupUFM (fs_idNodeMap s) var_id of
+ Just node_id -> return $! Just node_id
+ Nothing -> pprPanic "Imported id not mapped" (ppr var_id)
+
+-- Get or make a nodeId for the given Id based on context.
+mkCtxtEntry :: ContextStack -> Id -> AM (Id,NodeId)
+mkCtxtEntry ctxt v
+ | Just nodeId <- idMappedInCtxt v ctxt
+ = return $! (v,nodeId)
+ | otherwise
+ = do
+ !node_id <- mkUniqueId
+ return $! (v, node_id)
+
+{-# NOINLINE nodesTopBinds #-}
+-- Note: We could expose the computed information about top level bindings
+-- via interface files (or otherwise). But currently it's unused even though we return it.
+nodesTopBinds :: Module -> [StgTopBinding] -> AM ([InferStgTopBinding], (VarEnv NodeId))
+nodesTopBinds this_mod binds = do
+ -- We preallocate node ids for the case where we must reference an node by id
+ -- before we traversed the defining binding. (e.g. recursive groups)
+
+ -- TODO: bindersOfTopBinds allocates an intermediate list, but we really
+ -- shouldn't need to.
+ let bind_ids = bindersOfTopBinds binds :: [Id]
+ mappings <- foldM insertIdMapping mempty bind_ids :: AM (VarEnv NodeId)
+ let topCtxt = CTopLevel mappings
+ binds' <- mapM (nodesTop this_mod topCtxt) binds
+ return (binds', mappings)
+ where
+ insertIdMapping :: VarEnv NodeId -> Id -> AM (VarEnv NodeId)
+ insertIdMapping env v
+ | idType v `eqType` addrPrimTy
+ = return $! extendVarEnv env v addrNodeId
+ | otherwise
+ = extendVarEnv env v <$!> mkUniqueId
+
+nodesTop :: Module -> SynContext -> StgTopBinding -> AM InferStgTopBinding
+nodesTop _this_mod _ctxt (StgTopStringLit v str) = return (StgTopStringLit v str)
+ -- String literals (and unlifted ids in general) are never entered.
+ -- There is also no nested information so we can represent them all
+ -- with a single preallocted data flow node. The ids are mapped to this
+ -- node in `nodesTopBinds`
+
+nodesTop this_mod ctxt (StgTopLifted bind) = do
+ bind' <- fst <$> nodesBind this_mod [ctxt] TopLevel NotLNE bind :: AM InferStgBinding
+ return $! (StgTopLifted bind')
+
+-- nodesBind creates the nodeIds for the bound rhs, the actual nodes are created in
+-- nodeRhs. Returns the context including the let.
+nodesBind :: Module -> ContextStack -> TopLevelFlag -> IsLNE -> StgBinding -> AM (InferStgBinding, ContextStack)
+nodesBind this_mod ctxt bot lne (StgNonRec v rhs) = do
+ boundId <- uncurry unitVarEnv <$> mkCtxtEntry ctxt v
+ let ctxt' = ((CLet boundId lne) `extendCtxt` ctxt)
+ rhs' <- (nodeRhs this_mod ctxt' bot v rhs)
+ return $! (StgNonRec v rhs', (CLetBody boundId lne) `extendCtxt` ctxt)
+nodesBind this_mod ctxt bot lne (StgRec binds) = do
+ let ids = map fst binds
+ boundIds <- mkVarEnv <$> mapM (mkCtxtEntry ctxt) ids :: AM (VarEnv NodeId)
+ let ctxt' = (CLetRec boundIds lne) `extendCtxt` ctxt
+ rhss' <- mapM (uncurry (nodeRhs this_mod ctxt' bot )) binds
+ return $! (StgRec $ zip ids rhss', (CLetRecBody boundIds lne) `extendCtxt` ctxt)
+
+
+{- Note [RhsCon data flow]
+ ~~~~~~~~~~~~~~~~~~~~~~~
+
+Describes rules for lets like this:
+
+ let x = Con args@[a1 .. an]
+
+The data flow visually looks something like this.
+
++-----+ +------+
+| con | | args |
++--+--+ +--+---+
+ | |
+ v v
+ +---------+
+ | rhsNode |
+ +---------+
+
+The behaviour here is very similar to the one for
+nodeConApp with a few alterations to account for the fact
+that the result will be associated with a binding. The major
+difference being that the rhsNode and the binding will be represented
+by a single dataflow node.
+
+The EnterLattices of the arguments are taken as is and are put
+into the FieldInfo of the rhsNode.
+The only exception is that we set strict fields to
+NeverEnter because of the strict field invariant.
+See also Note [The strict field invariant]
+
+Doing this is implemented in mkOutConLattice.
+
+The enterinfo is determined by a number of rules, required to uphold [The strict field invariant].
+The main drivers are:
+1) By default we infer tagged (NeverEnter) for all constructors allocated via a StgRhsCon because any
+ regular constructor allocation results in a tagged pointer to the Constructor.
+2) Top level constructor applications might turn into thunks if we need force any of their
+ arguments to uphold the strict field invariant.
+3) Recursive groups where strict arguments are defined in the group are currently
+ considered MaybeEnter.
+
+The enterInfo of the result is determined by checking these conditions
+in order:
+
+a.1) If the binding is not defined at the top level
+ and is a non recursive binding:
+-> NeverEnter, we can just wrap the constructor application in a Case.
+
+a.2) If the binding is not defined at the top level
+ and is in a recursive binding group, but all strict args
+ are defined outside of the recursive group:
+-> NeverEnter, we can just wrap the constructor application in a Case.
+
+b) If there are no strict fields
+-> NeverEnter, see 1)
+
+c) If all strict field arguments are tagged (NeverEnter)
+-> NeverEnter, see 1)
+
+d) If any strict field arguments are UndetEnterInfo
+-> UndetEnterInfo, if we don't know if a strict argument is already tagged
+ then we don't know if we need to wrap this application in
+ a case.
+
+e) Otherwise
+-> MaybeEnter
+
+ Examples:
+ ~~~~~~~~
+
+Condition a.1) Unevaluated values in strict fields.
+
+ data StrictLazy a b = SL !a b
+ foo =
+ ...
+ let a1 = undefined
+ let a2 = ...
+ ...
+ let x = SL a1 a2
+ ...
+
+ enterInfo(x) = NeverEnter <NeverEnter, enterInfo(a2)>
+
+ Since we deal with a local let binding we will (after the analysis has run)
+ push the allocation of the constructor past the evaluation of the arguments
+ like this:
+
+ foo =
+ ...
+ let a1 = undefined
+ let a2 = True
+ ...
+ case a1 of a1'
+ DEFAULT ->
+ let x = SL a1' a2
+ ...
+
+ This is essentially what the Worker for the constructor would do
+ as well. We can always do this for *any* local non-recursive let.
+
+ Assinging NeverEnter to the first field will seem odd at first. But
+ it makes sense once we consider that enterInfo(x) represents information
+ about `x` *after* allocation of the constructor. Should arguments of
+ strict fields be bottom then the constructor will not be allocated at
+ all so there is no conflict.
+
+ For this reason we can *always* set the information for strict fields
+ to NeverEnter.
+
+ Should there be multiple strict fields we simple generate more than
+ one wrapping case expression.
+
+Condition a.1) Tagged (NeverEnter) arguments to strict fields
+
+ Rule a.1 also applies when we don't need a wrapping case expression.
+ As is the case if the argument is already tagged. For example in this
+ code:
+
+ data StrictLazy a b = SL !a b
+ foo =
+ ...
+ let a1 = True -- Nullary constructors are always unlifted/tagged.
+ let x = SL a1 a2
+ ...
+
+ Since we know a1 is tagged we don't need to insert a case and
+ we get the following enterInfo:
+
+ enterInfo(x) == NeverEnter <NeverEnter, enterInfo(a2)>
+
+ This also applies if x would be bound at the top level.
+
+
+Condition a.2) wrapping local recursive groups:
+
+ data StrictLazy a b = SL !a b
+ foo =
+ ...
+ let a1 = undefined
+ ...
+ letrec {
+ x = SL a1 y;
+ y = Just x
+ ...
+
+ This can be wrapped just like the example for Rule a.1):
+
+ foo =
+ ...
+ let a1 = undefined
+ ...
+ case a1 of a1'
+ DEFAULT ->
+ letrec {
+ x = SL a1' y;
+ y = Just x
+ ...
+
+ and results in enterInfo(x) = NeverEnter <NeverEnter, enterInfo(y)>
+
+Condition b) Lazy constructors are always marked as NeverEnter.
+
+ baz =
+ ...
+ let foo = Con1 a1 a2 a3
+ ...
+
+ bar = Con2 a1' a2'
+
+ Both foo and bar get NeverEnter as enter info. The field info is
+ exactly the same as the arguments. eg.
+
+ enterInfo(foo) = NeverEnter<enterInfo(a1), enterInfo(a2), enterInfo(a3)>
+
+ This works for both top level and local constructor bindings. This is because
+ when we allocate a regular constructor the result is a tagged pointer
+ (to the constructor). Since all fields are lazy we also are not in danger of
+ having to wrap the constructor in a case (which would turn it into a Thunk).
+
+Condition c) Strict constructors with tagged arguments.
+
+ foo =
+ let a1 = True
+ let a2 = False
+ ...
+ let x = StrictPair a1 a2
+ ...
+
+ We can trivially infer that a1/a2 will be tagged (as they are nullary constructors).
+ With this information available we can infer that there is no danger of the rhs
+ turning into a thunk and as such we can infer enterInfo(x) = NeverEnter <NeverEnter, NeverEnter>
+
+Condition d) Strict field undetermined
+
+ Assuming we have infered so far that:
+
+ enterInfo(a1) = UndetEnterInfo
+ enterInfo(a2) = UndetEnterInfo
+
+ and analyse this snippet:
+
+ foo = StrictPair a1 a2
+
+ We don't know if the arguments are tagged. As consequence we
+ don't know if Case wrapping is required.
+
+ Should we require Case wrapping, the binding will turn into a thunk.
+ Should we not require wrapping, the binding will be tagged (NeverEnter).
+
+ But since we can't determine this from the current state we the infered result will
+ be:
+ enterInfo(foo) = UndetEnterInfo <NeverEnter, NeverEnter>
+
+ Keep in mind that the enterInfo for the fields of `foo` is NeverEnter since strict
+ fields always get a enterInfo of NeverEnter.
+
+Condition e) Default: Fall back to MaybeEnter.
+
+ If none of the other conditions matched *then* we fall back to MaybeEnter.
+
+ For us to reach e) there must be strict fields and
+ they must be applied to a binder with enterInfo of AlwaysEnter/MaybeEnter/NoValue.
+
+ If there is a value of MaybeEnter/AlwaysEnter for one of the strict arguments
+ we need to evaluate this argument before allocation. In order to do this we will turn
+ this RhsCon into a RhsClosure. Turning the rhs into a thunk.
+
+ For example we have inferred:
+
+ enterInfo(thunk) = AlwaysEnter
+
+ and are looking at this code:
+
+ foo = StrictJust thunk
+
+ We will infer enterInfo(foo) = MaybeEnter <NeverEnter> and rewrite the binding to
+
+ foo = case thunk of x -> StrictJust x
+
+ Which turns foo into a thunk.
+
+ Note that this case also handles the situations where we apply bottoming bindings
+ to strict constructors. For example if enterInfo(thunk) is NoValue this
+ represents storing the result of a computation which will not return into a
+ strict field. We can safely treat this the same as the AlwaysEnter/MaybeEnter case.
+
+ For example we might have:
+
+ loop x = loop x
+ thunk = loop ()
+
+ foo = StrictJust thunk
+
+ Then we infer enterInfo(foo) = MaybeEnter <NeverEnter> and rewrite the AST
+ to
+
+ loop x = loop x
+ thunk = loop ()
+
+ foo = case thunk of x -> StrictJust x
+
+ In practice hitting this condition is quite rare. But it can make code slightly worse
+ as some constructor applications at the top level turn into thunks.
+
+-}
+
+-- | Dealing with let bound rhss.
+-- We pass in the id to which the RHS is bound. This allows us to check
+-- if the RHS is part of a recursive group.
+nodeRhs :: HasDebugCallStack => Module -> ContextStack -> TopLevelFlag
+ -> Id -> StgRhs
+ -> AM (InferStgRhs)
+nodeRhs this_mod ctxt topFlag binding (StgRhsCon _ ccs con args)
+ | null args = do
+ -- pprTraceM "RhsConNullary" (ppr con <+> ppr node_id <+> ppr ctxt)
+ let node = mkConstNode node_id (EnterLattice NeverEnter FieldsNone)
+ (ppr binding <-> text "rhsConNullary")
+ markDone $ node
+ return $! (StgRhsCon (node_id,RhsCon) ccs con args)
+ | otherwise = do
+
+ mapM_ (addImportedNode this_mod ) [v | StgVarArg v <- args]
+ node_inputs <- mapM (getConArgNodeId ctxt) args :: AM [NodeId]
+ -- pprTraceM "RhsCon" (ppr con <+> ppr node_id <+> ppr args <+> ppr node_inputs <+> ppr ctxt)
+ let node = FlowNode
+ { node_id = node_id
+ , node_inputs = node_inputs
+ --, node_done = False
+ , node_result = undetLat
+ , node_update = node_update node_id node_inputs
+#if defined(WITH_NODE_DESC)
+ , _node_desc = (ppr binding <-> text "rhsCon")
+#endif
+ }
+ addNode notDone node
+
+ return $! (StgRhsCon (node_id,remainsConRhs) ccs con args)
+ where
+ node_id = getKnownIdNodeId ctxt binding
+ !remainsConRhs
+ | isTopLevel topFlag = MaybeClosure
+ -- a.1)
+ | (CLet _ _ : _) <- ctxt = RhsCon
+ -- a.2)
+ | (CLetRec binds _ : _) <- ctxt
+ , not (binding `elemUFM` binds) = RhsCon
+ -- strict argument defined in recursive group
+ | otherwise = MaybeClosure
+
+ node_update this_id node_inputs = do
+ fieldResults <- mapM (lookupNodeResult) node_inputs
+ let strictResults = getStrictConArgs con fieldResults
+ let strictOuter = map enterInfo strictResults :: [EnterInfo]
+ -- pprTraceM "RhsCon" (ppr con <+> ppr this_id <+> ppr fieldResults)
+ -- See Note [RhsCon data flow]
+ let outerTag
+ -- a) If it's never turned into a closure it's always tagged.
+ | remainsConRhs == RhsCon =
+ NeverEnter
+
+ -- b) nothing to force
+ | not $ any isMarkedStrict $ dataConRepStrictness con
+ = NeverEnter
+
+ -- c) If all of the strict inputs are tagged so is the output.
+ | all (==NeverEnter) strictOuter
+ = NeverEnter
+
+ -- d) Taggedness depends on the taggedness of the arguments.
+ | any (== UndetEnterInfo) strictOuter
+ = UndetEnterInfo
+
+ -- e)
+ | otherwise
+ = MaybeEnter
+
+
+ -- Strict fields need to marked as neverEnter here, even if their inputs are not.
+ -- This is because once we scrutinise the result of this rhs they will have been tagged.
+ let result = mkOutConLattice con outerTag fieldResults
+ let cappedResult = widenToNestingLevel nestingLimit result
+ updateNodeResult this_id cappedResult
+ return $! cappedResult
+
+
+
+
+{-
+
+TODO: As future work we could try to analyze which arguments a function is called with and use this to
+ enhance the results of the analysis. But for now we don't do so.
+
+TODO: Partial applications
+
+* Currently we don't really try to retain field information of partial applications.
+* But it might be worth doing so. If we then eventually fully apply the thunk we
+ might bind the fields of the result and use the field information at that point.
+ But it's not a big win so I haven't spent the time.
+
+
+ Note [RhsClosure data flow]
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+ +---------+
+ | rhsNode | = <body>
+ +---------+
+
+This is rather simple:
+
+We take enterInfo(body) and set the outermost enterInfo as follows:
+
+1) NeverEnter iff <body> represents an absentError value. See [Taggedness of absentError]
+2) AlwaysEnter iff there are no arguments. (It's a thunk).
+3) NeverEnter otherwise. As functions aren't entered just applied.
+
+We currently do not consider arguments at all, this would require a
+guarantee that there are no call sites outside of this module.
+Something currently not tracked by GHC.
+
+nodeRhs really *only* modifies the outer enterInfo. Some examples:
+
+Rule 1: Absent error:
+
+ x = absentError foo
+ => enterInfo(x) = NeverEnter
+
+ ---
+
+ bar = absentError foo
+ x = bar
+ => enterInfo(x) = absentError foo
+
+Rule 2: AlwaysEnter:
+
+ x = body@(case someThunk of y -> y)
+ => enterInfo(x) = AlwaysEnter < enterInfo_ofFields(body)>
+
+ That is we take whatever the result of analyzing body is, but we replace the
+ outermost enterInfo with AlwaysEnter. This is the case for all thunks
+ which are not absentError no matter how exactly the body looks like.
+
+Rule 3: NeverEnter:
+
+ f :: Int -> Int -> (Int,Int)
+ f x y = body@(case x + y of bndr -> (bndr, bndr))
+ => enterInfo(f) = NeverEnter < NeverEnter, NeverEnter >
+ ^ function ^ bndr ^ bndr
+
+ The outermust enterInfo represents the (evaluated) function. We *omit* the enterInfo
+ for the outermost enterInfo of the *value*. Because the result of a function is always
+ evaluated so there is no need.
+
+ For another example:
+
+ f :: Int -> Int -> Maybe Int
+ f x y = body@(Nothing)
+ => enterInfo(f) = NeverEnter
+ ^ function, no fields so no more information than that.
+
+-}
+
+nodeRhs this_mod ctxt _topFlag binding (StgRhsClosure _ext _ccs _flag args body) = do
+ (body', body_id) <- nodeExpr this_mod ctxt' body
+ let node = FlowNode { node_id = node_id
+ , node_inputs = [body_id]
+ -- ^ We might infer things about nested fields once evaluated.
+ -- , node_done = False
+ , node_result = EnterLattice enterInfo FieldsUndet
+ , node_update = node_update node_id body_id
+#if defined(WITH_NODE_DESC)
+ , _node_desc = node_desc
+#endif
+ }
+ addNode notDone node
+ return $! (StgRhsClosure _ext _ccs _flag args body')
+
+ where
+ node_id = getKnownIdNodeId ctxt binding
+#if defined(WITH_NODE_DESC)
+ node_desc
+ | null args = text "rhsThunk:" <> (ppr binding)
+ | otherwise = text "rhsFunc:" <> (ppr binding)
+#endif
+ -- We know nothing about the arguments.
+ varMap = mkVarEnv (zip args (replicate arity unknownNodeId))
+ ctxt' = (CClosureBody varMap `extendCtxt` ctxt)
+ arity = length args
+ enterInfo
+ | isAbsentExpr body = NeverEnter
+ | null args = AlwaysEnter
+ | otherwise = NeverEnter -- Thunks with arity > 0
+ -- are only entered when applied.
+ node_update this_id body_id = do
+ bodyInfo <- lookupNodeResult body_id
+ let result = setEnterInfo bodyInfo enterInfo
+ let cappedResult = widenToNestingLevel nestingLimit result
+ if hasFinalFields cappedResult
+ then do
+ node <- getNode this_id
+ markDone $ node { node_result = cappedResult }
+ else updateNodeResult this_id cappedResult
+ return $! cappedResult
+
+-- Constraints for possible STG expressions. Most are delegated to helper functions.
+nodeExpr :: Module -> ContextStack -> StgExpr -> AM (InferStgExpr, NodeId)
+nodeExpr this_mod ctxt (e@StgCase {}) = nodeCase this_mod ctxt e
+nodeExpr this_mod ctxt (e@StgLet {}) = nodeLet this_mod ctxt e
+nodeExpr this_mod ctxt (e@StgLetNoEscape {}) = nodeLetNoEscape this_mod ctxt e
+nodeExpr this_mod ctxt (StgTick t e) = do
+ (e',nodeId) <- nodeExpr this_mod ctxt e
+ return $! (StgTick t e', nodeId)
+nodeExpr this_mod ctxt e@(StgConApp {}) = nodeConApp this_mod ctxt e
+nodeExpr this_mod ctxt e@(StgApp {}) = nodeApp this_mod ctxt e
+-- Do the boring ones right here
+nodeExpr _ _ctxt (StgLit lit) = return $! (StgLit lit, litNodeId)
+-- Not currently analysed, mostly deal with unlifted values anyway.
+nodeExpr _ _ctxt (StgOpApp op args res_ty) = return $! (StgOpApp op args res_ty, unknownNodeId)
+nodeExpr _ _ctxt (StgLam {}) = error "Invariant violated: No lambdas in STG representation."
+
+{- Note [Case Data Flow Nodes]
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+Case expressions result in a few control flow nodes and constraints.
+
+Information between the different nodes for a case expression
+is best shown by example:
+
+ case e1 of bndr
+ { C1 f1 f2 -> alt1;
+ C2 -> alt2; }
+
+This result in data flow nodes and data flow between them
+as shown below.
+
+ Always NoEnter
++-----------+ +--------+
+| Scrutinee +---- fieldInfo --->+ bndr |
++-----+-----+ +--------+
+ |
+ +
+ fieldInfo
+ + bind field info
+ | to alt bndrs
+ v |
+ | +-----------+ +--------+
+ | | | | |
+ +--->+ f1 f2 +-------->+ alt1 +--------+
+ | | | | | |
+ | +-----------+ +--------+ v +-----------+
+ | | +----+----+ | |
+ v result of alt rhs | Combine +------>+ Case Node |
+ | | +----+----+ | |
+ | +--------+ ^ +-----------+
+ | | | |
+ +--------->------->------->+ alt2 +--------+
+ | |
+ +--------+
+
+Enumerating the case constraints:
+
+1) Case Binder:
+ enterInfo(bndr) = setOuter(NeverEnter, enterInfo(scrutinee))
+ Binders are like the scrutinee but evaluated, that is outermost enterInfo = NeverEnter.
+
+2) Field binders:
+ enterInfo(field_n)
+ | isStrictField = setOuter(NeverEnter, field_n(enterInfo((scrutinee)))
+ | otherwise = field_n(enterInfo(scrutinee))
+ Bound fields get their info from the scrutinees fieldInfo, except for strict fields whos
+ outermost enterInfo get's set to NeverEnter.
+
+3) Case expression:
+ enterInfo(caseExpr) = lub(enterInfo(alt1), enterInfo(alt2), ... ,enterInfo(altn))
+
+How branches are combined is explained in the Note [The lattice element combinators]
+and Note [Combining Branches].
+
+Note that the enterInfo of case alternatives can depend on case binders/field binders
+if they reference them. But they are determined just as any other expression otherwise.
+
+
+
+Examples:
+
+ data StrictLazy a b = SL !a b
+
+ ... case e of e'
+ StrictLazy strict lazy -> lazy :: Int
+ Nothing -> alt2 :: Int
+
+ Let's assume enterInfo(x) = MaybeEnter if we apply the constraints we get:
+
+1) Case Binder:
+ enterInfo(e') = setOuter(NeverEnter, enterInfo(e))
+ => setOuter(NeverEnter, MayberEnter)
+ => NeverEnter
+
+2) Field binders:
+
+ For the lazy field:
+
+ enterInfo(lazy) = field_n(enterInfo(scrutinee))
+ => field_2(MaybeEnter)
+ => UndetEnterInfo -- See Note [Lattice for tag analysis]
+
+ For the strict field:
+
+ enterInfo(strict) = setOuter(NeverEnter, field_n(enterInfo(scrutinee)))
+ => setOuter(NeverEnter, field_1(MaybeEnter))
+ => setOuter(NeverEnter, MaybeEnter)
+ => NeverEnter -- Because of the strict field invariant.
+
+
+3) Case expression:
+
+ let's assume enterInfo(lazy) = MaybeEnter, enterInfo(alt2) = NeverEnter
+
+ enterInfo(caseExpression) = lub(alt1, alt2)
+ => lub(lazy, alt2)
+ => lub(MaybeEnter, NeverEnter)
+ => lub(MaybeEnter)
+
+-}
+
+-- See Note [Case Data Flow Node]
+nodeCase :: Module -> ContextStack -> StgExpr -> AM (InferStgExpr, NodeId)
+nodeCase this_mod ctxt (StgCase scrut bndr alt_type alts) = do
+ (scrut',scrutNodeId) <- nodeExpr this_mod (CCaseScrut `extendCtxt` ctxt) scrut
+ bndrNodeId <- nodeCaseBndr scrutNodeId bndr
+ let ctxt' = CCaseBndr (unitVarEnv bndr bndrNodeId) `extendCtxt` ctxt
+ (alts', altNodeIds) <- unzip <$> mapM (nodeAlt this_mod ctxt' scrutNodeId) alts
+ !caseNodeId <- mkJoinNode altNodeIds
+ -- pprTraceM "Scrut, alts, rhss" $ ppr (scrut, scrutNodeId, altNodeIds, altsId)
+ return $! (StgCase scrut' bndr alt_type alts' , caseNodeId)
+nodeCase _ _ _ = panic "Impossible: nodeCase"
+
+
+-- Take the result of the scrutinee and mark it as tagged.
+nodeCaseBndr :: NodeId -> Id -> AM NodeId
+nodeCaseBndr scrutNodeId _bndr = do
+ !bndrNodeId <- mkUniqueId
+ addNode notDone $ FlowNode
+ { node_id = bndrNodeId
+ , node_inputs = [scrutNodeId] --, node_done = False
+ , node_result = undetLat, node_update = updater bndrNodeId
+#if defined(WITH_NODE_DESC)
+ , _node_desc = text "caseBndr" <-> parens (ppr scrutNodeId) <-> ppr _bndr
+#endif
+ }
+ return bndrNodeId
+ where
+ updater bndrNodeId = do
+ scrutResult <- lookupNodeResult scrutNodeId
+ let result = setEnterInfo scrutResult NeverEnter
+ if hasFinalFields result
+ then do
+ node <- getNode bndrNodeId
+ markDone $ node { node_result = result }
+ else
+ updateNodeResult bndrNodeId result
+ return $! result
+
+nodeAlt :: HasDebugCallStack => Module -> ContextStack -> NodeId -> StgAlt -> AM (InferStgAlt, NodeId)
+nodeAlt this_mod ctxt scrutNodeId (altCon, bndrs, rhs)
+ | otherwise = do
+ bndrMappings <- mkVarEnv <$> zipWithM mkAltBndrNode [0..] bndrs
+ let ctxt' = (CAlt bndrMappings) `extendCtxt` ctxt
+ (!rhs', !rhs_id) <- nodeExpr this_mod ctxt' rhs
+ return $! ((altCon, bndrs, rhs'), rhs_id)
+
+ where
+ strictBnds :: [Id]
+ strictBnds
+ | DataAlt con <- altCon
+ = getStrictConArgs con bndrs
+ | otherwise = []
+
+ -- Result for ONE of the bindings bound by the alt.
+ -- Eg for an StgAlt of (Just, [foo], expr) we call mkAltBndrNode 0 foo
+ mkAltBndrNode :: Int -> Id -> AM (Id,NodeId)
+ mkAltBndrNode n bndr
+ | isUnliftedType bndrTy
+ , not (isUnboxedTupleType bndrTy)
+ , not (isUnboxedSumType bndrTy)
+ = do
+ !node_id <- mkUniqueId
+ addNode isDone litNode { node_id = node_id }
+ return $! (bndr,node_id)
+ | otherwise = do
+ node_id <- mkUniqueId --Shadows existing binds
+ let updater = do
+ scrut_res <- lookupNodeResult scrutNodeId :: AM EnterLattice
+ let bndr_res = (indexField scrut_res n)
+ let is_strict_field = elem bndr strictBnds
+ let result
+ | is_strict_field
+ -- Tag things coming out of strict binds
+ = setEnterInfo bndr_res NeverEnter
+ | otherwise = bndr_res
+ -- pprTraceM "Updating altBndr:" (ppr (node_id, result) $$
+ -- text "Input:" <+> ppr scrutNodeId $$
+ -- text "scrut_res" <+> ppr scrut_res $$
+ -- text "bndr_res" <+> ppr bndr_res )
+ let finalFields = hasFinalFields result
+ if (is_strict_field && finalFields) || (finalFields && enterInfo result == MaybeEnter)
+ then do
+ node <- getNode node_id
+ markDone $ node { node_result = result }
+ else
+ updateNodeResult node_id result
+ return $! result
+ addNode notDone FlowNode
+ { node_id = node_id
+ , node_result = undetLat
+ -- , node_done = False
+ , node_inputs = [scrutNodeId]
+ , node_update = updater
+#if defined(WITH_NODE_DESC)
+ , _node_desc = text "altBndr" <-> ppr altCon <-> ppr bndr
+#endif
+ }
+ return $! (bndr,node_id)
+ where
+ bndrTy = idType bndr
+
+(<->) :: SDoc -> SDoc -> SDoc
+(<->) a b = a <> char '_' <> b
+
+-- Note [Let bindings and their context]
+
+-- If we analyse a binding of the form:
+
+-- let f x = e in body
+
+-- then we analyze `e` in the context of CLet[Rec]
+-- and `body` in the context of CLet[Rec]Body.
+
+-- In each case the context carries the *same* mapping
+-- of binding ids to node ids, however we use different
+-- constructors in order to be able to differentiate between tail
+-- call branches and regular references to an id.
+-- See Note [Recursive Functions] for the details.
+
+{- Note [Let/ Data Flow]
+ ~~~~~~~~~~~~~~~~~~~~
+
+This is rather simple. For a construct like:
+
+ expr@(let x = rhs in body)
+
+We bind the result of the rhs to the variable (x) which binds it.
+The result of the whole expression is equivalent to the result of
+the `body` expression.
+
+The variable can be referenced from the body or the rhs itself
+for let recs.
+
+That is for a let expression of the form
+
+ letExpr@(let var = rhs in body)
+
+We have only the constraints that:
+
+1) enterInfo(var) = enterInfo(rhs)
+2) enterInfo(letExpr) = enterInfo(body)
+
+Implementation wise the body/rhs can reference the data flow node
+for the bound variable in the SynContext.
+
+-}
+
+
+nodeLet :: Module -> ContextStack -> StgExpr -> AM (InferStgExpr, NodeId)
+nodeLet this_mod ctxt (StgLet ext bind expr) = do
+ (bind',ctxt') <- nodesBind this_mod ctxt NotTopLevel NotLNE bind
+ (expr',node) <- nodeExpr this_mod ctxt' expr
+ return $! (StgLet ext bind' expr', node)
+nodeLet _ _ _ = panic "Impossible"
+
+nodeLetNoEscape :: Module -> ContextStack -> StgExpr -> AM (InferStgExpr, NodeId)
+nodeLetNoEscape this_mod ctxt (StgLetNoEscape ext bind expr) = do
+ (bind',ctxt') <- nodesBind this_mod ctxt NotTopLevel LNE bind
+ (expr',node) <- nodeExpr this_mod ctxt' expr
+ return $! (StgLetNoEscape ext bind' expr', node)
+nodeLetNoEscape _ _ _ = panic "Impossible"
+
+{- Note [ConApp Data Flow]
+ ~~~~~~~~~~~~~~~~~~~~~~~
+
+Information from the constructor (strict fields)
+and arguments is used to determine the result.
+
+The information from both the constructor and the given arguments "flow"
+into the final node to determine the result.
+
++-----+ +------+
+| con | | args |
++--+--+ +--+---+
+ | |
+ v v
+ +-------------+
+ | ConApp node |
+ +-------------+
+
+The enterInfo from this node is never used directly as it only appears
+in expression contexts. (Rhs of case alternative, closures or lets).
+In cases like (StgRhsClosure ... expr), expr == StgConApp
+we determine the enterInfo of the rhs based on the fact that it's a RhsClosure.
+In other contexts it's enterInfo will never be used by another node.
+
+So if we have an ConApp expression of the form: app@(Con arg1 arg2 ... argn) we
+solve the constraint:
+
+ enterInfo(app) == MaybeEnter < fieldInfo(arg1), fieldInfo(arg2), ... , fieldInfo(argn) >
+
+ where fieldInfo(arg_n) is defined as:
+
+ fieldInfo(field_n)
+ | isStrictField(field_n) = setOuter(NeverEnter, enterInfo(arg_n))
+ | otherwise = enterInfo(arg_n)
+
+
+We set strict field to NeverEnter because of the strict field invariant.
+See also Note [The strict field invariant].
+
+Doing this is implemented in mkOutConLattice.
+
+Example:
+
+ Consider this snippet and already derived information:
+
+ data StrictLazy a b = SL !a b
+
+ ...
+ let thunk_x = ... :: Bool
+ let thunk_y = ... :: Bool
+
+ ... app@(SL thunk_x thunk_y)
+
+ enterInfo(thunk_x) = MaybeEnter
+ enterInfo(thunk_y) = MaybeEnter
+
+
+ Here we get enterInfo(app) = MaybeEnter < NeverEnter, MaybeEnter>
+ ^from ConApp ^from strict field ^from enterInfo(thunk_y)
+ invariant.
+-}
+nodeConApp :: HasDebugCallStack => Module -> ContextStack -> StgExpr -> AM (InferStgExpr, NodeId)
+nodeConApp this_mod ctxt (StgConApp _ext con args tys) = do
+ node_id <- mkUniqueId
+ mapM_ (addImportedNode this_mod) [v | StgVarArg v <- args]
+ inputs <- mapM (getConArgNodeId ctxt) args :: AM [NodeId]
+ let updater = do
+ fieldResults <- mapM lookupNodeResult inputs :: AM [EnterLattice]
+ let result = mkOutConLattice con MaybeEnter fieldResults
+ -- pprTraceM "UpdateConApp:" $ ppr (node_id,result) <+> text "inputs:" <> ppr inputs
+ updateNodeResult node_id result
+ return $! result
+
+ addNode notDone FlowNode
+ { node_id = node_id
+ , node_result = undetLat
+ , node_inputs = inputs
+ -- , node_done = False
+ , node_update = updater
+#if defined(WITH_NODE_DESC)
+ , _node_desc = text "conApp"
+#endif
+ }
+
+ return $! (StgConApp node_id con args tys, node_id)
+nodeConApp _ _ _ = panic "Impossible"
+
+{- Note [App Data Flow]
+ ~~~~~~~~~~~~~~~~~~~~
+
+This is one of the more involved data flow constructs.
+The actual flow if information is rather simple:
+
+ `StgApp f arg`
+
+Induces this data flow
+
++---+ +------+
+| f | | args |
++-+-+ +--+---+
+ | |
+ v v
+ +----------+
+ | app node |
+ +----------+
+
+However there are a lot of rules which go into how the "app node"
+actually uses the information give. We check these conditions in order:
+
+1) If f is imported:
+-> We compute it's enterInfo as described by Note [Imported Ids]
+
+2) If f is an absent expression:
+-> We treat it as NeverEnter.
+
+3) If f is a simple recursive tail call:
+-> We mark the result as such: NoValue x RecFields
+ See [Recursive Functions] for details.
+
+4) If f is part of mutual recursive binds.
+or is a unsaturated function call:
+-> We throw up our hands and determine we know nothing.
+
+5) If f is a unsaturated function call:
+-> we also give up and infer no information.
+
+6) If f is a saturated function:
+-> We determine setOuter(MaybeEnter, enterInfo(f))
+
+7) If f is not a function, and has no args:
+-> We reuse the information of f
+
+8)
+In any other case:
+-> We throw up our hands and determine we know nothing.
+
+Examples:
+
+1) Imported ids:
+
+ e@(head xs)
+ => enterInfo(e) = importedInfo(head)
+ => NeverEnter
+
+ Where importedInfo is implemented by `addImportedNode`
+
+2) Absent error:
+
+ e@(absentError foo)
+ => enterInfo(e) = NeverEnter
+
+4) Self-recursive calls:
+
+ letrec {
+ f x = ...
+ g x = ...
+ h x = ... expr@(g foo) ...
+ }
+
+ Here g is part of the recursive group so rule 7 triggers and given the context we derive:
+ enterInfo(g foo) = MaybeEnter
+
+5) Unsaturated functions:
+
+ e@(f x), arity(f) > 1:
+
+ enterInfo(f x) = MaybeEnter
+
+ We don't retain field information of f. Since there is likely
+ little gain for too much complexity. But we could revisit this.
+
+6) Saturated function call:
+
+ Given:
+
+ f x = case x of _ -> (True,False)
+ enterInfo(f) = NeverEnter < NeverEnter, NeverEnter >
+
+ If we have an expression `e@(f x)` we derive:
+
+ enterInfo(e)
+ => setOuter(MaybeEnter, enterInfo(f))
+ => setOuter(MaybeEnter, NeverEnter < NeverEnter, NeverEnter >)
+ => MaybeEnter < NeverEnter, NeverEnter >
+
+7) Variable expressions:
+
+ For any variable expressions (e.g. expr@v) we derive enterInfo(expr) = enterInfo(v).
+
+8) Other cases: We derive no information, that is for any other application we derive
+ enterInfo(expr) = MaybeEnter
+
+-}
+
+nodeApp :: HasDebugCallStack => Module -> ContextStack -> StgExpr -> AM (InferStgExpr, NodeId)
+nodeApp this_mod ctxt expr@(StgApp _ f args) = do
+ mapM_ (addImportedNode this_mod) (f:[v | StgVarArg v <- args])
+ maybeImportedFunc <- importedFuncNode_Maybe this_mod f
+ case () of
+ _
+ | Just node_id <- maybeImportedFunc
+ -> return $! (StgApp node_id f args, node_id)
+ | otherwise -> do
+ node_id <- mkUniqueId
+ let updater = do
+ !result <- mkResult
+
+ -- pprTraceM "Updating " (ppr node_id)
+ -- Try to peek into the function being applied
+ -- node <- getNode node_id
+ -- !input_nodes <- mapM getNode inputs
+ -- pprTraceM "AppFields" (ppr (f, result) <+> ppr node $$
+ -- text "inputs:" <+> ppr inputs $$
+ -- ppr input_nodes
+ -- )
+ if (null inputs || isFinalValue result )
+ -- We have collected the final result
+ then do
+ -- pprTraceM "Limiting nesting for " (ppr node_id)
+ node <- getNode node_id
+ markDone $ node { node_result = result }
+ return $! result
+ else do
+ updateNodeResult node_id result
+ return $! result
+
+ addNode notDone $ FlowNode
+ { node_id = node_id, node_result = undetLat
+ , node_inputs = inputs
+ -- , node_done = False
+ , node_update = updater
+#if defined(WITH_NODE_DESC)
+ , _node_desc = text "app" <-> ppr f <> ppr args
+#endif
+ }
+
+ return $! (StgApp node_id f args, node_id)
+ where
+ inputs
+ | isAbsentExpr expr = []
+ | isFun && (not isSat) = []
+ | recTail = []
+ | isFun && isSat = [f_node_id]
+ | otherwise = [f_node_id]
+
+ -- See Note [App Data Flow]
+ mkResult :: AM EnterLattice
+ mkResult
+ | isAbsent =
+ -- pprTrace "Absent:" (ppr f) $
+ return $! nullaryLattice NeverEnter
+
+ | isFun && (not isSat) = return $! maybeLat
+
+ -- App in a direct self-recursive tail call context, returns nothing
+ | recTail = return $! nullaryLattice NoValue
+
+ | OtherRecursion <- recursionKind
+ = lookupNodeResult f_node_id
+
+ | NoMutRecursion <- recursionKind =
+ -- pprTrace "simpleRec" (ppr f) $
+ lookupNodeResult f_node_id
+
+ | isFun && isSat = (`setEnterInfo` MaybeEnter) <$!> lookupNodeResult f_node_id
+
+
+ {- TODO: If we build a pap, but keep track of the field values we should
+ be able to use these if it's fully applied later in the body. eg:
+
+ case f x of pap ->
+ let res = pap y in (resulting in tagged fields)
+ if cond then Just <taggedThing> else res
+
+ But we currently don't do so.
+ -}
+ | not isFun
+ , null args
+ = lookupNodeResult f_node_id
+
+ | otherwise
+ = return $! maybeLat
+
+ recTail = recursionKind == NoMutRecursion && isRecTail f ctxt
+ isFun = isFunTy (unwrapType $ idType f)
+ arity = idFunRepArity f
+ isSat = arity > 0 && (length args == arity)
+ isAbsent = isAbsentExpr expr
+
+ -- We check if f is imported using importedFuncNode_Maybe so this
+ -- is guarantedd to be not imported when demanded.
+ f_node_id = getKnownIdNodeId ctxt f
+
+ recursionKind = getRecursionKind ctxt
+
+ getRecursionKind [] = NoRecursion
+ getRecursionKind ((CLetRec ids _) : _) | f `elemVarEnv` ids =
+ if sizeUFM ids == 1 then NoMutRecursion else OtherRecursion
+ getRecursionKind (_ : todo) = getRecursionKind todo
+nodeApp _ _ _ = panic "Impossible"
+
+-- Dep-sorting nodes is good for performance.
+depSortNodes :: UniqFM NodeId FlowNode -> [FlowNode]
+depSortNodes in_nodes = reversePayload [] . topologicalSortG $ graphFromEdgedVerticesUniq vertices
+ where
+ vertices = foldUFM mkVertex [] in_nodes :: [Node NodeId FlowNode]
+
+ mkVertex :: FlowNode -> [Node NodeId FlowNode] -> [Node NodeId FlowNode]
+ mkVertex n xs = (DigraphNode n (node_id n) (node_inputs n)) : xs
+
+ reversePayload :: [FlowNode] -> [Node NodeId FlowNode] -> [FlowNode]
+ reversePayload acc [] = acc
+ reversePayload acc (x:xs) =
+ let !x' = node_payload x
+ in reversePayload (x':acc) xs
+
+type NodeArray = IOArray Int FlowNode
+type FlagArray = IOUArray Int Bool
+
+solveConstraints :: HasDebugCallStack => DynFlags -> AM ()
+solveConstraints dflags = do
+ todos <- fs_uqNodeMap <$> get
+ -- pprTraceM "sortSize" (ppr $ sizeUFM todos)
+ -- let dep_sorted_nodes = nonDetEltsUFM todos
+ let !dep_sorted_nodes = {-# SCC "nodeSorting" #-}
+ (depSortNodes todos) :: [FlowNode]
+ iterate dep_sorted_nodes (undefined,undefined) 1
+
+ uqList <- map snd . nonDetUFMToList . fs_uqNodeMap <$> get
+ doneList <- map snd . nonDetUFMToList . fs_doneNodes <$> get
+ let resultNodes = (uqList ++ doneList)
+ seq (unsafePerformIO $ GHC.Utils.Error.dumpIfSet_dyn dflags
+ Opt_D_dump_stg_tag_nodes "STG Infered tags" FormatText
+ (vcat $ map ppr resultNodes)) (return ())
+ -- mapM_ (pprTraceM "node:" . ppr) resultNodes
+ return ()
+ where
+ iterate :: [FlowNode] -> (NodeArray,FlagArray) -> Int -> AM ()
+ iterate xs (arr, doneFlags) n = do
+ pprTraceM "Pass:" $ (ppr (length xs)) <+> text "nodes remaining."
+ !change <- liftIO $ newIORef False
+ !xs' <- runUpdates change False xs
+ progress <- liftIO $ readIORef change
+
+ if (not progress)
+ then return ()
+ --max iterations
+ else if (n > 5)
+ then -- pprTraceM "Warning:" (text "Aborting at" <+> ppr n <+> text "iterations") >>
+ return ()
+ else iterate xs' (arr,doneFlags) (n+1)
+
+runUpdates :: IORef Bool -> Bool -> [FlowNode] -> AM [FlowNode]
+runUpdates !_change _some_change [] = return []
+runUpdates change some_change (node:nodes) = do
+ -- !_ <- get
+ !node_changed <- update node
+ -- Avoid a write if we can
+ when (not some_change && node_changed) $ do
+ liftIO $ writeIORef change True
+
+ node_done <- isMarkedDone (node_id node)
+ if node_done
+ then runUpdates change (some_change || node_changed) nodes
+ else do
+ pure (node:) <*> runUpdates change (some_change || node_changed) nodes
+
+ where
+ -- True <=> something changed.
+ update :: FlowNode -> AM Bool
+ update node = do
+ let old_result = node_result node
+ result <- node_update node
+ done <- and <$> (mapM isMarkedDone (node_inputs node))
+ let node' = node { node_result = result }
+ when (done || result `nestingLevelOver` 12) (markDone node')
+ if (result == old_result)
+ -- Nothing to do this round
+ then return False
+ else do
+ return True
+
+
+
+{-
+------------------------------------------------------------
+ Add cases around strict fields where required.
+------------------------------------------------------------
+-}
+
+rewriteTopBinds :: [InferStgTopBinding] -> AM [TgStgTopBinding]
+rewriteTopBinds binds = mapM (rewriteTop) binds
+
+rewriteTop :: InferStgTopBinding -> AM TgStgTopBinding
+rewriteTop (StgTopStringLit v s) = return $! (StgTopStringLit v s)
+rewriteTop (StgTopLifted bind) = do
+ (StgTopLifted . fst) <$!> (rewriteBinds bind)
+
+-- For bot level binds, the wrapper is guaranteed to be `id`
+rewriteBinds :: InferStgBinding -> AM (TgStgBinding, TgStgExpr -> TgStgExpr)
+rewriteBinds (StgNonRec v rhs) = do
+ (!rhs, wrapper) <- rewriteRhs v rhs
+ return $! (StgNonRec v rhs, wrapper)
+rewriteBinds (StgRec binds) =do
+ (rhss, wrappers) <- unzip <$> mapM (uncurry rewriteRhs) binds
+ let wrapper = foldl1 (.) wrappers
+ return $! (mkRec rhss, wrapper)
+ where
+ mkRec :: [TgStgRhs] -> TgStgBinding
+ mkRec rhss = StgRec (zip (map fst binds) rhss)
+
+-- | When dealing with a let bound rhs passing the id in allows us the shortcut the
+-- the rule for the rhs tag to flow to the id
+rewriteRhs :: Id -> InferStgRhs -> AM (TgStgRhs, TgStgExpr -> TgStgExpr)
+rewriteRhs _binding (StgRhsCon (node_id,rewriteFlag) ccs con args) = do
+ node <- getNode node_id
+ fieldInfos <- mapM lookupNodeResult (node_inputs node)
+ -- tagInfo <- lookupNodeResult node_id
+ -- pprTraceM "rewriteRhsCon" $ ppr _binding <+> ppr tagInfo
+ -- pprTraceM "rewriteConApp" $ ppr con <+> vcat [
+ -- text "args" <+> ppr args,
+ -- text "tagInfo" <+> ppr tagInfo,
+ -- text "fieldInfos" <+> ppr fieldInfos
+ -- -- text "strictIndices" <+> ppr strictIndices,
+ -- -- text "needsEval" <+> ppr needsEval,
+ -- -- text "evalArgs" <+> ppr evalArgs
+ -- ]
+
+ -- TODO: use zip3
+ let strictIndices = getStrictConArgs con (zip [0..] fieldInfos) :: [(Int,EnterLattice)]
+ let needsEval = map fst . filter (not . hasOuterTag . snd) $ strictIndices :: [Int]
+ -- TODO: selectIndices is not a performant solution, fix that.
+ let evalArgs = [v | StgVarArg !v <- selectIndices needsEval args] :: [Id]
+
+ if (null evalArgs)
+ then return $! (StgRhsCon noExtFieldSilent ccs con args, id)
+ else do
+ -- tagInfo <- lookupNodeResult node_id
+ -- pprTraceM "Creating seqs (wrapped) for " $ ppr _binding <+> ppr node_id
+
+ evaldArgs <- mapM mkLocalArgId evalArgs -- Create case binders
+ let varMap = zip evalArgs evaldArgs -- Match them up with original ids
+ let updateArg (StgLitArg lit) = (StgLitArg lit)
+ updateArg (StgVarArg v)
+ | Just v' <- lookup v varMap
+ = StgVarArg v'
+ | otherwise = StgVarArg v
+ let evaldConArgs = map updateArg args
+ -- At this point iff, we have possibly untagged arguments
+ -- and MaybeClosure as flag, we turn the result into a closure.
+ if rewriteFlag == MaybeClosure
+ then do
+ conExpr <- mkSeqs evalArgs con args (panic "mkSeqs should not need to provide types")
+ return $! (StgRhsClosure noExtFieldSilent ccs ReEntrant [] $! conExpr, id)
+ else do
+ let evalExpr expr = foldr (\(v, vEvald) e -> mkSeq v vEvald e) expr varMap
+ return $! ((StgRhsCon noExtFieldSilent ccs con evaldConArgs), evalExpr)
+rewriteRhs _binding (StgRhsClosure ext ccs flag args body) = do
+ pure (,) <*>
+ (StgRhsClosure ext ccs flag args <$> rewriteExpr False body) <*>
+ pure id
+
+type IsScrut = Bool
+
+rewriteExpr :: IsScrut -> InferStgExpr -> AM TgStgExpr
+rewriteExpr _ (e@StgCase {}) = rewriteCase e
+rewriteExpr _ (e@StgLet {}) = rewriteLet e
+rewriteExpr _ (e@StgLetNoEscape {}) = rewriteLetNoEscape e
+rewriteExpr isScrut (StgTick t e) = StgTick t <$!> rewriteExpr isScrut e
+rewriteExpr _ e@(StgConApp {}) = rewriteConApp e
+
+rewriteExpr isScrut e@(StgApp {}) = rewriteApp isScrut e
+rewriteExpr _ (StgLit lit) = return $! (StgLit lit)
+rewriteExpr _ (StgOpApp op args res_ty) = return $! (StgOpApp op args res_ty)
+rewriteExpr _ (StgLam {}) = error "Invariant violated: No lambdas in STG representation."
+
+rewriteCase :: InferStgExpr -> AM TgStgExpr
+rewriteCase (StgCase scrut bndr alt_type alts) =
+ pure StgCase <*>
+ rewriteExpr True scrut <*>
+ pure bndr <*>
+ pure alt_type <*>
+ mapM rewriteAlt alts
+
+rewriteCase _ = panic "Impossible: nodeCase"
+
+rewriteAlt :: InferStgAlt -> AM TgStgAlt
+rewriteAlt (altCon, bndrs, rhs) = do
+ !rhs' <- rewriteExpr False rhs
+ return $! (altCon, bndrs, rhs')
+
+rewriteLet :: InferStgExpr -> AM TgStgExpr
+rewriteLet (StgLet xt bind expr) = do
+ (!bind', !wrapper) <- rewriteBinds bind
+ !expr' <- rewriteExpr False expr
+ return $! wrapper (StgLet xt bind' expr')
+rewriteLet _ = panic "Impossible"
+
+rewriteLetNoEscape :: InferStgExpr -> AM TgStgExpr
+rewriteLetNoEscape (StgLetNoEscape xt bind expr) = do
+ (!bind', wrapper) <- rewriteBinds bind
+ !expr' <- rewriteExpr False expr
+ return $! wrapper (StgLetNoEscape xt bind' expr')
+rewriteLetNoEscape _ = panic "Impossible"
+
+rewriteConApp :: InferStgExpr -> AM TgStgExpr
+rewriteConApp (StgConApp nodeId con args tys) = do
+ node <- getNode nodeId
+ -- We look at the INPUT because the output of this node will always have tagged
+ -- strict fields in the end.
+ fieldInfos <- mapM lookupNodeResult (node_inputs node)
+ let strictIndices = getStrictConArgs con (zip3 [(0 :: Int) ..] fieldInfos args) :: [(Int,EnterLattice, StgArg)]
+ let needsEval = map fstOf3 . filter (not . hasOuterTag . sndOf3) $ strictIndices :: [Int]
+ let evalArgs = [v | StgVarArg v <- selectIndices needsEval args] :: [Id]
+ if (not $ null evalArgs)
+ then do
+ -- pprTraceM "Creating conAppSeqs for " $ ppr nodeId <+> parens ( ppr evalArgs ) -- <+> parens ( ppr fieldInfos )
+ mkSeqs evalArgs con args tys
+ else return $! (StgConApp noExtFieldSilent con args tys)
+
+rewriteConApp _ = panic "Impossible"
+
+rewriteApp :: IsScrut -> InferStgExpr -> AM TgStgExpr
+rewriteApp True (StgApp nodeId f args)
+ | null args = do
+ tagInfo <- lookupNodeResult nodeId
+ let !enter = (extInfo $ enterInfo tagInfo)
+ return $! StgApp enter f args
+ where
+ extInfo AlwaysEnter = -- pprTrace "alwaysEnter" (ppr f)
+ -- StgSyn.AlwaysEnter
+ -- Reenters evaluated closures too often
+ StgSyn.MayEnter
+ extInfo NeverEnter = StgSyn.NoEnter
+ extInfo MaybeEnter = StgSyn.MayEnter
+ extInfo NoValue = StgSyn.MayEnter
+ extInfo UndetEnterInfo = StgSyn.MayEnter
+
+rewriteApp _ (StgApp _ f args) = return $ StgApp MayEnter f args -- TODO? Also apply here?
+rewriteApp _ _ = panic "Impossible"
+
+----------------------------------------------
+-- Deal with exporting tagging information
+
+_exportTaggedness :: [(Id,NodeId)] -> AM [(Id, EnterLattice)]
+_exportTaggedness xs = mapMaybeM export xs
+ where
+ export (v,nid)
+ | isInternalName (idName v)
+ = return Nothing
+ | isUnliftedType (idType v)
+ = return Nothing
+ | otherwise
+ = do
+ !res <- lookupNodeResult nid
+ return $ Just (v,res)
+
+-- We would ideally replace ALL references to the evaluatee with the evaluted binding.
+-- But for now we don't.
+mkSeq :: Id -> Id -> TgStgExpr -> TgStgExpr
+mkSeq id bndr !expr =
+ -- pprTrace "mkSeq" (ppr (id,bndr)) $
+ let altTy = mkStgAltType bndr [(DEFAULT, [], panic "Not used")]
+ in
+ StgCase (StgApp MayEnter id []) bndr altTy [(DEFAULT, [], expr)]
+
+-- Create a ConApp which is guaranteed to evaluate the given ids.
+mkSeqs :: [Id] -> DataCon -> [StgArg] -> [Type] -> AM TgStgExpr
+mkSeqs untaggedIds con args tys = do
+ argMap <- mapM (\arg -> (arg,) <$> mkLocalArgId arg ) untaggedIds :: AM [(InId, OutId)]
+ -- mapM_ (pprTraceM "Forcing strict args before allocation:" . ppr) argMap
+ let taggedArgs
+ = map (\v -> case v of
+ StgVarArg v' -> StgVarArg $ fromMaybe v' $ lookup v' argMap
+ lit -> lit)
+ args
+
+ let conBody = StgConApp noExtFieldSilent con taggedArgs tys
+ let body = foldr (\(v,bndr) expr -> mkSeq v bndr expr) conBody argMap
+ return $! body
+
+mkLocalArgId :: Id -> AM Id
+mkLocalArgId id = do
+ u <- getUniqueM
+ return $! setIdUnique (localiseId id) u
+
+-- These are inserted by the WW transformation and we treat them semantically as tagged.
+-- This avoids us seqing them when we shouldn't.
+-- See [Taggedness of absentError]
+isAbsentExpr :: GenStgExpr p -> Bool
+isAbsentExpr (StgTick _t e) = isAbsentExpr e
+isAbsentExpr (StgApp _ f _)
+ | idUnique f == absentErrorIdKey = True
+ -- I'm not convinced that this via strictness is required for module-internal functions.
+ -- But it's hard to proof otherwise so we just accept this overhead.
+ | (_, Absent) <- splitStrictSig (idStrictness f)
+ = True
+isAbsentExpr _ = False
diff --git a/compiler/GHC/Stg/Lift.hs b/compiler/GHC/Stg/Lift.hs
index 27e63f9313..eab587a32e 100644
--- a/compiler/GHC/Stg/Lift.hs
+++ b/compiler/GHC/Stg/Lift.hs
@@ -1,4 +1,5 @@
{-# LANGUAGE CPP #-}
+{-# LANGUAGE DataKinds #-}
-- | Implements a selective lambda lifter, running late in the optimisation
-- pipeline.
@@ -137,7 +138,7 @@ liftTopLvl (StgTopStringLit bndr lit) rest = withSubstBndr bndr $ \bndr' -> do
liftTopLvl (StgTopLifted bind) rest = do
let is_rec = isRec $ fst $ decomposeStgBinding bind
when is_rec startBindingGroup
- let bind_w_fvs = annBindingFreeVars bind
+ let bind_w_fvs = annBindingFreeVars (bind :: GenStgBinding 'Vanilla) :: GenStgBinding 'CodeGen
withLiftedBind TopLevel (tagSkeletonTopBind bind_w_fvs) NilSk $ \mb_bind' -> do
-- We signal lifting of a binding through returning Nothing.
-- Should never happen for a top-level binding, though, since we are already
@@ -199,10 +200,10 @@ liftRhs
-- as lambda binders, discarding all free vars.
-> LlStgRhs
-> LiftM OutStgRhs
-liftRhs mb_former_fvs rhs@(StgRhsCon ccs con args)
+liftRhs mb_former_fvs rhs@(StgRhsCon ext ccs con args)
= ASSERT2(isNothing mb_former_fvs, text "Should never lift a constructor" $$ pprStgRhs panicStgPprOpts rhs)
- StgRhsCon ccs con <$> traverse liftArgs args
-liftRhs Nothing (StgRhsClosure _ ccs upd infos body) =
+ StgRhsCon ext ccs con <$> traverse liftArgs args
+liftRhs Nothing (StgRhsClosure _ ccs upd infos body) = do
-- This RHS wasn't lifted.
withSubstBndrs (map binderInfoBndr infos) $ \bndrs' ->
StgRhsClosure noExtFieldSilent ccs upd bndrs' <$> liftExpr body
@@ -221,13 +222,13 @@ liftArgs (StgVarArg occ) = do
liftExpr :: LlStgExpr -> LiftM OutStgExpr
liftExpr (StgLit lit) = pure (StgLit lit)
liftExpr (StgTick t e) = StgTick t <$> liftExpr e
-liftExpr (StgApp f args) = do
+liftExpr (StgApp _ext f args) = do
f' <- substOcc f
args' <- traverse liftArgs args
fvs' <- formerFreeVars f
let top_lvl_args = map StgVarArg fvs' ++ args'
- pure (StgApp f' top_lvl_args)
-liftExpr (StgConApp con args tys) = StgConApp con <$> traverse liftArgs args <*> pure tys
+ pure (StgApp MayEnter f' top_lvl_args)
+liftExpr (StgConApp ext con args tys) = StgConApp ext con <$> traverse liftArgs args <*> pure tys
liftExpr (StgOpApp op args ty) = StgOpApp op <$> traverse liftArgs args <*> pure ty
liftExpr (StgLam _ _) = pprPanic "stgLiftLams" (text "StgLam")
liftExpr (StgCase scrut info ty alts) = do
diff --git a/compiler/GHC/Stg/Lift/Analysis.hs b/compiler/GHC/Stg/Lift/Analysis.hs
index 645616fde6..b7b3f0d64d 100644
--- a/compiler/GHC/Stg/Lift/Analysis.hs
+++ b/compiler/GHC/Stg/Lift/Analysis.hs
@@ -113,11 +113,14 @@ llTrace _ _ c = c
type instance BinderP 'LiftLams = BinderInfo
type instance XRhsClosure 'LiftLams = DIdSet
+type instance XRhsCon 'LiftLams = NoExtFieldSilent
type instance XLet 'LiftLams = Skeleton
type instance XLetNoEscape 'LiftLams = Skeleton
+type instance XStgApp 'LiftLams = AppEnters
+type instance XStgConApp 'LiftLams = NoExtFieldSilent
freeVarsOfRhs :: (XRhsClosure pass ~ DIdSet) => GenStgRhs pass -> DIdSet
-freeVarsOfRhs (StgRhsCon _ _ args) = mkDVarSet [ id | StgVarArg id <- args ]
+freeVarsOfRhs (StgRhsCon _ _ _ args) = mkDVarSet [ id | StgVarArg id <- args ]
freeVarsOfRhs (StgRhsClosure fvs _ _ _ _) = fvs
-- | Captures details of the syntax tree relevant to the cost model, such as
@@ -221,12 +224,12 @@ tagSkeletonTopBind bind = bind'
tagSkeletonExpr :: CgStgExpr -> (Skeleton, IdSet, LlStgExpr)
tagSkeletonExpr (StgLit lit)
= (NilSk, emptyVarSet, StgLit lit)
-tagSkeletonExpr (StgConApp con args tys)
- = (NilSk, mkArgOccs args, StgConApp con args tys)
+tagSkeletonExpr (StgConApp ext con args tys)
+ = (NilSk, mkArgOccs args, StgConApp ext con args tys)
tagSkeletonExpr (StgOpApp op args ty)
= (NilSk, mkArgOccs args, StgOpApp op args ty)
-tagSkeletonExpr (StgApp f args)
- = (NilSk, arg_occs, StgApp f args)
+tagSkeletonExpr (StgApp ext f args)
+ = (NilSk, arg_occs, StgApp ext f args)
where
arg_occs
-- This checks for nullary applications, which we treat the same as
@@ -326,8 +329,8 @@ tagSkeletonBinding is_lne body_skel body_arg_occs (StgRec pairs)
bndr' = BindsClosure bndr (bndr `elemVarSet` scope_occs)
tagSkeletonRhs :: Id -> CgStgRhs -> (Skeleton, IdSet, LlStgRhs)
-tagSkeletonRhs _ (StgRhsCon ccs dc args)
- = (NilSk, mkArgOccs args, StgRhsCon ccs dc args)
+tagSkeletonRhs _ (StgRhsCon ext ccs dc args)
+ = (NilSk, mkArgOccs args, StgRhsCon ext ccs dc args)
tagSkeletonRhs bndr (StgRhsClosure fvs ccs upd bndrs body)
= (rhs_skel, body_arg_occs, StgRhsClosure fvs ccs upd bndrs' body')
where
diff --git a/compiler/GHC/Stg/Lift/Monad.hs b/compiler/GHC/Stg/Lift/Monad.hs
index 4b99521066..741b8452a1 100644
--- a/compiler/GHC/Stg/Lift/Monad.hs
+++ b/compiler/GHC/Stg/Lift/Monad.hs
@@ -194,9 +194,9 @@ removeRhsCCCS :: GenStgRhs pass -> GenStgRhs pass
removeRhsCCCS (StgRhsClosure ext ccs upd bndrs body)
| isCurrentCCS ccs
= StgRhsClosure ext dontCareCCS upd bndrs body
-removeRhsCCCS (StgRhsCon ccs con args)
+removeRhsCCCS (StgRhsCon ext ccs con args)
| isCurrentCCS ccs
- = StgRhsCon dontCareCCS con args
+ = StgRhsCon ext dontCareCCS con args
removeRhsCCCS rhs = rhs
-- | The analysis monad consists of the following 'RWST' components:
diff --git a/compiler/GHC/Stg/Lint.hs b/compiler/GHC/Stg/Lint.hs
index 1485a11458..2a18b75357 100644
--- a/compiler/GHC/Stg/Lint.hs
+++ b/compiler/GHC/Stg/Lint.hs
@@ -40,6 +40,7 @@ module GHC.Stg.Lint ( lintStgTopBindings ) where
import GHC.Prelude
import GHC.Stg.Syntax
+import GHC.Stg.Utils
import GHC.Driver.Session
import GHC.Data.Bag ( Bag, emptyBag, isEmptyBag, snocBag, bagToList )
@@ -87,7 +88,7 @@ lintStgTopBindings dflags this_mod unarised whodunnit binds
opts = initStgPprOpts dflags
-- Bring all top-level binds into scope because CoreToStg does not generate
-- bindings in dependency order (so we may see a use before its definition).
- top_level_binds = mkVarSet (bindersOfTopBinds binds)
+ top_level_binds = mkVarSet (bindersOfTopBinds binds) :: IdSet
lint_binds :: [GenStgTopBinding a] -> LintM ()
@@ -148,7 +149,7 @@ checkNoCurrentCCS rhs = do
StgRhsClosure _ ccs _ _ _
| isCurrentCCS ccs
-> addErrL (text "Top-level StgRhsClosure with CurrentCCS" $$ rhs')
- StgRhsCon ccs _ _
+ StgRhsCon _ ccs _ _
| isCurrentCCS ccs
-> addErrL (text "Top-level StgRhsCon with CurrentCCS" $$ rhs')
_ -> return ()
@@ -163,7 +164,7 @@ lintStgRhs (StgRhsClosure _ _ _ binders expr)
addInScopeVars binders $
lintStgExpr expr
-lintStgRhs rhs@(StgRhsCon _ con args) = do
+lintStgRhs rhs@(StgRhsCon _ _ con args) = do
when (isUnboxedTupleDataCon con || isUnboxedSumDataCon con) $ do
opts <- getStgPprOpts
addErrL (text "StgRhsCon is an unboxed tuple or sum application" $$
@@ -175,11 +176,11 @@ lintStgExpr :: (OutputablePass a, BinderP a ~ Id) => GenStgExpr a -> LintM ()
lintStgExpr (StgLit _) = return ()
-lintStgExpr (StgApp fun args) = do
+lintStgExpr (StgApp _ fun args) = do
lintStgVar fun
mapM_ lintStgArg args
-lintStgExpr app@(StgConApp con args _arg_tys) = do
+lintStgExpr app@(StgConApp _ext con args _arg_tys) = do
-- unboxed sums should vanish during unarise
lf <- getLintFlags
when (lf_unarised lf && isUnboxedSumDataCon con) $ do
diff --git a/compiler/GHC/Stg/Stats.hs b/compiler/GHC/Stg/Stats.hs
index 329f319a47..e01fb2da8c 100644
--- a/compiler/GHC/Stg/Stats.hs
+++ b/compiler/GHC/Stg/Stats.hs
@@ -125,7 +125,7 @@ statBinding top (StgRec pairs)
statRhs :: Bool -> (Id, StgRhs) -> StatEnv
-statRhs top (_, StgRhsCon _ _ _)
+statRhs top (_, StgRhsCon _ _ _ _)
= countOne (ConstructorBinds top)
statRhs top (_, StgRhsClosure _ _ u _ body)
@@ -147,9 +147,9 @@ statRhs top (_, StgRhsClosure _ _ u _ body)
statExpr :: StgExpr -> StatEnv
-statExpr (StgApp _ _) = countOne Applications
+statExpr (StgApp _ _ _) = countOne Applications
statExpr (StgLit _) = countOne Literals
-statExpr (StgConApp _ _ _)= countOne ConstructorApps
+statExpr (StgConApp _ _ _ _)= countOne ConstructorApps
statExpr (StgOpApp _ _ _) = countOne PrimitiveApps
statExpr (StgTick _ e) = statExpr e
diff --git a/compiler/GHC/Stg/Syntax.hs b/compiler/GHC/Stg/Syntax.hs
index b38c2f1ab0..d73a437e62 100644
--- a/compiler/GHC/Stg/Syntax.hs
+++ b/compiler/GHC/Stg/Syntax.hs
@@ -25,8 +25,10 @@ module GHC.Stg.Syntax (
GenStgTopBinding(..), GenStgBinding(..), GenStgExpr(..), GenStgRhs(..),
GenStgAlt, AltType(..),
- StgPass(..), BinderP, XRhsClosure, XLet, XLetNoEscape,
- NoExtFieldSilent, noExtFieldSilent,
+ StgPass(..), BinderP, XRhsClosure, XRhsCon, XLet, XLetNoEscape, XStgApp,
+ XStgConApp,
+ NoExtFieldSilent, noExtFieldSilent, AppEnters(..), noEnterInfo,
+
OutputablePass,
UpdateFlag(..), isUpdatable,
@@ -37,6 +39,9 @@ module GHC.Stg.Syntax (
-- a set of synonyms for the code gen parameterisation
CgStgTopBinding, CgStgBinding, CgStgExpr, CgStgRhs, CgStgAlt,
+ -- Same for taggedness
+ TgStgTopBinding, TgStgBinding, TgStgExpr, TgStgRhs, TgStgAlt,
+
-- a set of synonyms for the lambda lifting parameterisation
LlStgTopBinding, LlStgBinding, LlStgExpr, LlStgRhs, LlStgAlt,
@@ -51,9 +56,11 @@ module GHC.Stg.Syntax (
stgRhsArity,
isDllConApp,
stgArgType,
- stripStgTicksTop, stripStgTicksTopE,
stgCaseBndrInScope,
- bindersOf, bindersOfTop, bindersOfTopBinds,
+ -- bindersOf, bindersOfTop, bindersOfTopBinds,
+
+ -- todo: use bindersOf
+ stgBindIds,
-- ppr
StgPprOpts(..), initStgPprOpts, panicStgPprOpts,
@@ -113,6 +120,11 @@ data GenStgBinding pass
= StgNonRec (BinderP pass) (GenStgRhs pass)
| StgRec [(BinderP pass, GenStgRhs pass)]
+stgBindIds :: GenStgBinding pass -> [BinderP pass]
+stgBindIds (StgNonRec b _) = [b]
+stgBindIds (StgRec bs ) = map fst bs
+
+
{-
************************************************************************
* *
@@ -173,19 +185,6 @@ stgArgType :: StgArg -> Type
stgArgType (StgVarArg v) = idType v
stgArgType (StgLitArg lit) = literalType lit
-
--- | Strip ticks of a given type from an STG expression.
-stripStgTicksTop :: (Tickish Id -> Bool) -> GenStgExpr p -> ([Tickish Id], GenStgExpr p)
-stripStgTicksTop p = go []
- where go ts (StgTick t e) | p t = go (t:ts) e
- go ts other = (reverse ts, other)
-
--- | Strip ticks of a given type from an STG expression returning only the expression.
-stripStgTicksTopE :: (Tickish Id -> Bool) -> GenStgExpr p -> GenStgExpr p
-stripStgTicksTopE p = go
- where go (StgTick t e) | p t = go e
- go other = other
-
-- | Given an alt type and whether the program is unarised, return whether the
-- case binder is in scope.
--
@@ -225,6 +224,7 @@ There is no constructor for a lone variable; it would appear as @StgApp var []@.
data GenStgExpr pass
= StgApp
+ (XStgApp pass)
Id -- function
[StgArg] -- arguments; may be empty
@@ -242,8 +242,9 @@ literals.
| StgLit Literal
-- StgConApp is vital for returning unboxed tuples or sums
- -- which can't be let-bound
- | StgConApp DataCon
+ -- which can't be let-bound first
+ | StgConApp (XStgConApp pass)
+ DataCon
[StgArg] -- Saturated
[Type] -- See Note [Types in StgConApp] in GHC.Stg.Unarise
@@ -427,6 +428,7 @@ important):
-}
| StgRhsCon
+ (XRhsCon pass)
CostCentreStack -- CCS to be attached (default is CurrentCCS).
-- Top-level (static) ones will end up with
-- DontCareCCS, because we don't count static
@@ -436,12 +438,6 @@ important):
-- are not allocated.
[StgArg] -- Args
--- | Used as a data type index for the stgSyn AST
-data StgPass
- = Vanilla
- | LiftLams
- | CodeGen
-
-- | Like 'GHC.Hs.Extension.NoExtField', but with an 'Outputable' instance that
-- returns 'empty'.
data NoExtFieldSilent = NoExtFieldSilent
@@ -457,30 +453,11 @@ noExtFieldSilent = NoExtFieldSilent
-- TODO: Maybe move this to GHC.Hs.Extension? I'm not sure about the
-- implications on build time...
--- TODO: Do we really want to the extension point type families to have a closed
--- domain?
-type family BinderP (pass :: StgPass)
-type instance BinderP 'Vanilla = Id
-type instance BinderP 'CodeGen = Id
-
-type family XRhsClosure (pass :: StgPass)
-type instance XRhsClosure 'Vanilla = NoExtFieldSilent
--- | Code gen needs to track non-global free vars
-type instance XRhsClosure 'CodeGen = DIdSet
-
-type family XLet (pass :: StgPass)
-type instance XLet 'Vanilla = NoExtFieldSilent
-type instance XLet 'CodeGen = NoExtFieldSilent
-
-type family XLetNoEscape (pass :: StgPass)
-type instance XLetNoEscape 'Vanilla = NoExtFieldSilent
-type instance XLetNoEscape 'CodeGen = NoExtFieldSilent
-
stgRhsArity :: StgRhs -> Int
stgRhsArity (StgRhsClosure _ _ _ bndrs _)
= ASSERT( all isId bndrs ) length bndrs
-- The arity never includes type parameters, but they should have gone by now
-stgRhsArity (StgRhsCon _ _ _) = 0
+stgRhsArity (StgRhsCon _ _ _ _) = 0
{-
************************************************************************
@@ -520,7 +497,31 @@ The Plain STG parameterisation
* *
************************************************************************
-This happens to be the only one we use at the moment.
+ Note [STG Extension points]
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+ We now make use of extension points in STG for different passes which want
+ to associate information with AST nodes.
+
+ Currently the pipeline is roughly:
+
+ CoreToStg: Core -> Stg
+ SimplCore: Stg -> Stg
+
+ As part of StgSimpl we run late lambda lifting (Ll).
+ Late lambda lift:
+ Stg -> FvStg -> LlStg -> Stg
+
+ CodeGen:
+ Stg -> TgStg (Predict taggs of bindings, stored in XStgApp)
+ TgStg -> CgStg (Add free variables, stored in XRhsClosure)
+
+ Finally CgStg is used to generate Cmm, using both XStgCase and XRhsClosure.
+
+ Extension point information only has to be retained from Tg onwards. So
+ for simple optimization passes run as part of SimplStg there is no need to
+ preserve extension point information.
+
-}
type StgTopBinding = GenStgTopBinding 'Vanilla
@@ -541,6 +542,12 @@ type CgStgExpr = GenStgExpr 'CodeGen
type CgStgRhs = GenStgRhs 'CodeGen
type CgStgAlt = GenStgAlt 'CodeGen
+type TgStgTopBinding = GenStgTopBinding 'Tagged
+type TgStgBinding = GenStgBinding 'Tagged
+type TgStgExpr = GenStgExpr 'Tagged
+type TgStgRhs = GenStgRhs 'Tagged
+type TgStgAlt = GenStgAlt 'Tagged
+
{- Many passes apply a substitution, and it's very handy to have type
synonyms to remind us whether or not the substitution has been applied.
See GHC.Core for precedence in Core land
@@ -559,6 +566,72 @@ type OutStgExpr = StgExpr
type OutStgRhs = StgRhs
type OutStgAlt = StgAlt
+
+-- | Used as a data type index for the stgSyn AST
+data StgPass
+ = Vanilla
+ | LiftLams
+ | CodeGen
+ | InferTags
+ | Tagged
+
+-- | Determines if this StgApp expression enters the "function"
+data AppEnters = NoEnter -- ^ For tagged and evaluated lifted values
+ | AlwaysEnter -- ^ Always enter without looking at tag - currently not used.
+ | MayEnter -- ^ Otherwise
+ deriving (Eq)
+
+noEnterInfo :: AppEnters
+noEnterInfo = MayEnter
+
+instance Outputable AppEnters where
+ ppr NoEnter = text "[tagged]"
+ ppr MayEnter = empty
+ ppr AlwaysEnter = text "[thunk]"
+
+-- TODO: Do we really want to the extension point type families to have a closed
+-- domain?
+type family BinderP (pass :: StgPass)
+type instance BinderP 'Vanilla = Id
+type instance BinderP 'CodeGen = Id
+type instance BinderP 'Tagged = Id
+
+
+type family XRhsClosure (pass :: StgPass)
+type instance XRhsClosure 'Vanilla = NoExtFieldSilent
+type instance XRhsClosure 'Tagged = NoExtFieldSilent
+-- | Code gen needs to track non-global free vars
+type instance XRhsClosure 'CodeGen = DIdSet
+
+type family XRhsCon (pass :: StgPass)
+type instance XRhsCon 'Vanilla = NoExtFieldSilent
+type instance XRhsCon 'Tagged = NoExtFieldSilent
+type instance XRhsCon 'CodeGen = NoExtFieldSilent
+
+type family XLet (pass :: StgPass)
+type instance XLet 'Vanilla = NoExtFieldSilent
+type instance XLet 'Tagged = NoExtFieldSilent
+type instance XLet 'CodeGen = NoExtFieldSilent
+
+type family XLetNoEscape (pass :: StgPass)
+type instance XLetNoEscape 'Vanilla = NoExtFieldSilent
+type instance XLetNoEscape 'Tagged = NoExtFieldSilent
+type instance XLetNoEscape 'CodeGen = NoExtFieldSilent
+
+-- Binders used in StgApp, we mark some of these
+-- as strict to make sure we don't make redundant evaluatins.
+type family XStgApp (pass :: StgPass)
+type instance XStgApp 'Vanilla = AppEnters
+type instance XStgApp 'Tagged = AppEnters
+type instance XStgApp 'CodeGen = AppEnters
+
+type family XStgConApp (pass :: StgPass)
+type instance XStgConApp 'Vanilla = NoExtFieldSilent
+type instance XStgConApp 'Tagged = NoExtFieldSilent
+type instance XStgConApp 'CodeGen = NoExtFieldSilent
+
+
+
{-
************************************************************************
@@ -618,16 +691,16 @@ Utilities
************************************************************************
-}
-bindersOf :: BinderP a ~ Id => GenStgBinding a -> [Id]
-bindersOf (StgNonRec binder _) = [binder]
-bindersOf (StgRec pairs) = [binder | (binder, _) <- pairs]
+-- bindersOf :: BinderP a ~ Id => GenStgBinding a -> [Id]
+-- bindersOf (StgNonRec binder _) = [binder]
+-- bindersOf (StgRec pairs) = [binder | (binder, _) <- pairs]
-bindersOfTop :: BinderP a ~ Id => GenStgTopBinding a -> [Id]
-bindersOfTop (StgTopLifted bind) = bindersOf bind
-bindersOfTop (StgTopStringLit binder _) = [binder]
+-- bindersOfTop :: BinderP a ~ Id => GenStgTopBinding a -> [Id]
+-- bindersOfTop (StgTopLifted bind) = bindersOf bind
+-- bindersOfTop (StgTopStringLit binder _) = [binder]
-bindersOfTopBinds :: BinderP a ~ Id => [GenStgTopBinding a] -> [Id]
-bindersOfTopBinds = foldr ((++) . bindersOfTop) []
+-- bindersOfTopBinds :: BinderP a ~ Id => [GenStgTopBinding a] -> [Id]
+-- bindersOfTopBinds = foldr ((++) . bindersOfTop) []
{-
************************************************************************
@@ -644,7 +717,10 @@ type OutputablePass pass =
( Outputable (XLet pass)
, Outputable (XLetNoEscape pass)
, Outputable (XRhsClosure pass)
+ , Outputable (XRhsCon pass)
, OutputableBndr (BinderP pass)
+ , Outputable (XStgApp pass)
+ , Outputable (XStgConApp pass)
)
-- | STG pretty-printing options
@@ -706,8 +782,8 @@ pprStgExpr opts e = case e of
-- special case
StgLit lit -> ppr lit
-- general case
- StgApp func args -> hang (ppr func) 4 (interppSP args)
- StgConApp con args _ -> hsep [ ppr con, brackets (interppSP args) ]
+ StgApp ext func args -> hang (ppr func <> ppr ext) 4 (interppSP args)
+ StgConApp ext con args _ -> hsep [ ppr con, ppr ext, brackets (interppSP args) ]
StgOpApp op args _ -> hsep [ pprStgOp op, brackets (interppSP args)]
StgLam bndrs body -> let ppr_list = brackets . fsep . punctuate comma
in sep [ char '\\' <+> ppr_list (map (pprBndr LambdaBind) (toList bndrs))
@@ -815,5 +891,5 @@ pprStgRhs opts rhs = case rhs of
])
4 (pprStgExpr opts body)
- StgRhsCon cc con args
- -> hcat [ ppr cc, space, ppr con, text "! ", brackets (sep (map pprStgArg args))]
+ StgRhsCon ext cc con args
+ -> hcat [ ppr cc, space, ppr ext, space, ppr con, text "! ", brackets (sep (map pprStgArg args))]
diff --git a/compiler/GHC/Stg/Unarise.hs b/compiler/GHC/Stg/Unarise.hs
index eb4c968f5b..3c4f23fb95 100644
--- a/compiler/GHC/Stg/Unarise.hs
+++ b/compiler/GHC/Stg/Unarise.hs
@@ -293,27 +293,27 @@ unariseRhs rho (StgRhsClosure ext ccs update_flag args expr)
expr' <- unariseExpr rho' expr
return (StgRhsClosure ext ccs update_flag args1 expr')
-unariseRhs rho (StgRhsCon ccs con args)
+unariseRhs rho (StgRhsCon ext ccs con args)
= ASSERT(not (isUnboxedTupleDataCon con || isUnboxedSumDataCon con))
- return (StgRhsCon ccs con (unariseConArgs rho args))
+ return (StgRhsCon ext ccs con (unariseConArgs rho args))
--------------------------------------------------------------------------------
unariseExpr :: UnariseEnv -> StgExpr -> UniqSM StgExpr
-unariseExpr rho e@(StgApp f [])
+unariseExpr rho e@(StgApp ext f [])
= case lookupVarEnv rho f of
Just (MultiVal args) -- Including empty tuples
-> return (mkTuple args)
Just (UnaryVal (StgVarArg f'))
- -> return (StgApp f' [])
+ -> return (StgApp ext f' [])
Just (UnaryVal (StgLitArg f'))
-> return (StgLit f')
Nothing
-> return e
-unariseExpr rho e@(StgApp f args)
- = return (StgApp f' (unariseFunArgs rho args))
+unariseExpr rho e@(StgApp ext f args)
+ = return (StgApp ext f' (unariseFunArgs rho args))
where
f' = case lookupVarEnv rho f of
Just (UnaryVal (StgVarArg f')) -> f'
@@ -325,13 +325,13 @@ unariseExpr rho e@(StgApp f args)
unariseExpr _ (StgLit l)
= return (StgLit l)
-unariseExpr rho (StgConApp dc args ty_args)
+unariseExpr rho (StgConApp ext dc args ty_args)
| Just args' <- unariseMulti_maybe rho dc args ty_args
= return (mkTuple args')
| otherwise
, let args' = unariseConArgs rho args
- = return (StgConApp dc args' (map stgArgType args'))
+ = return (StgConApp ext dc args' (map stgArgType args'))
unariseExpr rho (StgOpApp op args ty)
= return (StgOpApp op (unariseFunArgs rho args) ty)
@@ -341,14 +341,14 @@ unariseExpr _ e@StgLam{}
unariseExpr rho (StgCase scrut bndr alt_ty alts)
-- tuple/sum binders in the scrutinee can always be eliminated
- | StgApp v [] <- scrut
+ | StgApp _ext v [] <- scrut
, Just (MultiVal xs) <- lookupVarEnv rho v
= elimCase rho xs bndr alt_ty alts
-- Handle strict lets for tuples and sums:
-- case (# a,b #) of r -> rhs
-- and analogously for sums
- | StgConApp dc args ty_args <- scrut
+ | StgConApp _ext dc args ty_args <- scrut
, Just args' <- unariseMulti_maybe rho dc args ty_args
= elimCase rho args' bndr alt_ty alts
@@ -407,7 +407,7 @@ elimCase rho args bndr (MultiValAlt _) alts
-- this won't be used but we need a binder anyway
let rho1 = extendRho rho bndr (MultiVal args)
scrut' = case tag_arg of
- StgVarArg v -> StgApp v []
+ StgVarArg v -> StgApp MayEnter v []
StgLitArg l -> StgLit l
alts' <- unariseSumAlts rho1 real_args alts
@@ -449,7 +449,7 @@ unariseAlts rho (MultiValAlt _) bndr alts
| isUnboxedSumBndr bndr
= do (rho_sum_bndrs, scrt_bndrs@(tag_bndr : real_bndrs)) <- unariseConArgBinder rho bndr
alts' <- unariseSumAlts rho_sum_bndrs (map StgVarArg real_bndrs) alts
- let inner_case = StgCase (StgApp tag_bndr []) tag_bndr tagAltTy alts'
+ let inner_case = StgCase (StgApp MayEnter tag_bndr []) tag_bndr tagAltTy alts'
return [ (DataAlt (tupleDataCon Unboxed (length scrt_bndrs)),
scrt_bndrs,
inner_case) ]
@@ -759,7 +759,7 @@ isUnboxedTupleBndr :: Id -> Bool
isUnboxedTupleBndr = isUnboxedTupleType . idType
mkTuple :: [StgArg] -> StgExpr
-mkTuple args = StgConApp (tupleDataCon Unboxed (length args)) args (map stgArgType args)
+mkTuple args = StgConApp noExtFieldSilent (tupleDataCon Unboxed (length args)) args (map stgArgType args)
tagAltTy :: AltType
tagAltTy = PrimAlt IntRep
diff --git a/compiler/GHC/Stg/Utils.hs b/compiler/GHC/Stg/Utils.hs
new file mode 100644
index 0000000000..94d1a01726
--- /dev/null
+++ b/compiler/GHC/Stg/Utils.hs
@@ -0,0 +1,148 @@
+{-# LANGUAGE CPP, ScopedTypeVariables, TypeFamilies #-}
+{-# LANGUAGE BangPatterns #-}
+
+module GHC.Stg.Utils
+ ( mkStgAltType
+ , bindersOf, bindersOfTop, bindersOfTopBinds
+
+ , stripStgTicksTop, stripStgTicksTopE
+ , idArgs
+
+ , seqTopBinds
+ ) where
+
+#include "HsVersions.h"
+
+import GHC.Prelude
+
+import GHC.Types.Id
+import GHC.Core.Type
+import GHC.Core.TyCon
+import GHC.Core.DataCon
+import GHC.Core (AltCon(..), Tickish(..))
+import GHC.Core.Utils
+
+import GHC.Types.RepType
+import GHC.Stg.Syntax
+
+import GHC.Utils.Misc
+import GHC.Utils.Outputable
+
+import GHC.Utils.Panic.Plain
+import GHC.Utils.Panic
+
+-- Checks if id is a top level error application.
+-- isErrorAp_maybe :: Id ->
+
+mkStgAltType :: Id -> [(AltCon, [a], b)] -> AltType
+mkStgAltType bndr alts
+ | isUnboxedTupleType bndr_ty || isUnboxedSumType bndr_ty
+ = MultiValAlt (length prim_reps) -- always use MultiValAlt for unboxed tuples
+
+ | otherwise
+ = case prim_reps of
+ [LiftedRep] -> case tyConAppTyCon_maybe (unwrapType bndr_ty) of
+ Just tc
+ | isAbstractTyCon tc -> look_for_better_tycon
+ | isAlgTyCon tc -> AlgAlt tc
+ | otherwise -> ASSERT2( _is_poly_alt_tycon tc, ppr tc )
+ PolyAlt
+ Nothing -> PolyAlt
+ [unlifted] -> PrimAlt unlifted
+ not_unary -> MultiValAlt (length not_unary)
+ where
+ bndr_ty = idType bndr
+ prim_reps = typePrimRep bndr_ty
+
+ _is_poly_alt_tycon tc
+ = isFunTyCon tc
+ || isPrimTyCon tc -- "Any" is lifted but primitive
+ || isFamilyTyCon tc -- Type family; e.g. Any, or arising from strict
+ -- function application where argument has a
+ -- type-family type
+
+ -- Sometimes, the TyCon is a AbstractTyCon which may not have any
+ -- constructors inside it. Then we may get a better TyCon by
+ -- grabbing the one from a constructor alternative
+ -- if one exists.
+ look_for_better_tycon
+ | ((DataAlt con, _, _) : _) <- data_alts =
+ AlgAlt (dataConTyCon con)
+ | otherwise =
+ ASSERT(null data_alts)
+ PolyAlt
+ where
+ (data_alts, _deflt) = findDefault alts
+
+
+bindersOf :: BinderP a ~ Id => GenStgBinding a -> [Id]
+bindersOf (StgNonRec binder _) = [binder]
+bindersOf (StgRec pairs) = [binder | (binder, _) <- pairs]
+
+bindersOfTop :: BinderP a ~ Id => GenStgTopBinding a -> [Id]
+bindersOfTop (StgTopLifted bind) = bindersOf bind
+bindersOfTop (StgTopStringLit binder _) = [binder]
+
+-- All ids we bind something to on the top level.
+bindersOfTopBinds :: BinderP a ~ Id => [GenStgTopBinding a] -> [Id]
+-- bindersOfTopBinds binds = mapUnionVarSet (mkVarSet . bindersOfTop) binds
+bindersOfTopBinds binds = foldr ((++) . bindersOfTop) [] binds
+
+idArgs :: [StgArg] -> [Id]
+idArgs args = [v | StgVarArg v <- args]
+
+
+-- | Strip ticks of a given type from an STG expression.
+stripStgTicksTop :: (Tickish Id -> Bool) -> GenStgExpr p -> ([Tickish Id], GenStgExpr p)
+stripStgTicksTop p = go []
+ where go ts (StgTick t e) | p t = go (t:ts) e
+ go ts other = (reverse ts, other)
+
+-- | Strip ticks of a given type from an STG expression returning only the expression.
+stripStgTicksTopE :: (Tickish Id -> Bool) -> GenStgExpr p -> GenStgExpr p
+stripStgTicksTopE p = go
+ where go (StgTick t e) | p t = go e
+ go other = other
+
+
+------------------------------------
+
+-- We do not force types here, mostly because they might not be used at all.
+
+seqTopBinds :: [GenStgTopBinding p] -> ()
+seqTopBinds binds = seqList (map seqTop binds) ()
+
+seqTop :: GenStgTopBinding p -> ()
+seqTop (StgTopStringLit !_v !_s) = ()
+seqTop (StgTopLifted bind) = seqBinds bind
+
+seqBinds :: GenStgBinding p -> ()
+seqBinds (StgNonRec !_v rhs) = (seqRhs rhs)
+seqBinds (StgRec pairs) = seqList (map (\v rhs -> v `seq` seqRhs rhs) pairs) ()
+
+-- For top level lets we have to turn lets into closures.
+seqRhs :: GenStgRhs p -> ()
+seqRhs (StgRhsCon !_x !_ccs !_con args) = seqArgs args
+seqRhs (StgRhsClosure !_ext !_ccs !_flag args body) = seqExpr body `seq` seqList args ()
+
+seqExpr :: GenStgExpr p -> ()
+seqExpr (StgCase scrut !_bndr !_ty alts) = seqList (map seqAlt alts) (seqExpr scrut)
+seqExpr (StgLet !_x binds body) = (seqBinds binds) `seq` (seqExpr body)
+seqExpr (StgLetNoEscape !_x binds body) = (seqBinds binds) `seq` (seqExpr body)
+seqExpr (StgTick !_t e) = seqExpr e
+seqExpr (StgConApp !_x !_con args _tys) = seqArgs args
+
+seqExpr (StgApp !_x !_f args) = seqArgs args
+seqExpr (StgLit !_lit) = ()
+seqExpr (StgOpApp !_op args !_res_ty) = seqArgs args
+seqExpr (StgLam {}) = error "Invariant violated: No lambdas in STG representation."
+
+seqAlt :: GenStgAlt p -> ()
+seqAlt (!_altCon, !_bndrs, rhs) = seqExpr rhs
+
+seqArgs :: [StgArg] -> ()
+seqArgs args = seqList (map seqArg args) ()
+
+seqArg :: StgArg -> ()
+seqArg (StgVarArg !_v) = ()
+seqArg (StgLitArg !_l) = ()
diff --git a/compiler/GHC/StgToCmm.hs b/compiler/GHC/StgToCmm.hs
index 2bbf6deac7..85090677e8 100644
--- a/compiler/GHC/StgToCmm.hs
+++ b/compiler/GHC/StgToCmm.hs
@@ -189,7 +189,7 @@ cgTopBinding dflags (StgTopStringLit id str) = do
cgTopRhs :: DynFlags -> RecFlag -> Id -> CgStgRhs -> (CgIdInfo, FCode ())
-- The Id is passed along for setting up a binding...
-cgTopRhs dflags _rec bndr (StgRhsCon _cc con args)
+cgTopRhs dflags _rec bndr (StgRhsCon _ext _cc con args)
= cgTopRhsCon dflags bndr con (assertNonVoidStgArgs args)
-- con args are always non-void,
-- see Note [Post-unarisation invariants] in GHC.Stg.Unarise
diff --git a/compiler/GHC/StgToCmm/Bind.hs b/compiler/GHC/StgToCmm/Bind.hs
index ca39b7b362..ac552ec80b 100644
--- a/compiler/GHC/StgToCmm/Bind.hs
+++ b/compiler/GHC/StgToCmm/Bind.hs
@@ -40,6 +40,7 @@ import GHC.Cmm.Info
import GHC.Cmm.Utils
import GHC.Cmm.CLabel
import GHC.Stg.Syntax
+import GHC.Stg.Utils
import GHC.Types.CostCentre
import GHC.Types.Id
import GHC.Types.Id.Info
@@ -93,7 +94,7 @@ cgTopRhsClosure platform rec id ccs upd_flag args body =
-- concurrent/should_run/4030 fails, for instance.
--
gen_code _ closure_label
- | StgApp f [] <- body, null args, isNonRec rec
+ | StgApp _ext f [] <- body, null args, isNonRec rec
= do
cg_info <- getCgIdInfo f
emitDataCon closure_label indStaticInfoTable ccs [unLit (idInfoToAmode cg_info)]
@@ -205,7 +206,7 @@ cgRhs :: Id
-- (see above)
)
-cgRhs id (StgRhsCon cc con args)
+cgRhs id (StgRhsCon _ext cc con args)
= withNewTickyCounterCon (idName id) con $
buildDynCon id True cc con (assertNonVoidStgArgs args)
-- con args are always non-void,
@@ -269,11 +270,11 @@ mkRhsClosure profile bndr _cc
[] -- A thunk
expr
| let strip = stripStgTicksTopE (not . tickishIsCode)
- , StgCase (StgApp scrutinee [{-no args-}])
+ , StgCase (StgApp _ext scrutinee [{-no args-}])
_ -- ignore bndr
(AlgAlt _)
[(DataAlt _, params, sel_expr)] <- strip expr
- , StgApp selectee [{-no args-}] <- strip sel_expr
+ , StgApp _ext selectee [{-no args-}] <- strip sel_expr
, the_fv == scrutinee -- Scrutinee is the only free variable
, let (_, _, params_w_offsets) = mkVirtConstrOffsets profile (addIdReps (assertNonVoidIds params))
@@ -300,7 +301,7 @@ mkRhsClosure profile bndr _cc
fvs
upd_flag
[] -- No args; a thunk
- (StgApp fun_id args)
+ (StgApp _ext fun_id args)
-- We are looking for an "ApThunk"; see data con ApThunk in GHC.StgToCmm.Closure
-- of form (x1 x2 .... xn), where all the xi are locals (not top-level)
diff --git a/compiler/GHC/StgToCmm/Closure.hs b/compiler/GHC/StgToCmm/Closure.hs
index cacb783a16..a74d7753e7 100644
--- a/compiler/GHC/StgToCmm/Closure.hs
+++ b/compiler/GHC/StgToCmm/Closure.hs
@@ -4,6 +4,7 @@
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE FlexibleInstances #-}
+{-# LANGUAGE CPP, RecordWildCards, ScopedTypeVariables #-}
-----------------------------------------------------------------------------
--
@@ -475,14 +476,18 @@ When black-holing, single-entry closures could also be entered via node
(rather than directly) to catch double-entry. -}
data CallMethod
- = EnterIt -- No args, not a function
+ = EnterIt -- ^ No args, not a function
| JumpToIt BlockId [LocalReg] -- A join point or a header of a local loop
| ReturnIt -- It's a value (function, unboxed value,
-- or constructor), so just return it.
- | SlowCall -- Unknown fun, or known fun with
+ | InferedReturnIt -- Same as ReturnIt but based on tag inference.
+ -- See Note [Tag Inferrence - The basic idea] in
+ -- GHC.Stg.InferTags
+
+ | SlowCall -- Unknown fun, or known fun with
-- too few args.
| DirectEntry -- Jump directly, with args in regs
@@ -495,6 +500,15 @@ data CallOpts = CallOpts
, co_ticky :: !Bool -- ^ Ticky profiling enabled (cf @-ticky@)
}
+instance Outputable CallMethod where
+ ppr (EnterIt) = text "Enter"
+ ppr (JumpToIt {}) = text "JumpToIt"
+ ppr (ReturnIt ) = text "ReturnIt"
+ ppr (InferedReturnIt) = text "InferedReturnIt"
+ ppr (SlowCall ) = text "SlowCall"
+ ppr (DirectEntry {}) = text "DirectEntry"
+
+
getCallMethod :: CallOpts
-> Name -- Function being applied
-> Id -- Function Id used to chech if it can refer to
@@ -509,10 +523,11 @@ getCallMethod :: CallOpts
-- JumpToIt. This saves us one case branch in
-- cgIdApp
-> Maybe SelfLoopInfo -- can we perform a self-recursive tail call?
+ -> AppEnters -- Can we expect the id to be tagged or do we need to enter it?
-> CallMethod
getCallMethod opts _ id _ n_args v_args _cg_loc
- (Just (self_loop_id, block_id, args))
+ (Just (self_loop_id, block_id, args)) _appEnterInfo
| co_loopification opts
, id == self_loop_id
, args `lengthIs` (n_args - v_args)
@@ -525,7 +540,7 @@ getCallMethod opts _ id _ n_args v_args _cg_loc
= JumpToIt block_id args
getCallMethod opts name id (LFReEntrant _ arity _ _) n_args _v_args _cg_loc
- _self_loop_info
+ _self_loop_info _appEnterInfo
| n_args == 0 -- No args at all
&& not (profileIsProfiling (co_profile opts))
-- See Note [Evaluating functions with profiling] in rts/Apply.cmm
@@ -533,21 +548,26 @@ getCallMethod opts name id (LFReEntrant _ arity _ _) n_args _v_args _cg_loc
| n_args < arity = SlowCall -- Not enough args
| otherwise = DirectEntry (enterIdLabel (profilePlatform (co_profile opts)) name (idCafInfo id)) arity
-getCallMethod _ _name _ LFUnlifted n_args _v_args _cg_loc _self_loop_info
+getCallMethod _ _name _ LFUnlifted n_args _v_args _cg_loc _self_loop_info _appEnterInfo
= ASSERT( n_args == 0 ) ReturnIt
-getCallMethod _ _name _ (LFCon _) n_args _v_args _cg_loc _self_loop_info
+getCallMethod _ _name _ (LFCon _) n_args _v_args _cg_loc _self_loop_info _appEnterInfo
= ASSERT( n_args == 0 ) ReturnIt
-- n_args=0 because it'd be ill-typed to apply a saturated
-- constructor application to anything
getCallMethod opts name id (LFThunk _ _ updatable std_form_info is_fun)
- n_args _v_args _cg_loc _self_loop_info
+ n_args _v_args _cg_loc _self_loop_info appEnterInfo
+
+ | appEnterInfo == NoEnter -- Infered to be already evaluated by Tag Inference
+ , n_args == 0 -- See Note [Tag Inferrence - The basic idea]
+ = InferedReturnIt
+
| is_fun -- it *might* be a function, so we must "call" it (which is always safe)
= SlowCall -- We cannot just enter it [in eval/apply, the entry code
-- is the fast-entry code]
- -- Since is_fun is False, we are *definitely* looking at a data value
+ -- Since is_fun is False, we are *definitely* looking at a data value
| updatable || co_ticky opts -- to catch double entry
{- OLD: || opt_SMP
I decided to remove this, because in SMP mode it doesn't matter
@@ -573,18 +593,28 @@ getCallMethod opts name id (LFThunk _ _ updatable std_form_info is_fun)
DirectEntry (thunkEntryLabel (profilePlatform (co_profile opts)) name (idCafInfo id) std_form_info
updatable) 0
-getCallMethod _ _name _ (LFUnknown True) _n_arg _v_args _cg_locs _self_loop_info
- = SlowCall -- might be a function
+-- Imported(Unknown) Ids
+getCallMethod opts name _ (LFUnknown might_be_a_function) n_args _v_args _cg_locs _self_loop_info appEnterInfo
+ | n_args == 0
+ , appEnterInfo == NoEnter
+ -- When profiling we enter functions to update the SCC so we
+ -- can't use the inferted enterInfo here.
+ -- See Note [Evaluating functions with profiling] in rts/Apply.cmm
+ , not (profileIsProfiling (co_profile opts) && might_be_a_function)
+ = InferedReturnIt
+
+ | might_be_a_function = SlowCall
+
+ | otherwise =
+ ASSERT2( n_args == 0, ppr name <+> ppr n_args )
+ EnterIt -- Not a function
-getCallMethod _ name _ (LFUnknown False) n_args _v_args _cg_loc _self_loop_info
- = ASSERT2( n_args == 0, ppr name <+> ppr n_args )
- EnterIt -- Not a function
getCallMethod _ _name _ LFLetNoEscape _n_args _v_args (LneLoc blk_id lne_regs)
- _self_loop_info
+ _self_loop_info _appEnterInfo
= JumpToIt blk_id lne_regs
-getCallMethod _ _ _ _ _ _ _ _ = panic "Unknown call method"
+getCallMethod _ _ _ _ _ _ _ _ _ = panic "Unknown call method"
-----------------------------------------------------------------------------
-- Data types for closure information
diff --git a/compiler/GHC/StgToCmm/Env.hs b/compiler/GHC/StgToCmm/Env.hs
index 3ad42fd19d..116aa6bf19 100644
--- a/compiler/GHC/StgToCmm/Env.hs
+++ b/compiler/GHC/StgToCmm/Env.hs
@@ -124,12 +124,19 @@ addBindsC new_bindings = do
new_bindings
setBinds new_binds
+-- TODO inside GHC the average module creates 385 external references
+-- with noteable cgIdInfo (so not generated by mkLFArgument).
+-- On average 200 of these are covered by True/False/[]
+-- and nullary constructors make up ~80.
+-- Caching at least the nullary constructors seems reasonable to me.
+
getCgIdInfo :: Id -> FCode CgIdInfo
getCgIdInfo id
= do { platform <- targetPlatform <$> getDynFlags
; local_binds <- getBinds -- Try local bindings first
; case lookupVarEnv local_binds id of {
- Just info -> return info ;
+ Just info -> -- pprTrace "getCgIdInfoLocal" (ppr id) $
+ return info ;
Nothing -> do {
-- Should be imported; make up a CgIdInfo for it
@@ -161,8 +168,12 @@ cgLookupPanic id
--------------------
getArgAmode :: NonVoid StgArg -> FCode CmmExpr
-getArgAmode (NonVoid (StgVarArg var)) = idInfoToAmode <$> getCgIdInfo var
-getArgAmode (NonVoid (StgLitArg lit)) = CmmLit <$> cgLit lit
+getArgAmode (NonVoid (StgVarArg var)) =
+ -- pprTrace "getArgAmodeV" (ppr var) $
+ idInfoToAmode <$> getCgIdInfo var
+getArgAmode (NonVoid (StgLitArg lit)) =
+ -- pprTrace "getArgAmodeV" (ppr lit) $
+ CmmLit <$> cgLit lit
getNonVoidArgAmodes :: [StgArg] -> FCode [CmmExpr]
-- NB: Filters out void args,
diff --git a/compiler/GHC/StgToCmm/Expr.hs b/compiler/GHC/StgToCmm/Expr.hs
index eb56a6ad09..2505afa7a6 100644
--- a/compiler/GHC/StgToCmm/Expr.hs
+++ b/compiler/GHC/StgToCmm/Expr.hs
@@ -1,6 +1,8 @@
{-# LANGUAGE CPP, BangPatterns #-}
{-# OPTIONS_GHC -Wno-incomplete-uni-patterns #-}
+{-# LANGUAGE CPP #-}
+{-# LANGUAGE TypeFamilies #-}
-----------------------------------------------------------------------------
--
@@ -37,6 +39,7 @@ import GHC.Cmm.BlockId
import GHC.Cmm hiding ( succ )
import GHC.Cmm.Info
import GHC.Cmm.Utils ( mAX_PTR_TAG )
+import GHC.Cmm.Ppr
import GHC.Core
import GHC.Core.DataCon
import GHC.Types.ForeignCall
@@ -51,8 +54,10 @@ import GHC.Utils.Misc
import GHC.Data.FastString
import GHC.Utils.Outputable
import GHC.Utils.Panic
+import GHC.Driver.Ppr ( {- pprTraceM, -} showPprUnsafe)
+import GHC.Driver.Session
-import Control.Monad ( unless, void )
+import Control.Monad ( unless, void, when )
import Control.Arrow ( first )
import Data.List ( partition )
@@ -62,12 +67,12 @@ import Data.List ( partition )
cgExpr :: CgStgExpr -> FCode ReturnKind
-cgExpr (StgApp fun args) = cgIdApp fun args
+cgExpr (StgApp evaled fun args) = cgIdApp evaled fun args
-- seq# a s ==> a
-- See Note [seq# magic] in GHC.Core.Opt.ConstantFold
cgExpr (StgOpApp (StgPrimOp SeqOp) [StgVarArg a, _] _res_ty) =
- cgIdApp a []
+ cgIdApp MayEnter a []
-- dataToTag# :: a -> Int#
-- See Note [dataToTag#] in primops.txt.pp
@@ -75,13 +80,13 @@ cgExpr (StgOpApp (StgPrimOp DataToTagOp) [StgVarArg a] _res_ty) = do
platform <- getPlatform
emitComment (mkFastString "dataToTag#")
tmp <- newTemp (bWord platform)
- _ <- withSequel (AssignTo [tmp] False) (cgIdApp a [])
+ _ <- withSequel (AssignTo [tmp] False) (cgIdApp MayEnter a [])
-- TODO: For small types look at the tag bits instead of reading info table
ptr_opts <- getPtrOpts
emitReturn [getConstrTag ptr_opts (cmmUntag platform (CmmReg (CmmLocal tmp)))]
cgExpr (StgOpApp op args ty) = cgOpApp op args ty
-cgExpr (StgConApp con args _)= cgConApp con args
+cgExpr (StgConApp _ext con args _)= cgConApp con args
cgExpr (StgTick t e) = cgTick t >> cgExpr e
cgExpr (StgLit lit) = do cmm_lit <- cgLit lit
emitReturn [CmmLit cmm_lit]
@@ -158,9 +163,9 @@ cgLetNoEscapeRhsBody
-> FCode (CgIdInfo, FCode ())
cgLetNoEscapeRhsBody local_cc bndr (StgRhsClosure _ cc _upd args body)
= cgLetNoEscapeClosure bndr local_cc cc (nonVoidIds args) body
-cgLetNoEscapeRhsBody local_cc bndr (StgRhsCon cc con args)
+cgLetNoEscapeRhsBody local_cc bndr (StgRhsCon _ext cc con args)
= cgLetNoEscapeClosure bndr local_cc cc []
- (StgConApp con args (pprPanic "cgLetNoEscapeRhsBody" $
+ (StgConApp _ext con args (pprPanic "cgLetNoEscapeRhsBody" $
text "StgRhsCon doesn't have type args"))
-- For a constructor RHS we want to generate a single chunk of
-- code which can be jumped to from many places, which will
@@ -288,6 +293,52 @@ Hence: two basic plans for
...code for alts...
...no heap check...
+
+ Note [Handle gc for evaluated scrutinees]
+
+ ------ Plan C: special case when ---------
+
+ (i) e is already evaluated
+
+ Then heap allocation in the case branch
+ is replaced by an upstream check.
+ Very common example: Casing on strict fields.
+
+ ...heap check...
+ ...assign bindings...
+
+ ...code for alts...
+ ...no heap check...
+
+ -- Reasoning for Plan C:
+
+ When using GcInAlts the return point for heap checks and evaluating
+ the scrutinee is shared. This does mean we might execute the actual
+ branching code twice but it's rare enough to not matter.
+
+ The huge advantage of this pattern is that we do not require multiple
+ info tables for returning from gc as they can be shared between all
+ cases.
+
+ However when the scrutinee is already evaluated there is no evaluation
+ call. Instead we would end up with one info table per alternative.
+
+ To avoid this we unconditionally do gc outside of the alts with all
+ the pros and cons described in Note [Compiling case expressions].
+
+ For containers:Data/Sequence/Internal/Sorting.o the difference is
+ about 10% in terms of code size.
+
+ For nofib it's about -0.5% reduction in Module size with this approach
+ while the benefit without it is almost meaningless at a reported -0.1%.
+
+ There is still the issue with putting heap checks into loops,
+ but we are not really worse of than we would be when checking
+ if a scrutinee is evaluated.
+
+ TODO: Investigate what is required to instead create a shared return
+ point for all the GC calls in the alts.
+
-}
@@ -340,7 +391,7 @@ exist, perhaps because the occurrence information preserved by
job we deleted the hacks.
-}
-cgCase (StgApp v []) _ (PrimAlt _) alts
+cgCase (StgApp _ext v []) _ (PrimAlt _) alts
| isVoidRep (idPrimRep v) -- See Note [Scrutinising VoidRep]
, [(DEFAULT, _, rhs)] <- alts
= cgExpr rhs
@@ -361,7 +412,7 @@ then we'll get a runtime panic, because the HValue really is a
MutVar#. The types are compatible though, so we can just generate an
assignment.
-}
-cgCase (StgApp v []) bndr alt_type@(PrimAlt _) alts
+cgCase (StgApp _ext v []) bndr alt_type@(PrimAlt _) alts
| isUnliftedType (idType v) -- Note [Dodgy unsafeCoerce 1]
= -- assignment suffices for unlifted types
do { platform <- getPlatform
@@ -389,7 +440,7 @@ because bottom must be untagged, it will be entered. The Sequel is a
type-correct assignment, albeit bogus. The (dead) continuation loops;
it would be better to invoke some kind of panic function here.
-}
-cgCase scrut@(StgApp v []) _ (PrimAlt _) _
+cgCase scrut@(StgApp _ext v []) _ (PrimAlt _) _
= do { platform <- getPlatform
; mb_cc <- maybeSaveCostCentre True
; _ <- withSequel
@@ -421,7 +472,7 @@ cgCase (StgOpApp (StgPrimOp SeqOp) [StgVarArg a, _] _) bndr alt_type alts
= -- Note [Handle seq#]
-- And see Note [seq# magic] in GHC.Core.Opt.ConstantFold
-- Use the same return convention as vanilla 'a'.
- cgCase (StgApp a []) bndr alt_type alts
+ cgCase (StgApp MayEnter a []) bndr alt_type alts
cgCase scrut bndr alt_type alts
= -- the general case
@@ -429,11 +480,15 @@ cgCase scrut bndr alt_type alts
; up_hp_usg <- getVirtHp -- Upstream heap usage
; let ret_bndrs = chooseReturnBndrs bndr alt_type alts
alt_regs = map (idToReg platform) ret_bndrs
+
+ -- Todo: Non evaluating cases always have simple scruts.
+
; simple_scrut <- isSimpleScrut scrut alt_type
; let do_gc | is_cmp_op scrut = False -- See Note [GC for conditionals]
| not simple_scrut = True
| isSingleton alts = False
| up_hp_usg > 0 = False
+ | evaluatedScrut = False
| otherwise = True
-- cf Note [Compiling case expressions]
gc_plan = if do_gc then GcInAlts alt_regs else NoGcInAlts
@@ -449,6 +504,11 @@ cgCase scrut bndr alt_type alts
where
is_cmp_op (StgOpApp (StgPrimOp op) _ _) = isComparisonPrimOp op
is_cmp_op _ = False
+ evaluatedScrut
+ | (StgApp NoEnter _v []) <- scrut = True
+ | otherwise = False
+
+
{- Note [GC for conditionals]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -498,10 +558,11 @@ isSimpleScrut :: CgStgExpr -> AltType -> FCode Bool
-- heap usage from alternatives into the stuff before the case
-- NB: if you get this wrong, and claim that the expression doesn't allocate
-- when it does, you'll deeply mess up allocation
-isSimpleScrut (StgOpApp op args _) _ = isSimpleOp op args
-isSimpleScrut (StgLit _) _ = return True -- case 1# of { 0# -> ..; ... }
-isSimpleScrut (StgApp _ []) (PrimAlt _) = return True -- case x# of { 0# -> ..; ... }
-isSimpleScrut _ _ = return False
+isSimpleScrut (StgOpApp op args _) _ = isSimpleOp op args
+isSimpleScrut (StgLit _) _ = return True -- case 1# of { 0# -> ..; ... }
+isSimpleScrut (StgApp _ _ []) (PrimAlt _) = return True -- case x# of { 0# -> ..; ... }
+isSimpleScrut (StgApp NoEnter _ []) _ = return True -- case !x of { ... }
+isSimpleScrut _ _ = return False
isSimpleOp :: StgOp -> [StgArg] -> FCode Bool
-- True iff the op cannot block or allocate
@@ -854,24 +915,53 @@ cgConApp con stg_args
; tickyReturnNewCon (length stg_args)
; emitReturn [idInfoToAmode idinfo] }
-cgIdApp :: Id -> [StgArg] -> FCode ReturnKind
-cgIdApp fun_id args = do
+-- | Call barf if we failed to predict a tag correctly.
+emitTagAssertion :: String -> CmmExpr -> FCode ()
+emitTagAssertion onWhat fun = do
+ { platform <- getPlatform
+ ; lret <- newBlockId
+ ; lfault <- newBlockId
+ -- ; pprTraceM "emitTagAssertion" (text onWhat)
+ ; emit $ mkCbranch (cmmIsTagged platform fun)
+ lret lfault Nothing
+ ; emitLabel lfault
+ ; emitBarf ("Tag inference failed on:" ++ onWhat)
+ ; emitLabel lret
+ }
+
+cgIdApp :: AppEnters -> Id -> [StgArg] -> FCode ReturnKind
+cgIdApp strict fun_id args = do
+ platform <- getPlatform
+ dflags <- getDynFlags
fun_info <- getCgIdInfo fun_id
self_loop_info <- getSelfLoop
call_opts <- getCallOpts
profile <- getProfile
let fun_arg = StgVarArg fun_id
fun_name = idName fun_id
- fun = idInfoToAmode fun_info
+ fun = idInfoToAmode fun_info :: CmmExpr
lf_info = cg_lf fun_info
n_args = length args
v_args = length $ filter (isVoidTy . stgArgType) args
- case getCallMethod call_opts fun_name fun_id lf_info n_args v_args (cg_loc fun_info) self_loop_info of
- -- A value in WHNF, so we can just return it.
+ case getCallMethod call_opts fun_name fun_id lf_info n_args v_args (cg_loc fun_info) self_loop_info strict of
+ -- A value in WHNF & tagged, so we can just return it.
ReturnIt
| isVoidTy (idType fun_id) -> emitReturn []
| otherwise -> emitReturn [fun]
- -- ToDo: does ReturnIt guarantee tagged?
+
+ -- A value infered to be in WHNF, so we can just return it.
+ InferedReturnIt
+ | isVoidTy (idType fun_id) -> trace >> emitReturn []
+ | otherwise -> trace >> assertTag >>
+ emitReturn [fun]
+ where
+ trace = do
+ tickyTagged
+ -- pprTraceM "WHNF:" (ppr fun_id <+> ppr args )
+ assertTag =
+ -- TODO: Move into platform
+ when (gopt Opt_DoTagInferenceChecks dflags) $
+ emitTagAssertion (showPprUnsafe (ppr fun_id <+> pprExpr platform fun)) fun
EnterIt -> ASSERT( null args ) -- Discarding arguments
emitEnter fun
diff --git a/compiler/GHC/StgToCmm/Ticky.hs b/compiler/GHC/StgToCmm/Ticky.hs
index b7f43665cd..113c0cd7d2 100644
--- a/compiler/GHC/StgToCmm/Ticky.hs
+++ b/compiler/GHC/StgToCmm/Ticky.hs
@@ -97,7 +97,10 @@ module GHC.StgToCmm.Ticky (
tickyUnboxedTupleReturn,
tickyReturnOldCon, tickyReturnNewCon,
- tickySlowCall
+ tickyKnownCallTooFewArgs, tickyKnownCallExact, tickyKnownCallExtraArgs,
+ tickySlowCall, tickySlowCallPat,
+
+ tickyTagged, tickyUntagged
) where
import GHC.Prelude
@@ -544,6 +547,19 @@ tickyStackCheck :: FCode ()
tickyStackCheck = ifTicky $ bumpTickyCounter (fsLit "STK_CHK_ctr")
-- -----------------------------------------------------------------------------
+-- Ticky for tag inferrence characterisation
+
+-- | Predicted a pointer would be tagged correctly (GHC will crash if not so no miss case)
+tickyTagged :: FCode ()
+tickyTagged = ifTicky $ bumpTickyCounter (fsLit "TAG_TAGGED_pred")
+
+-- | Pass a boolean expr indicating if tag was present.
+tickyUntagged :: CmmExpr -> FCode ()
+tickyUntagged e = do
+ ifTicky $ bumpTickyCounter (fsLit "TAG_UNTAGGED_pred")
+ ifTicky $ bumpTickyCounterByE (fsLit "TAG_UNTAGGED_miss") e
+
+-- -----------------------------------------------------------------------------
-- Ticky utils
ifTicky :: FCode () -> FCode ()
diff --git a/compiler/GHC/StgToCmm/Utils.hs b/compiler/GHC/StgToCmm/Utils.hs
index dbb4481d72..cfe2d11c94 100644
--- a/compiler/GHC/StgToCmm/Utils.hs
+++ b/compiler/GHC/StgToCmm/Utils.hs
@@ -14,6 +14,7 @@ module GHC.StgToCmm.Utils (
emitDataLits, emitRODataLits,
emitDataCon,
emitRtsCall, emitRtsCallWithResult, emitRtsCallGen,
+ emitBarf,
assignTemp, newTemp,
newUnboxedTupleRegs,
@@ -182,6 +183,11 @@ tagToClosure platform tycon tag
--
-------------------------------------------------------------------------
+emitBarf :: String -> FCode ()
+emitBarf msg = do
+ strLbl <- newStringCLit msg
+ emitRtsCall rtsUnitId (fsLit "barf") [(CmmLit strLbl,AddrHint)] False
+
emitRtsCall :: UnitId -> FastString -> [(CmmExpr,ForeignHint)] -> Bool -> FCode ()
emitRtsCall pkg fun args safe = emitRtsCallGen [] (mkCmmCodeLabel pkg fun) args safe
diff --git a/compiler/GHC/Types/Demand.hs b/compiler/GHC/Types/Demand.hs
index f84e3c0bc2..9c918da9f0 100644
--- a/compiler/GHC/Types/Demand.hs
+++ b/compiler/GHC/Types/Demand.hs
@@ -53,7 +53,9 @@ module GHC.Types.Demand (
useCount, isUsedOnce, reuseEnv,
zapUsageDemand, zapUsageEnvSig,
zapUsedOnceDemand, zapUsedOnceSig,
- strictifyDictDmd, strictifyDmd
+ strictifyDictDmd, strictifyDmd,
+
+ strTop, strBot, useBot, JointDmd(..), useTop
) where
@@ -897,6 +899,8 @@ instance Outputable TypeShape where
-- ExnOrDiv (nip)
-- |
-- Diverges (ni)
+-- |
+-- Absent (i)
-- @
--
-- As you can see, we don't distinguish __n__ and __i__.
@@ -907,10 +911,14 @@ data Divergence
| ExnOrDiv -- ^ Definitely throws a *precise* exception, an imprecise
-- exception or diverges. Never converges, hence 'isDeadEndDiv'!
-- See scenario 1 in Note [Precise exceptions and strictness analysis].
+ | Absent -- ^ Will diverge upon entry, but will not be evaluated in absence of
+ -- compiler bugs.
| Dunno -- ^ Might diverge, throw any kind of exception or converge.
deriving( Eq, Show )
lubDivergence :: Divergence -> Divergence -> Divergence
+lubDivergence Absent div = div
+lubDivergence div Absent = div
lubDivergence Diverges div = div
lubDivergence div Diverges = div
lubDivergence ExnOrDiv ExnOrDiv = ExnOrDiv
@@ -927,7 +935,13 @@ bothDivergence :: Divergence -> Divergence -> Divergence
-- worth it and is only relevant in higher-order scenarios
-- (e.g. Divergence of @f (throwIO blah)@).
-- So 'bothDivergence' currently is 'glbDivergence', really.
+-- bothDivergence x y
+-- | pprTrace "bothDivergence" (ppr x <+> ppr y) False
+-- = undefined
bothDivergence Dunno Dunno = Dunno
+-- TODO: Absent - this is just based on "So 'bothDivergence' currently is 'glbDivergence', really."
+bothDivergence Absent _ = Absent
+bothDivergence _ Absent = Absent
bothDivergence Diverges _ = Diverges
bothDivergence _ Diverges = Diverges
bothDivergence _ _ = ExnOrDiv
@@ -935,7 +949,9 @@ bothDivergence _ _ = ExnOrDiv
instance Outputable Divergence where
ppr Diverges = char 'b' -- for (b)ottom
ppr ExnOrDiv = char 'x' -- for e(x)ception
- ppr Dunno = empty
+ ppr Absent = char 'a' -- for (a)bsent
+ ppr Dunno = char 'T'
+ -- ppr Dunno = empty
{- Note [Precise vs imprecise exceptions]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -1052,6 +1068,8 @@ botDiv = Diverges
isDeadEndDiv :: Divergence -> Bool
isDeadEndDiv Diverges = True
isDeadEndDiv ExnOrDiv = True
+isDeadEndDiv Absent = False -- Actually a dead end, but we pretent it isn't.
+ -- See Note [aBSENT_ERROR_ID] for why.
isDeadEndDiv Dunno = False
-- See Notes [Default demand on free variables and arguments]
@@ -1060,6 +1078,9 @@ defaultFvDmd :: Divergence -> Demand
defaultFvDmd Dunno = absDmd
defaultFvDmd ExnOrDiv = absDmd -- This is the whole point of ExnOrDiv!
defaultFvDmd Diverges = botDmd -- Diverges
+defaultFvDmd Absent = absDmd -- While this diverges we compile under the assumption
+ -- that it's never entered, so the free variables should
+ -- never be demanded.
defaultArgDmd :: Divergence -> Demand
-- TopRes and BotRes are polymorphic, so that
@@ -1072,6 +1093,7 @@ defaultArgDmd Dunno = topDmd
-- argument. But it is still absent.
defaultArgDmd ExnOrDiv = absDmd
defaultArgDmd Diverges = botDmd
+defaultArgDmd Absent = topDmd
{- Note [Default demand on free variables and arguments]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -2049,9 +2071,11 @@ instance Binary Divergence where
put_ bh Dunno = putByte bh 0
put_ bh ExnOrDiv = putByte bh 1
put_ bh Diverges = putByte bh 2
+ put_ bh Absent = putByte bh 3
get bh = do { h <- getByte bh
; case h of
0 -> return Dunno
1 -> return ExnOrDiv
+ 3 -> return Absent
_ -> return Diverges }
diff --git a/compiler/GHC/Types/Id/Make.hs b/compiler/GHC/Types/Id/Make.hs
index 7a0990ee48..5003f32527 100644
--- a/compiler/GHC/Types/Id/Make.hs
+++ b/compiler/GHC/Types/Id/Make.hs
@@ -1443,6 +1443,8 @@ lazyIdName = mkWiredInIdName gHC_MAGIC (fsLit "lazy") lazyIdKey
oneShotName = mkWiredInIdName gHC_MAGIC (fsLit "oneShot") oneShotKey oneShotId
noinlineIdName = mkWiredInIdName gHC_MAGIC (fsLit "noinline") noinlineIdKey noinlineId
+
+
------------------------------------------------
proxyHashId :: Id
proxyHashId
diff --git a/compiler/GHC/Types/Unique/FM.hs b/compiler/GHC/Types/Unique/FM.hs
index 6d13436169..6b1a9dd647 100644
--- a/compiler/GHC/Types/Unique/FM.hs
+++ b/compiler/GHC/Types/Unique/FM.hs
@@ -33,6 +33,7 @@ module GHC.Types.Unique.FM (
-- ** Manipulating those mappings
emptyUFM,
+ isSingletonUFM,
unitUFM,
unitDirectlyUFM,
zipToUFM,
@@ -86,6 +87,7 @@ import GHC.Utils.Outputable
import GHC.Utils.Panic (assertPanic)
import GHC.Utils.Misc (debugIsOn)
import qualified Data.IntMap as M
+import qualified Data.IntMap.Internal as MI
import qualified Data.IntSet as S
import Data.Data
import qualified Data.Semigroup as Semi
@@ -111,6 +113,13 @@ emptyUFM = UFM M.empty
isNullUFM :: UniqFM key elt -> Bool
isNullUFM (UFM m) = M.null m
+-- Avoids an O(n) call
+isSingletonUFM :: UniqFM key elt -> Bool
+isSingletonUFM (UFM m) =
+ case m of
+ MI.Tip _ _ -> True
+ _ -> False
+
unitUFM :: Uniquable key => key -> elt -> UniqFM key elt
unitUFM k v = UFM (M.singleton (getKey $ getUnique k) v)
diff --git a/compiler/GHC/Utils/Misc.hs b/compiler/GHC/Utils/Misc.hs
index 07d4b721ff..6f3e9c749a 100644
--- a/compiler/GHC/Utils/Misc.hs
+++ b/compiler/GHC/Utils/Misc.hs
@@ -54,6 +54,7 @@ module GHC.Utils.Misc (
mapLastM,
whenNonEmpty,
+ selectIndices,
mergeListsBy,
isSortedBy,
@@ -660,6 +661,29 @@ isSortedBy cmp = sorted
sorted [] = True
sorted [_] = True
sorted (x:y:xs) = cmp x y /= GT && sorted (y:xs)
+
+-- | Given a list of increasing indices return only these.
+-- Equal to selectIndicies indices xs == map (xs !!) indices
+-- O(n) so only useful for small/dense selection
+-- Indices MUST be ordered ascending and are 0 based.
+selectIndices :: [Int] -> [a] -> [a]
+selectIndices [] _ = []
+selectIndices is xs =
+ go 0 is xs
+ where
+ go :: Int -> [Int] -> [a] -> [a]
+ go _ [] _ = []
+ go _ _ [] = []
+ go n (i:is) (x:xs)
+ | n == i
+ = x : go (n+1) is xs
+ | n > i
+ = panic "Invalid input to selectIndices"
+ | otherwise
+ = go (n+1) (i:is) xs
+
+
+
{-
************************************************************************
* *
diff --git a/compiler/ghc.cabal.in b/compiler/ghc.cabal.in
index 0a333ba1dc..b108284568 100644
--- a/compiler/ghc.cabal.in
+++ b/compiler/ghc.cabal.in
@@ -524,10 +524,12 @@ Library
GHC.Stg.Lift.Analysis
GHC.Stg.Lift.Monad
GHC.Stg.Lint
+ GHC.Stg.InferTags
GHC.Stg.Pipeline
GHC.Stg.Stats
GHC.Stg.Subst
GHC.Stg.Syntax
+ GHC.Stg.Utils
GHC.StgToCmm
GHC.StgToCmm.ArgRep
GHC.StgToCmm.Bind
diff --git a/includes/stg/Ticky.h b/includes/stg/Ticky.h
index cefb674f31..680da9da47 100644
--- a/includes/stg/Ticky.h
+++ b/includes/stg/Ticky.h
@@ -178,6 +178,13 @@ EXTERN StgInt RET_OLD_ctr INIT(0);
EXTERN StgInt RET_UNBOXED_TUP_ctr INIT(0);
EXTERN StgInt RET_SEMI_loads_avoided INIT(0);
+
+/* Performance characterization for tag inference */
+EXTERN StgInt TAG_UNTAGGED_pred INIT(0);
+EXTERN StgInt TAG_UNTAGGED_miss INIT(0);
+EXTERN StgInt TAG_TAGGED_pred INIT(0);
+EXTERN StgInt TAG_TAGGED_miss INIT(0);
+
/* End of counter declarations. */
/* How many bins in ticky's histograms */
diff --git a/libraries/base/Control/Exception/Base.hs b/libraries/base/Control/Exception/Base.hs
index 0d69d6f272..8c4696d334 100644
--- a/libraries/base/Control/Exception/Base.hs
+++ b/libraries/base/Control/Exception/Base.hs
@@ -1,6 +1,8 @@
{-# LANGUAGE MagicHash #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE Trustworthy #-}
+{-# LANGUAGE StandaloneDeriving #-}
+{-# OPTIONS -O1 #-}
-----------------------------------------------------------------------------
-- |
@@ -106,6 +108,7 @@ import GHC.IO.Exception
import GHC.Show
-- import GHC.Exception hiding ( Exception )
import GHC.Conc.Sync
+import GHC.Magic
import Data.Either
@@ -383,6 +386,10 @@ recSelError, recConError, runtimeError,
recSelError s = throw (RecSelError ("No match in record selector "
++ unpackCStringUtf8# s)) -- No location info unfortunately
runtimeError s = errorWithoutStackTrace (unpackCStringUtf8# s) -- No location info unfortunately
+
+-- No point in inlining absentError. It would both make it harder to spot absentError
+-- applications and hurt performance as it's only executed in the error case.
+{-# NOINLINE absentError #-}
absentError s = errorWithoutStackTrace ("Oops! Entered absent arg " ++ unpackCStringUtf8# s)
nonExhaustiveGuardsError s = throw (PatternMatchFail (untangle s "Non-exhaustive guards in"))
diff --git a/libraries/ghc-prim/GHC/Magic.hs b/libraries/ghc-prim/GHC/Magic.hs
index cd9474271d..597b816b75 100644
--- a/libraries/ghc-prim/GHC/Magic.hs
+++ b/libraries/ghc-prim/GHC/Magic.hs
@@ -22,7 +22,8 @@
--
-----------------------------------------------------------------------------
-module GHC.Magic ( inline, noinline, lazy, oneShot, runRW# ) where
+module GHC.Magic ( inline, noinline, lazy, oneShot, runRW#
+ ) where
--------------------------------------------------
-- See Note [magicIds] in GHC.Types.Id.Make
diff --git a/libraries/ghc-prim/GHC/Prim/Panic.hs b/libraries/ghc-prim/GHC/Prim/Panic.hs
index 21ebc56a88..8048c880ed 100644
--- a/libraries/ghc-prim/GHC/Prim/Panic.hs
+++ b/libraries/ghc-prim/GHC/Prim/Panic.hs
@@ -4,6 +4,7 @@
{-# LANGUAGE UnboxedTuples #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE EmptyCase #-}
+{-# OPTIONS -O #-}
-- | Primitive panics.
module GHC.Prim.Panic
diff --git a/rts/RtsSymbols.c b/rts/RtsSymbols.c
index e433d9d369..aead7bf181 100644
--- a/rts/RtsSymbols.c
+++ b/rts/RtsSymbols.c
@@ -515,6 +515,12 @@
SymI_HasProto(RET_OLD_ctr) \
SymI_HasProto(RET_UNBOXED_TUP_ctr) \
SymI_HasProto(RET_SEMI_loads_avoided) \
+ \
+ SymI_HasProto(TAG_UNTAGGED_pred) \
+ SymI_HasProto(TAG_UNTAGGED_miss) \
+ SymI_HasProto(TAG_TAGGED_pred) \
+ SymI_HasProto(TAG_TAGGED_miss) \
+ \
SymI_HasProto(RET_NEW_hst) \
SymI_HasProto(RET_OLD_hst) \
SymI_HasProto(RET_UNBOXED_TUP_hst)
diff --git a/rts/Ticky.c b/rts/Ticky.c
index b46f91b204..625f1911c3 100644
--- a/rts/Ticky.c
+++ b/rts/Ticky.c
@@ -82,6 +82,10 @@ PrintTickyInfo(void)
unsigned long tot_old_updates = UPD_OLD_IND_ctr + UPD_OLD_PERM_IND_ctr;
unsigned long tot_gengc_updates = tot_new_updates + tot_old_updates;
+ // Number of times tag inference predicted tagged/untagged correctly
+ // allowing us to skip a tag check (when ticky is disabled)
+ unsigned long tot_tag_preds = TAG_UNTAGGED_pred + TAG_TAGGED_pred;
+
FILE *tf = RtsFlags.TickyFlags.tickyFile;
/* If tf = NULL, that means the user passed in stderr for the ticky stats
@@ -190,6 +194,17 @@ PrintTickyInfo(void)
PC(INTAVG(tot_old_updates,tot_gengc_updates)));
}
+ if (tot_tag_preds != 0) {
+ fprintf(tf, "\nTOTAL TAG PREDICTIONS MADE: %9lu \n",
+ tot_tag_preds);
+ fprintf(tf, "TAGGED PREDICTIONS HIT: %9lu \n",
+ TAG_TAGGED_pred);
+ fprintf(tf, "UNTAGGED PREDICTIONS HIT: %9lu \n",
+ TAG_UNTAGGED_pred - TAG_UNTAGGED_miss);
+ fprintf(tf, "UNTAGGED PREDICTIONS MISS: %9lu \n",
+ TAG_UNTAGGED_miss);
+ }
+
printRegisteredCounterInfo(tf);
fprintf(tf,"\n**************************************************\n");
diff --git a/testsuite/tests/simplStg/should_run/all.T b/testsuite/tests/simplStg/should_run/all.T
index 2f7c69f5db..7bca7b518f 100644
--- a/testsuite/tests/simplStg/should_run/all.T
+++ b/testsuite/tests/simplStg/should_run/all.T
@@ -18,4 +18,8 @@ test('T13536a',
compile_and_run,
[''])
+test('inferTags001', normal, multimod_compile_and_run, ['inferTags001', 'inferTags001_a'])
+# test('T5462Yes1', [extra_files(['GEnum/', 'GEq/', 'GFunctor/']),
+# outputdir('out_T5462Yes1')]
+# , multimod_compile_and_run, ['T5462Yes1', '-iGEq -iGEnum -iGFunctor']) \ No newline at end of file
diff --git a/testsuite/tests/simplStg/should_run/inferTags001.hs b/testsuite/tests/simplStg/should_run/inferTags001.hs
new file mode 100644
index 0000000000..ba6facaf7e
--- /dev/null
+++ b/testsuite/tests/simplStg/should_run/inferTags001.hs
@@ -0,0 +1,7 @@
+module Main (main, foo) where
+
+import A
+
+main = return ()
+
+foo = g
diff --git a/testsuite/tests/simplStg/should_run/inferTags001_a.hs b/testsuite/tests/simplStg/should_run/inferTags001_a.hs
new file mode 100644
index 0000000000..9fdd07c98c
--- /dev/null
+++ b/testsuite/tests/simplStg/should_run/inferTags001_a.hs
@@ -0,0 +1,9 @@
+{-# OPTIONS_GHC -fno-worker-wrapper #-}
+
+module A where
+
+data T = T !Int !Bool
+
+{-# NOINLINE g #-}
+g :: T -> Int
+g (T x _) = x
diff --git a/testsuite/tests/simplStg/should_run/inferTags001_b.hs b/testsuite/tests/simplStg/should_run/inferTags001_b.hs
new file mode 100644
index 0000000000..6b89406625
--- /dev/null
+++ b/testsuite/tests/simplStg/should_run/inferTags001_b.hs
@@ -0,0 +1,9 @@
+{-# OPTIONS_GHC -fno-worker-wrapper #-}
+
+module B where
+
+-- data T = T !Int !Bool
+
+{-# NOINLINE g #-}
+g :: T -> Int
+g (T x _) = x