Vectorise.Utils

ghc-8.2.2: The GHC API

Safe Haskell | None
Language | Haskell2010

Vectorise.Utils

Contents

- Annotated Exprs
- PD Functions
- Scalars
- Naming

Synopsis

- module Vectorise.Utils.Base
- module Vectorise.Utils.Closure
- module Vectorise.Utils.Hoisting
- module Vectorise.Utils.PADict
- module Vectorise.Utils.Poly
- collectAnnTypeArgs :: AnnExpr b ann -> (AnnExpr b ann, [Type])
- collectAnnDictArgs :: AnnExpr Var ann -> (AnnExpr Var ann, [AnnExpr Var ann])
- collectAnnTypeBinders :: AnnExpr Var ann -> ([Var], AnnExpr Var ann)
- collectAnnValBinders :: AnnExpr Var ann -> ([Var], AnnExpr Var ann)
- isAnnTypeArg :: AnnExpr b ann -> Bool
- replicatePD :: CoreExpr -> CoreExpr -> VM CoreExpr
- emptyPD :: Type -> VM CoreExpr
- packByTagPD :: Type -> CoreExpr -> CoreExpr -> CoreExpr -> CoreExpr -> VM CoreExpr
- combinePD :: Type -> CoreExpr -> CoreExpr -> [CoreExpr] -> VM CoreExpr
- liftPD :: CoreExpr -> VM CoreExpr
- isScalar :: Type -> VM Bool
- zipScalars :: [Type] -> Type -> VM CoreExpr
- scalarClosure :: [Type] -> Type -> CoreExpr -> CoreExpr -> VM CoreExpr
- newLocalVar :: FastString -> Type -> VM Var

# Documentation

module Vectorise.Utils.Base

module Vectorise.Utils.Closure

module Vectorise.Utils.Hoisting

module Vectorise.Utils.PADict

module Vectorise.Utils.Poly

# Annotated Exprs

collectAnnTypeArgs :: AnnExpr b ann -> (AnnExpr b ann, [Type]) Source #

collectAnnDictArgs :: AnnExpr Var ann -> (AnnExpr Var ann, [AnnExpr Var ann]) Source #

collectAnnTypeBinders :: AnnExpr Var ann -> ([Var], AnnExpr Var ann) Source #

collectAnnValBinders :: AnnExpr Var ann -> ([Var], AnnExpr Var ann) Source #

Collect all consecutive value binders that are not dictionaries.

isAnnTypeArg :: AnnExpr b ann -> Bool Source #

# PD Functions

replicatePD Source #

Arguments

:: CoreExpr | Number of copies in the resulting array.
-> CoreExpr | Value to replicate.
-> VM CoreExpr |

Produce an array containing copies of a given element.

emptyPD :: Type -> VM CoreExpr Source #

An empty array of the given type.

packByTagPD Source #

Arguments

:: Type | Element type.
-> CoreExpr | Source array.
-> CoreExpr | Length of resulting array.
-> CoreExpr | Tag values of elements in source array.
-> CoreExpr | The tag value for the elements to select.
-> VM CoreExpr |

Select some elements from an array that correspond to a particular tag value and pack them into a new array.

    packByTagPD Int# [:23, 42, 95, 50, 27, 49:]  3 [:1, 2, 1, 2, 3, 2:] 2
      ==> [:42, 50, 49:]

combinePD Source #

Arguments

:: Type | Element type
-> CoreExpr | Length of resulting array
-> CoreExpr | Selector.
-> [CoreExpr] | Arrays to combine.
-> VM CoreExpr |

Combine some arrays based on a selector. The selector says which source array to choose for each element of the resulting array.

liftPD :: CoreExpr -> VM CoreExpr Source #

Like `replicatePD` but use the lifting context in the vectoriser state.

# Scalars

isScalar :: Type -> VM Bool Source #

zipScalars :: [Type] -> Type -> VM CoreExpr Source #

scalarClosure :: [Type] -> Type -> CoreExpr -> CoreExpr -> VM CoreExpr Source #

# Naming

newLocalVar :: FastString -> Type -> VM Var Source #

Make a fresh local variable with the given type. The variable's name is formed using the given string as the prefix.