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

Safe Haskell | None
Language | GHC2021

Futhark.IR.Rep

Description

The core Futhark AST is parameterised by a `rep` type parameter, which is then used to invoke the type families defined here.

Synopsis

- class (Show (LetDec l), Show (ExpDec l), Show (BodyDec l), Show (FParamInfo l), Show (LParamInfo l), Show (RetType l), Show (BranchType l), Show (Op l), Eq (LetDec l), Eq (ExpDec l), Eq (BodyDec l), Eq (FParamInfo l), Eq (LParamInfo l), Eq (RetType l), Eq (BranchType l), Eq (Op l), Ord (LetDec l), Ord (ExpDec l), Ord (BodyDec l), Ord (FParamInfo l), Ord (LParamInfo l), Ord (RetType l), Ord (BranchType l), Ord (Op l), IsRetType (RetType l), IsBodyType (BranchType l), Typed (FParamInfo l), Typed (LParamInfo l), Typed (LetDec l), DeclTyped (FParamInfo l)) => RepTypes l where
  - type LetDec l
  - type ExpDec l
  - type BodyDec l
  - type FParamInfo l
  - type LParamInfo l
  - type RetType l
  - type BranchType l
  - type OpC l :: Type -> Type
- type Op l = OpC l l
- data NoOp (rep :: k) = NoOp
- module Futhark.IR.RetType

# Documentation

class (Show (LetDec l), Show (ExpDec l), Show (BodyDec l), Show (FParamInfo l), Show (LParamInfo l), Show (RetType l), Show (BranchType l), Show (Op l), Eq (LetDec l), Eq (ExpDec l), Eq (BodyDec l), Eq (FParamInfo l), Eq (LParamInfo l), Eq (RetType l), Eq (BranchType l), Eq (Op l), Ord (LetDec l), Ord (ExpDec l), Ord (BodyDec l), Ord (FParamInfo l), Ord (LParamInfo l), Ord (RetType l), Ord (BranchType l), Ord (Op l), IsRetType (RetType l), IsBodyType (BranchType l), Typed (FParamInfo l), Typed (LParamInfo l), Typed (LetDec l), DeclTyped (FParamInfo l)) => RepTypes l Source #

A collection of type families giving various common types for a representation, along with constraints specifying that the types they map to should satisfy some minimal requirements.

Associated Types

type LetDec l Source #

Decoration for every let-pattern element.

type LetDec l = Type

type ExpDec l Source #

Decoration for every expression.

type ExpDec l = ()

type BodyDec l Source #

Decoration for every body.

type BodyDec l = ()

type FParamInfo l Source #

Decoration for every (non-lambda) function parameter.

type FParamInfo l = DeclType

type LParamInfo l Source #

Decoration for every lambda function parameter.

type LParamInfo l = Type

type RetType l Source #

The return type decoration of function calls.

type RetType l = DeclExtType

type BranchType l Source #

The return type decoration of branches.

type BranchType l = ExtType

type OpC l :: Type -> Type Source #

Type constructor for the extensible operation. The somewhat funky definition is to ensure that we can change the "inner" representation in a generic way (e.g. add aliasing information) In most code, you will use the `Op` alias instead.

type OpC l = NoOp :: Type -> Type

#### Instances

Instances details

RepTypes GPU Source # |

Instance details

Defined in Futhark.IR.GPU

Associated Types

type LetDec GPU |
Instance details Defined in Futhark.IR.GPU type LetDec GPU = Type
type ExpDec GPU |
Instance details Defined in Futhark.IR.GPU type ExpDec GPU = ()
type BodyDec GPU |
Instance details Defined in Futhark.IR.GPU type BodyDec GPU = ()
type FParamInfo GPU |
Instance details Defined in Futhark.IR.GPU type FParamInfo GPU = DeclType
type LParamInfo GPU |
Instance details Defined in Futhark.IR.GPU type LParamInfo GPU = Type
type RetType GPU |
Instance details Defined in Futhark.IR.GPU type RetType GPU = DeclExtType
type BranchType GPU |
Instance details Defined in Futhark.IR.GPU type BranchType GPU = ExtType
type OpC GPU |
Instance details Defined in Futhark.IR.GPU type OpC GPU = HostOp SOAC

RepTypes GPUMem Source # |

Instance details

Defined in Futhark.IR.GPUMem

Associated Types

type LetDec GPUMem |
Instance details Defined in Futhark.IR.GPUMem type LetDec GPUMem = LetDecMem
type ExpDec GPUMem |
Instance details Defined in Futhark.IR.GPUMem type ExpDec GPUMem = ()
type BodyDec GPUMem |
Instance details Defined in Futhark.IR.GPUMem type BodyDec GPUMem = ()
type FParamInfo GPUMem |
Instance details Defined in Futhark.IR.GPUMem type FParamInfo GPUMem = FParamMem
type LParamInfo GPUMem |
Instance details Defined in Futhark.IR.GPUMem type LParamInfo GPUMem = LParamMem
type RetType GPUMem |
Instance details Defined in Futhark.IR.GPUMem type RetType GPUMem = RetTypeMem
type BranchType GPUMem |
Instance details Defined in Futhark.IR.GPUMem type BranchType GPUMem = BranchTypeMem
type OpC GPUMem |
Instance details Defined in Futhark.IR.GPUMem type OpC GPUMem = MemOp (HostOp (NoOp :: Type -> Type))

RepTypes MC Source # |

Instance details

Defined in Futhark.IR.MC

Associated Types

type LetDec MC |
Instance details Defined in Futhark.IR.MC type LetDec MC = Type
type ExpDec MC |
Instance details Defined in Futhark.IR.MC type ExpDec MC = ()
type BodyDec MC |
Instance details Defined in Futhark.IR.MC type BodyDec MC = ()
type FParamInfo MC |
Instance details Defined in Futhark.IR.MC type FParamInfo MC = DeclType
type LParamInfo MC |
Instance details Defined in Futhark.IR.MC type LParamInfo MC = Type
type RetType MC |
Instance details Defined in Futhark.IR.MC type RetType MC = DeclExtType
type BranchType MC |
Instance details Defined in Futhark.IR.MC type BranchType MC = ExtType
type OpC MC |
Instance details Defined in Futhark.IR.MC type OpC MC = MCOp SOAC

RepTypes MCMem Source # |

Instance details

Defined in Futhark.IR.MCMem

Associated Types

type LetDec MCMem |
Instance details Defined in Futhark.IR.MCMem type LetDec MCMem = LetDecMem
type ExpDec MCMem |
Instance details Defined in Futhark.IR.MCMem type ExpDec MCMem = ()
type BodyDec MCMem |
Instance details Defined in Futhark.IR.MCMem type BodyDec MCMem = ()
type FParamInfo MCMem |
Instance details Defined in Futhark.IR.MCMem type FParamInfo MCMem = FParamMem
type LParamInfo MCMem |
Instance details Defined in Futhark.IR.MCMem type LParamInfo MCMem = LParamMem
type RetType MCMem |
Instance details Defined in Futhark.IR.MCMem type RetType MCMem = RetTypeMem
type BranchType MCMem |
Instance details Defined in Futhark.IR.MCMem type BranchType MCMem = BranchTypeMem
type OpC MCMem |
Instance details Defined in Futhark.IR.MCMem type OpC MCMem = MemOp (MCOp (NoOp :: Type -> Type))

RepTypes SOACS Source # |

Instance details

Defined in Futhark.IR.SOACS

Associated Types

type LetDec SOACS |
Instance details Defined in Futhark.IR.SOACS type LetDec SOACS = Type
type ExpDec SOACS |
Instance details Defined in Futhark.IR.SOACS type ExpDec SOACS = ()
type BodyDec SOACS |
Instance details Defined in Futhark.IR.SOACS type BodyDec SOACS = ()
type FParamInfo SOACS |
Instance details Defined in Futhark.IR.SOACS type FParamInfo SOACS = DeclType
type LParamInfo SOACS |
Instance details Defined in Futhark.IR.SOACS type LParamInfo SOACS = Type
type RetType SOACS |
Instance details Defined in Futhark.IR.SOACS type RetType SOACS = DeclExtType
type BranchType SOACS |
Instance details Defined in Futhark.IR.SOACS type BranchType SOACS = ExtType
type OpC SOACS |
Instance details Defined in Futhark.IR.SOACS type OpC SOACS = SOAC

RepTypes Seq Source # |

Instance details

Defined in Futhark.IR.Seq

Associated Types

type LetDec Seq |
Instance details Defined in Futhark.IR.Seq type LetDec Seq = Type
type ExpDec Seq |
Instance details Defined in Futhark.IR.Seq type ExpDec Seq = ()
type BodyDec Seq |
Instance details Defined in Futhark.IR.Seq type BodyDec Seq = ()
type FParamInfo Seq |
Instance details Defined in Futhark.IR.Seq type FParamInfo Seq = DeclType
type LParamInfo Seq |
Instance details Defined in Futhark.IR.Seq type LParamInfo Seq = Type
type RetType Seq |
Instance details Defined in Futhark.IR.Seq type RetType Seq = DeclExtType
type BranchType Seq |
Instance details Defined in Futhark.IR.Seq type BranchType Seq = ExtType
type OpC Seq |
Instance details Defined in Futhark.IR.Seq type OpC Seq = NoOp :: Type -> Type

RepTypes SeqMem Source # |

Instance details

Defined in Futhark.IR.SeqMem

Associated Types

type LetDec SeqMem |
Instance details Defined in Futhark.IR.SeqMem type LetDec SeqMem = LetDecMem
type ExpDec SeqMem |
Instance details Defined in Futhark.IR.SeqMem type ExpDec SeqMem = ()
type BodyDec SeqMem |
Instance details Defined in Futhark.IR.SeqMem type BodyDec SeqMem = ()
type FParamInfo SeqMem |
Instance details Defined in Futhark.IR.SeqMem type FParamInfo SeqMem = FParamMem
type LParamInfo SeqMem |
Instance details Defined in Futhark.IR.SeqMem type LParamInfo SeqMem = LParamMem
type RetType SeqMem |
Instance details Defined in Futhark.IR.SeqMem type RetType SeqMem = RetTypeMem
type BranchType SeqMem |
Instance details Defined in Futhark.IR.SeqMem type BranchType SeqMem = BranchTypeMem
type OpC SeqMem |
Instance details Defined in Futhark.IR.SeqMem type OpC SeqMem = MemOp (NoOp :: Type -> Type)

(RepTypes rep, ASTConstraints (OpC rep (Aliases rep))) => RepTypes (Aliases rep) Source # |

Instance details

Defined in Futhark.IR.Aliases

Associated Types

type LetDec (Aliases rep) |
Instance details Defined in Futhark.IR.Aliases type LetDec (Aliases rep) = (VarAliases, LetDec rep)
type ExpDec (Aliases rep) |
Instance details Defined in Futhark.IR.Aliases type ExpDec (Aliases rep) = (ConsumedInExp, ExpDec rep)
type BodyDec (Aliases rep) |
Instance details Defined in Futhark.IR.Aliases type BodyDec (Aliases rep) = (BodyAliasing, BodyDec rep)
type FParamInfo (Aliases rep) |
Instance details Defined in Futhark.IR.Aliases type FParamInfo (Aliases rep) = FParamInfo rep
type LParamInfo (Aliases rep) |
Instance details Defined in Futhark.IR.Aliases type LParamInfo (Aliases rep) = LParamInfo rep
type RetType (Aliases rep) |
Instance details Defined in Futhark.IR.Aliases type RetType (Aliases rep) = RetType rep
type BranchType (Aliases rep) |
Instance details Defined in Futhark.IR.Aliases type BranchType (Aliases rep) = BranchType rep
type OpC (Aliases rep) |
Instance details Defined in Futhark.IR.Aliases type OpC (Aliases rep) = OpC rep

(Informing rep, Ord (OpC rep (Wise rep)), Eq (OpC rep (Wise rep)), Show (OpC rep (Wise rep)), IsOp (OpC rep), Pretty (OpC rep (Wise rep))) => RepTypes (Wise rep) Source # |

Instance details

Defined in Futhark.Optimise.Simplify.Rep

Associated Types

type LetDec (Wise rep) |
Instance details Defined in Futhark.Optimise.Simplify.Rep type LetDec (Wise rep) = (VarWisdom, LetDec rep)
type ExpDec (Wise rep) |
Instance details Defined in Futhark.Optimise.Simplify.Rep type ExpDec (Wise rep) = (ExpWisdom, ExpDec rep)
type BodyDec (Wise rep) |
Instance details Defined in Futhark.Optimise.Simplify.Rep type BodyDec (Wise rep)
type FParamInfo (Wise rep) |
Instance details Defined in Futhark.Optimise.Simplify.Rep type FParamInfo (Wise rep) = FParamInfo rep
type LParamInfo (Wise rep) |
Instance details Defined in Futhark.Optimise.Simplify.Rep type LParamInfo (Wise rep) = LParamInfo rep
type RetType (Wise rep) |
Instance details Defined in Futhark.Optimise.Simplify.Rep type RetType (Wise rep) = RetType rep
type BranchType (Wise rep) |
Instance details Defined in Futhark.Optimise.Simplify.Rep type BranchType (Wise rep) = BranchType rep
type OpC (Wise rep) |
Instance details Defined in Futhark.Optimise.Simplify.Rep type OpC (Wise rep) = OpC rep

type Op l = OpC l l Source #

Apply the `OpC` constructor of a representation to that representation.

data NoOp (rep :: k) Source #

Returns nothing and does nothing. Placeholder for when we don't really want an operation.

Constructors

NoOp |

#### Instances

Instances details

CanBeAliased (NoOp :: Type -> Type) Source # |
Instance details Defined in Futhark.IR.Aliases Methods addOpAliases :: AliasableRep rep => AliasTable -> NoOp rep -> NoOp (Aliases rep) Source #
OpReturns (HostOp (NoOp :: Type -> Type)) Source # |
Instance details Defined in Futhark.IR.GPU.Op Methods opReturns :: forall rep (inner :: Type -> Type) m. (Mem rep inner, Monad m, HasScope rep m) => HostOp (NoOp :: Type -> Type) rep -> m [ExpReturns] Source #
OpReturns (MCOp (NoOp :: Type -> Type)) Source # |
Instance details Defined in Futhark.IR.MC.Op Methods opReturns :: forall rep (inner :: Type -> Type) m. (Mem rep inner, Monad m, HasScope rep m) => MCOp (NoOp :: Type -> Type) rep -> m [ExpReturns] Source #
OpReturns (NoOp :: Type -> Type) Source # |
Instance details Defined in Futhark.IR.Mem Methods opReturns :: forall rep (inner :: Type -> Type) m. (Mem rep inner, Monad m, HasScope rep m) => NoOp rep -> m [ExpReturns] Source #
IsOp (NoOp :: Type -> Type) Source # |
Instance details Defined in Futhark.IR.Prop Methods safeOp :: ASTRep rep => NoOp rep -> Bool Source # cheapOp :: ASTRep rep => NoOp rep -> Bool Source # opDependencies :: ASTRep rep => NoOp rep -> [Names] Source #
AliasedOp (NoOp :: Type -> Type) Source # |
Instance details Defined in Futhark.IR.Prop.Aliases Methods opAliases :: Aliased rep => NoOp rep -> [Names] Source # consumedInOp :: Aliased rep => NoOp rep -> Names Source #
TypedOp (NoOp :: Type -> Type) Source # |
Instance details Defined in Futhark.IR.Prop.TypeOf Methods opType :: HasScope rep m => NoOp rep -> m [ExtType] Source #
RephraseOp (NoOp :: Type -> Type) Source # |
Instance details Defined in Futhark.IR.Rephrase Methods rephraseInOp :: Monad m => Rephraser m from to -> NoOp from -> m (NoOp to) Source #
CanBeWise (NoOp :: Type -> Type) Source # |
Instance details Defined in Futhark.Optimise.Simplify.Rep Methods addOpWisdom :: Informing rep => NoOp rep -> NoOp (Wise rep) Source #
OpMetrics (NoOp rep) Source # |
Instance details Defined in Futhark.Analysis.Metrics Methods opMetrics :: NoOp rep -> MetricsM () Source #
IndexOp (NoOp rep) Source # |
Instance details Defined in Futhark.Analysis.SymbolTable Methods indexOp :: (ASTRep rep0, IndexOp (Op rep0)) => SymbolTable rep0 -> Int -> NoOp rep -> [TPrimExp Int64 VName] -> Maybe Indexed Source #
FreeIn (NoOp rep) Source # |
Instance details Defined in Futhark.IR.Prop.Names Methods freeIn' :: NoOp rep -> FV Source #
TopDownHelper (HostOp (NoOp :: Type -> Type) (Aliases GPUMem)) Source # |
Instance details Defined in Futhark.Optimise.ArrayShortCircuiting.TopdownAnalysis Methods innerNonNegatives :: [VName] -> HostOp (NoOp :: Type -> Type) (Aliases GPUMem) -> Names innerKnownLessThan :: HostOp (NoOp :: Type -> Type) (Aliases GPUMem) -> [(VName, PrimExp VName)] scopeHelper :: HostOp (NoOp :: Type -> Type) (Aliases GPUMem) -> Scope rep
TopDownHelper (NoOp rep) Source # |
Instance details Defined in Futhark.Optimise.ArrayShortCircuiting.TopdownAnalysis Methods innerNonNegatives :: [VName] -> NoOp rep -> Names innerKnownLessThan :: NoOp rep -> [(VName, PrimExp VName)] scopeHelper :: NoOp rep -> Scope rep0
CSEInOp (NoOp rep) Source # |
Instance details Defined in Futhark.Optimise.CSE Methods cseInOp :: NoOp rep -> CSEM rep0 (NoOp rep)
SizeSubst (NoOp rep) Source # |
Instance details Defined in Futhark.Pass.ExplicitAllocations Methods opIsConst :: NoOp rep -> Bool Source #
Rename (NoOp rep) Source # |
Instance details Defined in Futhark.Transform.Rename Methods rename :: NoOp rep -> RenameM (NoOp rep) Source #
Substitute (NoOp rep) Source # |
Instance details Defined in Futhark.Transform.Substitute Methods substituteNames :: Map VName VName -> NoOp rep -> NoOp rep Source #
Show (NoOp rep) Source # |
Instance details Defined in Futhark.IR.Rep Methods showsPrec :: Int -> NoOp rep -> ShowS Source # show :: NoOp rep -> String Source # showList :: [NoOp rep] -> ShowS Source #
Eq (NoOp rep) Source # |
Instance details Defined in Futhark.IR.Rep Methods (==) :: NoOp rep -> NoOp rep -> Bool Source # (/=) :: NoOp rep -> NoOp rep -> Bool Source #
Ord (NoOp rep) Source # |
Instance details Defined in Futhark.IR.Rep Methods compare :: NoOp rep -> NoOp rep -> Ordering Source # (<) :: NoOp rep -> NoOp rep -> Bool Source # (<=) :: NoOp rep -> NoOp rep -> Bool Source # (>) :: NoOp rep -> NoOp rep -> Bool Source # (>=) :: NoOp rep -> NoOp rep -> Bool Source # max :: NoOp rep -> NoOp rep -> NoOp rep Source # min :: NoOp rep -> NoOp rep -> NoOp rep Source #
Pretty (NoOp rep) Source # |
Instance details Defined in Futhark.IR.Pretty Methods pretty :: NoOp rep -> Doc ann Source # prettyList :: [NoOp rep] -> Doc ann Source #

module Futhark.IR.RetType