futhark-0.9.1: An optimising compiler for a functional, array-oriented language.

Safe HaskellNone
LanguageHaskell2010

Futhark.Representation.Aliases

Contents

Description

A representation where all bindings are annotated with aliasing information.

Synopsis

The Lore definition

data Aliases lore Source #

The lore for the basic representation.

Instances
(Annotations lore, CanBeAliased (Op lore)) => Annotations (Aliases lore) Source # 
Instance details

Defined in Futhark.Representation.Aliases

Associated Types

type LetAttr (Aliases lore) :: Type Source #

type ExpAttr (Aliases lore) :: Type Source #

type BodyAttr (Aliases lore) :: Type Source #

type FParamAttr (Aliases lore) :: Type Source #

type LParamAttr (Aliases lore) :: Type Source #

type RetType (Aliases lore) :: Type Source #

type BranchType (Aliases lore) :: Type Source #

type Op (Aliases lore) :: Type Source #

(Attributes lore, CanBeAliased (Op lore)) => PrettyLore (Aliases lore) Source # 
Instance details

Defined in Futhark.Representation.Aliases

Methods

ppExpLore :: ExpAttr (Aliases lore) -> Exp (Aliases lore) -> Maybe Doc Source #

(Attributes lore, CanBeAliased (Op lore)) => Attributes (Aliases lore) Source # 
Instance details

Defined in Futhark.Representation.Aliases

Methods

expTypesFromPattern :: (HasScope (Aliases lore) m, Monad m) => Pattern (Aliases lore) -> m [BranchType (Aliases lore)] Source #

(Attributes lore, CanBeAliased (Op lore)) => Aliased (Aliases lore) Source # 
Instance details

Defined in Futhark.Representation.Aliases

(Bindable lore, CanBeAliased (Op lore)) => Bindable (Aliases lore) Source # 
Instance details

Defined in Futhark.Representation.Aliases

Methods

mkExpPat :: [Ident] -> [Ident] -> Exp (Aliases lore) -> Pattern (Aliases lore) Source #

mkExpAttr :: Pattern (Aliases lore) -> Exp (Aliases lore) -> ExpAttr (Aliases lore) Source #

mkBody :: Stms (Aliases lore) -> Result -> Body (Aliases lore) Source #

mkLetNames :: (MonadFreshNames m, HasScope (Aliases lore) m) => [VName] -> Exp (Aliases lore) -> m (Stm (Aliases lore)) Source #

(Attributes (Aliases lore), Bindable (Aliases lore)) => BinderOps (Aliases lore) Source # 
Instance details

Defined in Futhark.Representation.Aliases

Methods

mkExpAttrB :: (MonadBinder m, Lore m ~ Aliases lore) => Pattern (Aliases lore) -> Exp (Aliases lore) -> m (ExpAttr (Aliases lore)) Source #

mkBodyB :: (MonadBinder m, Lore m ~ Aliases lore) => Stms (Aliases lore) -> Result -> m (Body (Aliases lore)) Source #

mkLetNamesB :: (MonadBinder m, Lore m ~ Aliases lore) => [VName] -> Exp (Aliases lore) -> m (Stm (Aliases lore)) Source #

(Attributes lore, CanBeAliased (Op lore), CSEInOp (OpWithAliases (Op lore))) => CSEInOp (SOAC (Aliases lore)) Source # 
Instance details

Defined in Futhark.Optimise.CSE

Methods

cseInOp :: SOAC (Aliases lore) -> CSEM lore0 (SOAC (Aliases lore))

Checkable lore => HasScope (Aliases lore) (TypeM lore) Source # 
Instance details

Defined in Futhark.TypeCheck

Methods

lookupType :: VName -> TypeM lore Type Source #

lookupInfo :: VName -> TypeM lore (NameInfo (Aliases lore)) Source #

askScope :: TypeM lore (Scope (Aliases lore)) Source #

asksScope :: (Scope (Aliases lore) -> a) -> TypeM lore a Source #

type LetAttr (Aliases lore) Source # 
Instance details

Defined in Futhark.Representation.Aliases

type LetAttr (Aliases lore) = (VarAliases, LetAttr lore)
type ExpAttr (Aliases lore) Source # 
Instance details

Defined in Futhark.Representation.Aliases

type ExpAttr (Aliases lore) = (ConsumedInExp, ExpAttr lore)
type BodyAttr (Aliases lore) Source # 
Instance details

Defined in Futhark.Representation.Aliases

type BodyAttr (Aliases lore) = (BodyAliasing, BodyAttr lore)
type FParamAttr (Aliases lore) Source # 
Instance details

Defined in Futhark.Representation.Aliases

type FParamAttr (Aliases lore) = FParamAttr lore
type LParamAttr (Aliases lore) Source # 
Instance details

Defined in Futhark.Representation.Aliases

type LParamAttr (Aliases lore) = LParamAttr lore
type RetType (Aliases lore) Source # 
Instance details

Defined in Futhark.Representation.Aliases

type RetType (Aliases lore) = RetType lore
type BranchType (Aliases lore) Source # 
Instance details

Defined in Futhark.Representation.Aliases

type BranchType (Aliases lore) = BranchType lore
type Op (Aliases lore) Source # 
Instance details

Defined in Futhark.Representation.Aliases

type Op (Aliases lore) = OpWithAliases (Op lore)

newtype Names' Source #

A wrapper around Names to get around the fact that we need an Ord instance, which Names does not have.

Constructors

Names' 

Fields

Instances
Eq Names' Source # 
Instance details

Defined in Futhark.Representation.Aliases

Methods

(==) :: Names' -> Names' -> Bool #

(/=) :: Names' -> Names' -> Bool #

Ord Names' Source # 
Instance details

Defined in Futhark.Representation.Aliases

Show Names' Source # 
Instance details

Defined in Futhark.Representation.Aliases

Semigroup Names' Source # 
Instance details

Defined in Futhark.Representation.Aliases

Monoid Names' Source # 
Instance details

Defined in Futhark.Representation.Aliases

Pretty Names' Source # 
Instance details

Defined in Futhark.Representation.Aliases

Methods

ppr :: Names' -> Doc #

pprPrec :: Int -> Names' -> Doc #

pprList :: [Names'] -> Doc #

FreeAttr Names' Source # 
Instance details

Defined in Futhark.Representation.Aliases

FreeIn Names' Source # 
Instance details

Defined in Futhark.Representation.Aliases

Methods

freeIn :: Names' -> Names Source #

Substitute Names' Source # 
Instance details

Defined in Futhark.Representation.Aliases

Rename Names' Source # 
Instance details

Defined in Futhark.Representation.Aliases

PrettyAnnot (PatElemT attr) => PrettyAnnot (PatElemT (VarAliases, attr)) Source # 
Instance details

Defined in Futhark.Representation.Aliases

Methods

ppAnnot :: PatElemT (VarAliases, attr) -> Maybe Doc Source #

AliasesOf (VarAliases, attr) Source # 
Instance details

Defined in Futhark.Representation.Aliases

Methods

aliasesOf :: (VarAliases, attr) -> Names Source #

type VarAliases = Names' Source #

The aliases of the let-bound variable.

type ConsumedInExp = Names' Source #

Everything consumed in the expression.

type BodyAliasing = ([VarAliases], ConsumedInExp) Source #

The aliases of what is returned by the BodyT, and what is consumed inside of it.

Module re-exports

Adding aliases

addAliasesToPattern :: (Attributes lore, CanBeAliased (Op lore), Typed attr) => PatternT attr -> Exp (Aliases lore) -> PatternT (VarAliases, attr) Source #

mkAliasedLetStm :: (Attributes lore, CanBeAliased (Op lore)) => Pattern lore -> StmAux (ExpAttr lore) -> Exp (Aliases lore) -> Stm (Aliases lore) Source #

mkAliasedBody :: (Attributes lore, CanBeAliased (Op lore)) => BodyAttr lore -> Stms (Aliases lore) -> Result -> Body (Aliases lore) Source #

mkPatternAliases :: (Attributes lore, Aliased lore, Typed attr) => PatternT attr -> Exp lore -> ([PatElemT (VarAliases, attr)], [PatElemT (VarAliases, attr)]) Source #

Removing aliases

removeExpAliases :: CanBeAliased (Op lore) => Exp (Aliases lore) -> Exp lore Source #

removeStmAliases :: CanBeAliased (Op lore) => Stm (Aliases lore) -> Stm lore Source #

Tracking aliases

consumedInStms :: Aliased lore => Stms lore -> [SubExp] -> Names Source #

Everything consumed in the given bindings and result (even transitively).