| Safe Haskell | Safe-Inferred |
|---|---|
| Language | Haskell2010 |
PlutusIR.Transform.Inline.Utils
Description
Types and their functions, and general utility (including heuristics) for inlining.
Synopsis
- type ExternalConstraints tyname name uni fun m = (ToBuiltinMeaning uni fun) #
data InlineInfo tyname name uni fun ann #
Information used by the inliner that is constant across its operation. This includes some contextual and configuration information, and also some pre-computed information about the program.
See [Inlining and global uniqueness] for caveats about this information.
Constructors
| InlineInfo | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Fields
newtype InlineTerm tyname name uni fun ann # Substitution range, newtype TermSubst tyname name uni fun ann # Term substitution, Constructors
Instances
newtype TypeSubst tyname uni ann # Type substitution, similar to Constructors
Instances
data InlineVarInfo tyname name uni fun ann # Info attached to a let-binding needed for call site inlining. Constructors
data InlinerState tyname name uni fun ann # Inliner context for both unconditional inlining and call site inlining.
It includes substitution for both terms and types, which is similar to Constructors
Instances
Insert a variable into the substitution. applyTypeSubstitution :: forall tyname name uni fun ann. InliningConstraints tyname name uni fun => Type tyname uni ann -> InlineM tyname name uni fun ann (Type tyname uni ann) # substTyName :: forall tyname name uni fun ann. InliningConstraints tyname name uni fun => tyname -> InlineM tyname name uni fun ann (Maybe (Type tyname uni ann)) # substName :: forall tyname name uni fun ann. InliningConstraints tyname name uni fun => name -> InlineM tyname name uni fun ann (Maybe (Term tyname name uni fun ann)) # renameTerm :: forall tyname name uni fun ann. InliningConstraints tyname name uni fun => InlineTerm tyname name uni fun ann -> InlineM tyname name uni fun ann (Term tyname name uni fun ann) # checkPurity :: forall tyname name uni fun ann. InliningConstraints tyname name uni fun => Term tyname name uni fun ann -> InlineM tyname name uni fun ann Bool # Check if term is pure. See Note [Inlining and purity] isFirstVarBeforeEffects :: forall tyname name uni fun ann. InliningConstraints tyname name uni fun => name -> Term tyname name uni fun ann -> InlineM tyname name uni fun ann Bool # isTermBindingPure :: forall tyname name uni fun ann. InliningConstraints tyname name uni fun => Strictness -> Term tyname name uni fun ann -> InlineM tyname name uni fun ann Bool # Checks if a binding is pure, i.e. will evaluating it have effects nameUsedAtMostOnce :: forall tyname name uni fun ann. InliningConstraints tyname name uni fun => name -> InlineM tyname name uni fun ann Bool # Arguments
costIsAcceptable :: Term tyname name uni fun ann -> Bool # Is the cost increase (in terms of evaluation work) of inlining a variable whose RHS is the given term acceptable? sizeIsAcceptable :: Bool -> Term tyname name uni fun ann -> Bool # Is the size increase (in the AST) of inlining a variable whose RHS is the given term acceptable? trivialType :: Type tyname uni ann -> Bool # Is this an utterly trivial type which might as well be inlined? Arguments
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||