GHC.Core.Unfold.Make

ghc-lib-parser-9.10.1.20250103: The GHC API, decoupled from GHC versions

Safe Haskell | Ignore
Language | GHC2021

GHC.Core.Unfold.Make

Description

Unfolding creation

Synopsis

- noUnfolding :: Unfolding
- mkUnfolding :: UnfoldingOpts -> UnfoldingSource -> Bool -> Bool -> CoreExpr -> Maybe UnfoldingCache -> Unfolding
- mkCoreUnfolding :: UnfoldingSource -> Bool -> CoreExpr -> Maybe UnfoldingCache -> UnfoldingGuidance -> Unfolding
- mkFinalUnfolding :: UnfoldingOpts -> UnfoldingSource -> DmdSig -> CoreExpr -> Unfolding
- mkFinalUnfolding' :: UnfoldingOpts -> UnfoldingSource -> DmdSig -> CoreExpr -> Maybe UnfoldingCache -> Unfolding
- mkSimpleUnfolding :: UnfoldingOpts -> CoreExpr -> Unfolding
- mkWorkerUnfolding :: SimpleOpts -> (CoreExpr -> CoreExpr) -> Unfolding -> Unfolding
- mkInlineUnfoldingWithArity :: SimpleOpts -> UnfoldingSource -> Arity -> CoreExpr -> Unfolding
- mkInlineUnfoldingNoArity :: SimpleOpts -> UnfoldingSource -> CoreExpr -> Unfolding
- mkInlinableUnfolding :: SimpleOpts -> UnfoldingSource -> CoreExpr -> Unfolding
- mkWrapperUnfolding :: SimpleOpts -> CoreExpr -> Arity -> Unfolding
- mkCompulsoryUnfolding :: CoreExpr -> Unfolding
- mkCompulsoryUnfolding' :: SimpleOpts -> CoreExpr -> Unfolding
- mkDFunUnfolding :: [Var] -> DataCon -> [CoreExpr] -> Unfolding
- mkDataConUnfolding :: CoreExpr -> Unfolding
- specUnfolding :: SimpleOpts -> [Var] -> (CoreExpr -> CoreExpr) -> [CoreArg] -> Unfolding -> Unfolding
- certainlyWillInline :: UnfoldingOpts -> IdInfo -> CoreExpr -> Maybe Unfolding

# Documentation

noUnfolding :: Unfolding #

There is no known `Unfolding`

mkUnfolding :: UnfoldingOpts -> UnfoldingSource -> Bool -> Bool -> CoreExpr -> Maybe UnfoldingCache -> Unfolding #

mkCoreUnfolding :: UnfoldingSource -> Bool -> CoreExpr -> Maybe UnfoldingCache -> UnfoldingGuidance -> Unfolding #

mkFinalUnfolding :: UnfoldingOpts -> UnfoldingSource -> DmdSig -> CoreExpr -> Unfolding #

mkFinalUnfolding' :: UnfoldingOpts -> UnfoldingSource -> DmdSig -> CoreExpr -> Maybe UnfoldingCache -> Unfolding #

mkSimpleUnfolding :: UnfoldingOpts -> CoreExpr -> Unfolding #

mkWorkerUnfolding :: SimpleOpts -> (CoreExpr -> CoreExpr) -> Unfolding -> Unfolding #

mkInlineUnfoldingWithArity :: SimpleOpts -> UnfoldingSource -> Arity -> CoreExpr -> Unfolding #

Make an INLINE unfolding that will be used once the RHS has been saturated to the given arity.

mkInlineUnfoldingNoArity :: SimpleOpts -> UnfoldingSource -> CoreExpr -> Unfolding #

Make an INLINE unfolding that may be used unsaturated (ug_unsat_ok = unSaturatedOk) and that is reported as having its manifest arity (the number of outer lambdas applications will resolve before doing any work).

mkInlinableUnfolding :: SimpleOpts -> UnfoldingSource -> CoreExpr -> Unfolding #

mkWrapperUnfolding :: SimpleOpts -> CoreExpr -> Arity -> Unfolding #

mkCompulsoryUnfolding :: CoreExpr -> Unfolding #

Used for things that absolutely must be unfolded

mkCompulsoryUnfolding' :: SimpleOpts -> CoreExpr -> Unfolding #

Same as `mkCompulsoryUnfolding` but simplifies the unfolding first

mkDFunUnfolding :: [Var] -> DataCon -> [CoreExpr] -> Unfolding #

mkDataConUnfolding :: CoreExpr -> Unfolding #

specUnfolding :: SimpleOpts -> [Var] -> (CoreExpr -> CoreExpr) -> [CoreArg] -> Unfolding -> Unfolding #

certainlyWillInline :: UnfoldingOpts -> IdInfo -> CoreExpr -> Maybe Unfolding #

Sees if the unfolding is pretty certain to inline. If so, return a *stable* unfolding for it, that will always inline. The CoreExpr is the WW'd and simplified RHS. In contrast, the unfolding template might not have been WW'd yet.