Vectorise.Utils.Hoisting

ghc-8.0.0.20160421: The GHC API

Safe Haskell | None
Language | Haskell2010

Vectorise.Utils.Hoisting

Synopsis

- data Inline
  - = Inline Arity
  - | DontInline
- addInlineArity :: Inline -> Int -> Inline
- inlineMe :: Inline
- hoistBinding :: Var -> CoreExpr -> VM ()
- hoistExpr :: FastString -> CoreExpr -> Inline -> VM Var
- hoistVExpr :: VExpr -> Inline -> VM VVar
- hoistPolyVExpr :: [TyVar] -> [Var] -> Inline -> VM VExpr -> VM VExpr
- takeHoisted :: VM [(Var, CoreExpr)]

# Documentation

data Inline Source #

Records whether we should inline a particular binding.

Constructors

Inline Arity |
DontInline |

addInlineArity :: Inline -> Int -> Inline Source #

Add to the arity contained within an `Inline`, if any.

inlineMe :: Inline Source #

Says to always inline a binding.

hoistBinding :: Var -> CoreExpr -> VM () Source #

hoistExpr :: FastString -> CoreExpr -> Inline -> VM Var Source #

hoistVExpr :: VExpr -> Inline -> VM VVar Source #

hoistPolyVExpr :: [TyVar] -> [Var] -> Inline -> VM VExpr -> VM VExpr Source #

Hoist a polymorphic vectorised expression into a new top-level binding (representing a closure function).

The hoisted expression is parameterised by (1) a set of type variables and (2) a set of value variables that are passed as conventional type and value arguments. The latter is implicitly extended by the set of `PA` dictionaries required for the type variables.

takeHoisted :: VM [(Var, CoreExpr)] Source #