GHC.Core.Opt.Simplify.Utils

ghc-9.2.1: The GHC API

Safe Haskell | Safe-Inferred
Language | Haskell2010

GHC.Core.Opt.Simplify.Utils

# Documentation

mkLam :: SimplEnv -> [OutBndr] -> OutExpr -> SimplCont -> SimplM OutExpr Source #

mkCase :: DynFlags -> OutExpr -> OutId -> OutType -> [OutAlt] -> SimplM OutExpr Source #

prepareAlts :: OutExpr -> OutId -> [InAlt] -> SimplM ([AltCon], [InAlt]) Source #

tryEtaExpandRhs :: SimplMode -> OutId -> OutExpr -> SimplM (ArityType, OutExpr) Source #

preInlineUnconditionally :: SimplEnv -> TopLevelFlag -> InId -> InExpr -> StaticEnv -> Maybe SimplEnv Source #

postInlineUnconditionally :: SimplEnv -> TopLevelFlag -> OutId -> OccInfo -> OutExpr -> Bool Source #

activeUnfolding :: SimplMode -> Id -> Bool Source #

activeRule :: SimplMode -> Activation -> Bool Source #

getUnfoldingInRuleMatch :: SimplEnv -> InScopeEnv Source #

simplEnvForGHCi :: Logger -> DynFlags -> SimplEnv Source #

updModeForStableUnfoldings :: Activation -> SimplMode -> SimplMode Source #

updModeForRules :: SimplMode -> SimplMode Source #

data SimplCont Source #

Constructors

Stop OutType CallCtxt |
CastIt OutCoercion SimplCont |
ApplyToVal |
Fields sc_dup :: DupFlag sc_hole_ty :: OutType sc_arg :: InExpr sc_env :: StaticEnv sc_cont :: SimplCont
ApplyToTy |
Fields sc_arg_ty :: OutType sc_hole_ty :: OutType sc_cont :: SimplCont
Select |
Fields sc_dup :: DupFlag sc_bndr :: InId sc_alts :: [InAlt] sc_env :: StaticEnv sc_cont :: SimplCont
StrictBind |
Fields sc_dup :: DupFlag sc_bndr :: InId sc_bndrs :: [InBndr] sc_body :: InExpr sc_env :: StaticEnv sc_cont :: SimplCont
StrictArg |
Fields sc_dup :: DupFlag sc_fun :: ArgInfo sc_fun_ty :: OutType sc_cont :: SimplCont
TickIt CoreTickish SimplCont |

#### Instances

Instances details

Outputable SimplCont Source # |
Instance details Defined in GHC.Core.Opt.Simplify.Utils Methods ppr :: SimplCont -> SDoc Source #

data DupFlag Source #

Constructors

NoDup |
Simplified |
OkToDup |

#### Instances

Instances details

Outputable DupFlag Source # |
Instance details Defined in GHC.Core.Opt.Simplify.Utils Methods ppr :: DupFlag -> SDoc Source #

type StaticEnv = SimplEnv Source #

isSimplified :: DupFlag -> Bool Source #

contIsStop :: SimplCont -> Bool Source #

contIsDupable :: SimplCont -> Bool Source #

contResultType :: SimplCont -> OutType Source #

contHoleType :: SimplCont -> OutType Source #

contHoleScaling :: SimplCont -> Mult Source #

contIsTrivial :: SimplCont -> Bool Source #

contArgs :: SimplCont -> (Bool, [ArgSummary], SimplCont) Source #

countArgs :: SimplCont -> Int Source #

mkBoringStop :: OutType -> SimplCont Source #

mkRhsStop :: OutType -> SimplCont Source #

mkLazyArgStop :: OutType -> CallCtxt -> SimplCont Source #

contIsRhsOrArg :: SimplCont -> Bool Source #

interestingCallContext :: SimplEnv -> SimplCont -> CallCtxt Source #

data ArgInfo Source #

Constructors

ArgInfo |
Fields ai_fun :: OutId ai_args :: [ArgSpec] ai_rules :: FunRules ai_encl :: Bool ai_dmds :: [Demand] ai_discs :: [Int]

#### Instances

Instances details

Outputable ArgInfo Source # |
Instance details Defined in GHC.Core.Opt.Simplify.Utils Methods ppr :: ArgInfo -> SDoc Source #

data ArgSpec Source #

Constructors

ValArg |
Fields as_dmd :: Demand as_arg :: OutExpr as_hole_ty :: OutType
TyArg |
Fields as_arg_ty :: OutType as_hole_ty :: OutType
CastBy OutCoercion |

#### Instances

Instances details

Outputable ArgSpec Source # |
Instance details Defined in GHC.Core.Opt.Simplify.Utils Methods ppr :: ArgSpec -> SDoc Source #

mkArgInfo :: SimplEnv -> Id -> [CoreRule] -> Int -> SimplCont -> ArgInfo Source #

addValArgTo :: ArgInfo -> OutExpr -> OutType -> ArgInfo Source #

addCastTo :: ArgInfo -> OutCoercion -> ArgInfo Source #

addTyArgTo :: ArgInfo -> OutType -> OutType -> ArgInfo Source #

argInfoExpr :: OutId -> [ArgSpec] -> OutExpr Source #

argInfoAppArgs :: [ArgSpec] -> [OutExpr] Source #

pushSimplifiedArgs :: SimplEnv -> [ArgSpec] -> SimplCont -> SimplCont Source #

isStrictArgInfo :: ArgInfo -> Bool Source #

lazyArgContext :: ArgInfo -> CallCtxt Source #

abstractFloats :: UnfoldingOpts -> TopLevelFlag -> [OutTyVar] -> SimplFloats -> OutExpr -> SimplM ([OutBind], OutExpr) Source #

isExitJoinId :: Var -> Bool Source #