ghc-7.2.1: The GHC API

Vectorise.Monad.Global

Contents

Synopsis

Documentation

readGEnv :: (GlobalEnv -> a) -> VM a

Project something from the global environment.

setGEnv :: GlobalEnv -> VM ()

Set the value of the global environment.

updGEnv :: (GlobalEnv -> GlobalEnv) -> VM ()

Update the global environment using the provided function.

Vars

defGlobalVar :: Var -> Var -> VM ()

Add a mapping between a global var and its vectorised version to the state.

Vectorisation declarations

lookupVectDecl :: Var -> VM (Maybe (Type, CoreExpr))

Check whether a variable has a (non-scalar) vectorisation declaration.

noVectDecl :: Var -> VM Bool

Check whether a variable has a NOVECTORISE declaration.

Scalars

globalScalars :: VM VarSet

Get the set of global scalar variables.

isGlobalScalar :: Var -> VM Bool

Check whether a given variable is in the set of global scalar variables.

TyCons

lookupTyCon :: TyCon -> VM (Maybe TyCon)

Lookup the vectorised version of a TyCon from the global environment.

lookupBoxedTyCon :: TyCon -> VM (Maybe TyCon)

Lookup the vectorised version of a boxed TyCon from the global environment.

defTyCon :: TyCon -> TyCon -> VM ()

Add a mapping between plain and vectorised TyCons to the global environment.

Datacons

lookupDataCon :: DataCon -> VM (Maybe DataCon)

Lookup the vectorised version of a DataCon from the global environment.

defDataCon :: DataCon -> DataCon -> VM ()

Add the mapping between plain and vectorised DataCons to the global environment.

PA Dictionaries

lookupTyConPA :: TyCon -> VM (Maybe Var)

Lookup a PA TyCon from the global environment.

defTyConPA :: TyCon -> Var -> VM ()

Add a mapping between a PA TyCon and is vectorised version to the global environment.

defTyConPAs :: [(TyCon, Var)] -> VM ()

Add several mapping between PA TyCons and their vectorised versions to the global environment.

PR Dictionaries