ghc-7.7.20120902: The GHC API

Safe HaskellNone

Vectorise.Utils

Contents

Synopsis

Documentation

Annotated Exprs

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

Collect all consecutive value binders that are not dictionaries.

PD Functions

replicatePDSource

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 CoreExprSource

An empty array of the given type.

packByTagPDSource

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:]

combinePDSource

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 CoreExprSource

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

Scalars

Naming

newLocalVar :: FastString -> Type -> VM VarSource

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