| Safe Haskell | None |
|---|---|
| Language | GHC2021 |
GHC.Core.Opt.Simplify.Utils
Synopsis
- rebuildLam :: SimplEnv -> [OutBndr] -> OutExpr -> SimplCont -> SimplM OutExpr
- mkCase :: SimplMode -> OutExpr -> OutId -> OutType -> [OutAlt] -> SimplM OutExpr
- prepareAlts :: OutExpr -> InId -> [InAlt] -> SimplM ([AltCon], [InAlt])
- tryEtaExpandRhs :: SimplEnv -> BindContext -> OutId -> OutExpr -> SimplM (ArityType, OutExpr)
- wantEtaExpansion :: CoreExpr -> Bool
- preInlineUnconditionally :: SimplEnv -> TopLevelFlag -> InId -> InExpr -> StaticEnv -> Maybe SimplEnv
- postInlineUnconditionally :: SimplEnv -> BindContext -> InId -> OutId -> OutExpr -> Bool
- activeRule :: SimplMode -> Activation -> Bool
- getUnfoldingInRuleMatch :: SimplEnv -> InScopeEnv
- updModeForStableUnfoldings :: Activation -> SimplMode -> SimplMode
- updModeForRules :: SimplMode -> SimplMode
- data BindContext
- bindContextLevel :: BindContext -> TopLevelFlag
- data SimplCont
- = Stop OutType CallCtxt SubDemand
- | CastIt { }
- | ApplyToVal { }
- | ApplyToTy { }
- | Select { }
- | StrictBind { }
- | StrictArg { }
- | TickIt CoreTickish SimplCont
- data DupFlag
- = NoDup
- | Simplified
- | OkToDup
- data FromWhat
- type StaticEnv = SimplEnv
- isSimplified :: DupFlag -> Bool
- contIsStop :: SimplCont -> Bool
- contIsDupable :: SimplCont -> Bool
- contResultType :: SimplCont -> OutType
- contHoleType :: SimplCont -> OutType
- contHoleScaling :: SimplCont -> Mult
- contIsTrivial :: SimplCont -> Bool
- contArgs :: SimplCont -> (Bool, [ArgSummary], SimplCont)
- contIsRhs :: SimplCont -> Maybe RecFlag
- mkBottomCont :: StaticEnv -> SimplCont -> SimplCont
- countArgs :: SimplCont -> Int
- mkBoringStop :: OutType -> SimplCont
- mkRhsStop :: OutType -> RecFlag -> Demand -> SimplCont
- mkLazyArgStop :: OutType -> ArgInfo -> SimplCont
- interestingCallContext :: SimplEnv -> SimplCont -> CallCtxt
- data ArgInfo = ArgInfo {}
- data ArgSpec
- = ValArg { }
- | TyArg { }
- | CastBy OutCoercion
- data RewriteCall
- mkArgInfo :: SimplEnv -> RuleEnv -> Id -> SimplCont -> ArgInfo
- addValArgTo :: ArgInfo -> OutExpr -> OutType -> ArgInfo
- addCastTo :: ArgInfo -> OutCoercion -> ArgInfo
- addTyArgTo :: ArgInfo -> OutType -> OutType -> ArgInfo
- argInfoExpr :: OutId -> [ArgSpec] -> OutExpr
- argInfoAppArgs :: [ArgSpec] -> [OutExpr]
- pushSimplifiedArgs :: SimplEnv -> [ArgSpec] -> SimplCont -> SimplCont
- pushSimplifiedRevArgs :: SimplEnv -> [ArgSpec] -> SimplCont -> SimplCont
- isStrictArgInfo :: ArgInfo -> Bool
- lazyArgContext :: ArgInfo -> CallCtxt
- abstractFloats :: UnfoldingOpts -> TopLevelFlag -> [OutTyVar] -> SimplFloats -> OutExpr -> SimplM ([OutBind], OutExpr)
- isExitJoinId :: Var -> Bool
Documentation
tryEtaExpandRhs :: SimplEnv -> BindContext -> OutId -> OutExpr -> SimplM (ArityType, OutExpr) Source #
wantEtaExpansion :: CoreExpr -> Bool Source #
preInlineUnconditionally :: SimplEnv -> TopLevelFlag -> InId -> InExpr -> StaticEnv -> Maybe SimplEnv Source #
postInlineUnconditionally :: SimplEnv -> BindContext -> InId -> OutId -> OutExpr -> Bool Source #
activeRule :: SimplMode -> Activation -> Bool Source #
updModeForRules :: SimplMode -> SimplMode Source #
data BindContext Source #
Constructors
| Stop | Stop[e] = e |
Fields
| |
| CastIt | |
| ApplyToVal | |
| ApplyToTy | |
| Select | |
| StrictBind | |
| StrictArg | |
| TickIt CoreTickish SimplCont | |
Instances
Constructors
| NoDup | |
| Simplified | |
| OkToDup |
Instances
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 #
mkBottomCont :: StaticEnv -> SimplCont -> SimplCont Source #
Given a continuation cont, return a cont of the same type,
looking like (case <hole> of {}).
This is used when we are going to fill in the hole with bottom.
See (TC2,3) in Note [Trimming the continuation for bottoming functions]
Don't bother to trim, making a case hole of {}, if we have only
an essentially-trivial continuation; e.g. (hole @ty |> co).
mkBoringStop :: OutType -> SimplCont Source #
Constructors
| ArgInfo | |
Instances
Constructors
| ValArg | |
| TyArg | |
Fields
| |
| CastBy OutCoercion | |
Instances
data RewriteCall Source #
Constructors
| TryRules FullArgCount [CoreRule] | |
| TryInlining | |
| TryNothing |
argInfoAppArgs :: [ArgSpec] -> [OutExpr] Source #
isStrictArgInfo :: ArgInfo -> Bool Source #
lazyArgContext :: ArgInfo -> CallCtxt Source #
abstractFloats :: UnfoldingOpts -> TopLevelFlag -> [OutTyVar] -> SimplFloats -> OutExpr -> SimplM ([OutBind], OutExpr) Source #
isExitJoinId :: Var -> Bool Source #