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

Safe Haskell | Safe-Inferred
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
  - type ExpDec l :: Type
  - type BodyDec l :: Type
  - type FParamInfo l :: Type
  - type LParamInfo l :: Type
  - type RetType l :: Type
  - type BranchType l :: Type
  - type OpC l :: Type -> Type
- type Op l = OpC l l
- data NoOp rep = 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 :: Type Source #

Decoration for every let-pattern element.

type LetDec l = Type

type ExpDec l :: Type Source #

Decoration for every expression.

type ExpDec l = ()

type BodyDec l :: Type Source #

Decoration for every body.

type BodyDec l = ()

type FParamInfo l :: Type Source #

Decoration for every (non-lambda) function parameter.

type FParamInfo l = DeclType

type LParamInfo l :: Type Source #

Decoration for every lambda function parameter.

type LParamInfo l = Type

type RetType l :: Type Source #

The return type decoration of function calls.

type RetType l = DeclExtType

type BranchType l :: Type 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

#### Instances

Instances details

RepTypes GPU Source # |
Instance details Defined in Futhark.IR.GPU Associated Types type LetDec GPU Source # type ExpDec GPU Source # type BodyDec GPU Source # type FParamInfo GPU Source # type LParamInfo GPU Source # type RetType GPU Source # type BranchType GPU Source # type OpC GPU :: Type -> Type Source #
RepTypes GPUMem Source # |
Instance details Defined in Futhark.IR.GPUMem Associated Types type LetDec GPUMem Source # type ExpDec GPUMem Source # type BodyDec GPUMem Source # type FParamInfo GPUMem Source # type LParamInfo GPUMem Source # type RetType GPUMem Source # type BranchType GPUMem Source # type OpC GPUMem :: Type -> Type Source #
RepTypes MC Source # |
Instance details Defined in Futhark.IR.MC Associated Types type LetDec MC Source # type ExpDec MC Source # type BodyDec MC Source # type FParamInfo MC Source # type LParamInfo MC Source # type RetType MC Source # type BranchType MC Source # type OpC MC :: Type -> Type Source #
RepTypes MCMem Source # |
Instance details Defined in Futhark.IR.MCMem Associated Types type LetDec MCMem Source # type ExpDec MCMem Source # type BodyDec MCMem Source # type FParamInfo MCMem Source # type LParamInfo MCMem Source # type RetType MCMem Source # type BranchType MCMem Source # type OpC MCMem :: Type -> Type Source #
RepTypes SOACS Source # |
Instance details Defined in Futhark.IR.SOACS Associated Types type LetDec SOACS Source # type ExpDec SOACS Source # type BodyDec SOACS Source # type FParamInfo SOACS Source # type LParamInfo SOACS Source # type RetType SOACS Source # type BranchType SOACS Source # type OpC SOACS :: Type -> Type Source #
RepTypes Seq Source # |
Instance details Defined in Futhark.IR.Seq Associated Types type LetDec Seq Source # type ExpDec Seq Source # type BodyDec Seq Source # type FParamInfo Seq Source # type LParamInfo Seq Source # type RetType Seq Source # type BranchType Seq Source # type OpC Seq :: Type -> Type Source #
RepTypes SeqMem Source # |
Instance details Defined in Futhark.IR.SeqMem Associated Types type LetDec SeqMem Source # type ExpDec SeqMem Source # type BodyDec SeqMem Source # type FParamInfo SeqMem Source # type LParamInfo SeqMem Source # type RetType SeqMem Source # type BranchType SeqMem Source # type OpC SeqMem :: Type -> Type Source #
(RepTypes rep, ASTConstraints (OpC rep (Aliases rep))) => RepTypes (Aliases rep) Source # |
Instance details Defined in Futhark.IR.Aliases Associated Types type LetDec (Aliases rep) Source # type ExpDec (Aliases rep) Source # type BodyDec (Aliases rep) Source # type FParamInfo (Aliases rep) Source # type LParamInfo (Aliases rep) Source # type RetType (Aliases rep) Source # type BranchType (Aliases rep) Source # type OpC (Aliases rep) :: Type -> Type Source #
(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) Source # type ExpDec (Wise rep) Source # type BodyDec (Wise rep) Source # type FParamInfo (Wise rep) Source # type LParamInfo (Wise rep) Source # type RetType (Wise rep) Source # type BranchType (Wise rep) Source # type OpC (Wise rep) :: Type -> Type Source #

type Op l = OpC l l Source #

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

data NoOp rep 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 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 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 #
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 #
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 (Aliases GPUMem) -> Names innerKnownLessThan :: HostOp NoOp (Aliases GPUMem) -> [(VName, PrimExp VName)] scopeHelper :: HostOp NoOp (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 #
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