futhark-0.17.1: An optimising compiler for a functional, array-oriented language.
Safe HaskellTrustworthy
LanguageHaskell2010

Futhark.IR.Syntax

Description

Definition of the Futhark core language IR

For actually constructing ASTs, see Futhark.Construct.

Types and values

The core language type system is much more restricted than the core language. This is a theme that repeats often. The only types that are supported in the core language are various primitive types PrimType which can be combined in arrays (ignore Mem for now). Types are represented as TypeBase, which is parameterised by the shape of the array and whether we keep uniqueness information. The Type alias, which is the most commonly used, uses Shape and NoUniqueness.

This means that the records, tuples, and sum types of the source language are represented merely as collections of primitives and arrays. This is implemented in Futhark.Internalise, but the specifics are not important for writing passes on the core language. What is important is that many constructs that conceptually return tuples instead return multiple values. This is not merely syntactic sugar for a tuple: each of those values are eventually bound to distinct variables. The prettyprinter for the IR will typically print such collections of values or types in curly braces.

The system of primitive types is interesting in itself. See Futhark.IR.Primitive.

Overall AST design

Internally, the Futhark compiler core intermediate representation resembles a traditional compiler for an imperative language more than it resembles, say, a Haskell or ML compiler. All functions are monomorphic (except for sizes), first-order, and defined at the top level. Notably, the IR does not use continuation-passing style (CPS) at any time. Instead it uses Administrative Normal Form (ANF), where all subexpressions SubExp are either constants PrimValue or variables VName. Variables are represented as a human-readable Name (which doesn't matter to the compiler) as well as a numeric tag, which is what the compiler actually looks at. All variable names when prettyprinted are of the form foo_123. Function names are just Names, though.

The body of a function (FunDef) is a Body, which consists of a sequence of statements (Stms) and a Result. Execution of a Body consists of executing all of the statements, then returning the values of the variables indicated by the result.

A statement (Stm) consists of a Pattern alongside an expression ExpT. A pattern contains a "context" part and a "value" part. The context is used for things like the size of arrays in the value part whose size is existential.

For example, the source language expression let z = x + y - 1 in z would in the core language be represented (in prettyprinted form) as something like:

let {a_12} = x_10 + y_11
let {b_13} = a_12 - 1
in {b_13}

Lores

Most AST types (Stm, ExpT, Prog, etc) are parameterised by a type parameter with the somewhat silly name lore. The lore specifies how to fill out various polymorphic parts of the AST. For example, ExpT has a constructor Op whose payload depends on lore, via the use of a type family called Op (a kind of type-level function) which is applied to the lore. The SOACS representation (Futhark.IR.SOACS) thus uses a lore called SOACS, and defines that Op SOACS is a SOAC, while the Kernels representation (Futhark.IR.Kernels) defines Op Kernels as some kind of kernel construct. Similarly, various other decorations (e.g. what information we store in a PatElemT) are also type families.

The full list of possible decorations is defined as part of the type class Decorations (although other type families are also used elsewhere in the compiler on an ad hoc basis).

Essentially, the lore type parameter functions as a kind of proxy, saving us from having to parameterise the AST type with all the different forms of decorations that we desire (it would easily become a type with a dozen type parameters).

Defining a new representation (or lore) thus requires you to define an empty datatype and implement a handful of type class instances for it. See the source of Futhark.IR.Seq for what is likely the simplest example.

Synopsis

Documentation

Types

data Uniqueness Source #

The uniqueness attribute of a type. This essentially indicates whether or not in-place modifications are acceptable. With respect to ordering, Unique is greater than Nonunique.

Constructors

Nonunique

May have references outside current function.

Unique

No references outside current function.

Instances

Instances details
Eq Uniqueness Source # 
Instance details

Defined in Language.Futhark.Core

Ord Uniqueness Source # 
Instance details

Defined in Language.Futhark.Core

Show Uniqueness Source # 
Instance details

Defined in Language.Futhark.Core

Generic Uniqueness Source # 
Instance details

Defined in Language.Futhark.Core

Associated Types

type Rep Uniqueness :: Type -> Type #

Semigroup Uniqueness Source # 
Instance details

Defined in Language.Futhark.Core

Monoid Uniqueness Source # 
Instance details

Defined in Language.Futhark.Core

Pretty Uniqueness Source # 
Instance details

Defined in Language.Futhark.Core

SexpIso Uniqueness Source # 
Instance details

Defined in Language.Futhark.Core

DeclExtTyped DeclExtType Source # 
Instance details

Defined in Futhark.IR.Prop.Types

DeclTyped DeclType Source # 
Instance details

Defined in Futhark.IR.Prop.Types

Typed DeclType Source # 
Instance details

Defined in Futhark.IR.Prop.Types

Methods

typeOf :: DeclType -> Type Source #

IsRetType DeclExtType Source # 
Instance details

Defined in Futhark.IR.RetType

IsRetType FunReturns Source # 
Instance details

Defined in Futhark.IR.Mem

Pretty (Param DeclType) Source # 
Instance details

Defined in Futhark.IR.Pretty

Pretty (Param (MemInfo SubExp Uniqueness ret)) Source # 
Instance details

Defined in Futhark.IR.Mem

Simplifiable [FunReturns] Source # 
Instance details

Defined in Futhark.IR.Mem

FixExt ret => DeclExtTyped (MemInfo ExtSize Uniqueness ret) Source # 
Instance details

Defined in Futhark.IR.Mem

DeclTyped (MemInfo SubExp Uniqueness ret) Source # 
Instance details

Defined in Futhark.IR.Mem

Typed (MemInfo SubExp Uniqueness ret) Source # 
Instance details

Defined in Futhark.IR.Mem

type Rep Uniqueness Source # 
Instance details

Defined in Language.Futhark.Core

type Rep Uniqueness = D1 ('MetaData "Uniqueness" "Language.Futhark.Core" "futhark-0.17.1-inplace" 'False) (C1 ('MetaCons "Nonunique" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "Unique" 'PrefixI 'False) (U1 :: Type -> Type))

data NoUniqueness Source #

A fancier name for () - encodes no uniqueness information.

Constructors

NoUniqueness 

Instances

Instances details
Eq NoUniqueness Source # 
Instance details

Defined in Futhark.IR.Syntax.Core

Ord NoUniqueness Source # 
Instance details

Defined in Futhark.IR.Syntax.Core

Show NoUniqueness Source # 
Instance details

Defined in Futhark.IR.Syntax.Core

Generic NoUniqueness Source # 
Instance details

Defined in Futhark.IR.Syntax.Core

Associated Types

type Rep NoUniqueness :: Type -> Type #

Pretty NoUniqueness Source # 
Instance details

Defined in Futhark.IR.Pretty

SexpIso NoUniqueness Source # 
Instance details

Defined in Futhark.IR.Syntax.Core

SetType Type Source # 
Instance details

Defined in Futhark.IR.Prop.Types

Methods

setType :: Type -> Type -> Type Source #

ExtTyped ExtType Source # 
Instance details

Defined in Futhark.IR.Prop.Types

Typed Type Source # 
Instance details

Defined in Futhark.IR.Prop.Types

Methods

typeOf :: Type -> Type Source #

IsBodyType ExtType Source # 
Instance details

Defined in Futhark.IR.RetType

IsBodyType BodyReturns Source # 
Instance details

Defined in Futhark.IR.Mem

Pretty (PatElemT Type) Source # 
Instance details

Defined in Futhark.IR.Pretty

Pretty (PatElemT (MemInfo SubExp NoUniqueness ret)) Source # 
Instance details

Defined in Futhark.IR.Mem

Pretty (Param Type) Source # 
Instance details

Defined in Futhark.IR.Pretty

Methods

ppr :: Param Type -> Doc #

pprPrec :: Int -> Param Type -> Doc #

pprList :: [Param Type] -> Doc #

Pretty (Param (MemInfo SubExp NoUniqueness ret)) Source # 
Instance details

Defined in Futhark.IR.Mem

FixExt ret => ExtTyped (MemInfo ExtSize NoUniqueness ret) Source # 
Instance details

Defined in Futhark.IR.Mem

Typed (MemInfo SubExp NoUniqueness ret) Source # 
Instance details

Defined in Futhark.IR.Mem

type Rep NoUniqueness Source # 
Instance details

Defined in Futhark.IR.Syntax.Core

type Rep NoUniqueness = D1 ('MetaData "NoUniqueness" "Futhark.IR.Syntax.Core" "futhark-0.17.1-inplace" 'False) (C1 ('MetaCons "NoUniqueness" 'PrefixI 'False) (U1 :: Type -> Type))

newtype Rank Source #

The size of an array type as merely the number of dimensions, with no further information.

Constructors

Rank Int 

Instances

Instances details
Eq Rank Source # 
Instance details

Defined in Futhark.IR.Syntax.Core

Methods

(==) :: Rank -> Rank -> Bool #

(/=) :: Rank -> Rank -> Bool #

Ord Rank Source # 
Instance details

Defined in Futhark.IR.Syntax.Core

Methods

compare :: Rank -> Rank -> Ordering #

(<) :: Rank -> Rank -> Bool #

(<=) :: Rank -> Rank -> Bool #

(>) :: Rank -> Rank -> Bool #

(>=) :: Rank -> Rank -> Bool #

max :: Rank -> Rank -> Rank #

min :: Rank -> Rank -> Rank #

Show Rank Source # 
Instance details

Defined in Futhark.IR.Syntax.Core

Methods

showsPrec :: Int -> Rank -> ShowS #

show :: Rank -> String #

showList :: [Rank] -> ShowS #

Generic Rank Source # 
Instance details

Defined in Futhark.IR.Syntax.Core

Associated Types

type Rep Rank :: Type -> Type #

Methods

from :: Rank -> Rep Rank x #

to :: Rep Rank x -> Rank #

Semigroup Rank Source # 
Instance details

Defined in Futhark.IR.Syntax.Core

Methods

(<>) :: Rank -> Rank -> Rank #

sconcat :: NonEmpty Rank -> Rank #

stimes :: Integral b => b -> Rank -> Rank #

Monoid Rank Source # 
Instance details

Defined in Futhark.IR.Syntax.Core

Methods

mempty :: Rank #

mappend :: Rank -> Rank -> Rank #

mconcat :: [Rank] -> Rank #

SexpIso Rank Source # 
Instance details

Defined in Futhark.IR.Syntax.Core

ArrayShape Rank Source # 
Instance details

Defined in Futhark.IR.Syntax.Core

Substitute Rank Source # 
Instance details

Defined in Futhark.Transform.Substitute

Rename Rank Source # 
Instance details

Defined in Futhark.Transform.Rename

Pretty u => Pretty (TypeBase Rank u) Source # 
Instance details

Defined in Futhark.IR.Pretty

Methods

ppr :: TypeBase Rank u -> Doc #

pprPrec :: Int -> TypeBase Rank u -> Doc #

pprList :: [TypeBase Rank u] -> Doc #

type Rep Rank Source # 
Instance details

Defined in Futhark.IR.Syntax.Core

type Rep Rank = D1 ('MetaData "Rank" "Futhark.IR.Syntax.Core" "futhark-0.17.1-inplace" 'True) (C1 ('MetaCons "Rank" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Int)))

class (Monoid a, Eq a, Ord a) => ArrayShape a where Source #

A class encompassing types containing array shape information.

Methods

shapeRank :: a -> Int Source #

Return the rank of an array with the given size.

stripDims :: Int -> a -> a Source #

stripDims n shape strips the outer n dimensions from shape.

subShapeOf :: a -> a -> Bool Source #

Check whether one shape if a subset of another shape.

data Space Source #

The memory space of a block. If DefaultSpace, this is the "default" space, whatever that is. The exact meaning of the SpaceId depends on the backend used. In GPU kernels, for example, this is used to distinguish between constant, global and shared memory spaces. In GPU-enabled host code, it is used to distinguish between host memory (DefaultSpace) and GPU space.

Constructors

DefaultSpace 
Space SpaceId 
ScalarSpace [SubExp] PrimType

A special kind of memory that is a statically sized array of some primitive type. Used for private memory on GPUs.

Instances

Instances details
Eq Space Source # 
Instance details

Defined in Futhark.IR.Syntax.Core

Methods

(==) :: Space -> Space -> Bool #

(/=) :: Space -> Space -> Bool #

Ord Space Source # 
Instance details

Defined in Futhark.IR.Syntax.Core

Methods

compare :: Space -> Space -> Ordering #

(<) :: Space -> Space -> Bool #

(<=) :: Space -> Space -> Bool #

(>) :: Space -> Space -> Bool #

(>=) :: Space -> Space -> Bool #

max :: Space -> Space -> Space #

min :: Space -> Space -> Space #

Show Space Source # 
Instance details

Defined in Futhark.IR.Syntax.Core

Methods

showsPrec :: Int -> Space -> ShowS #

show :: Space -> String #

showList :: [Space] -> ShowS #

Generic Space Source # 
Instance details

Defined in Futhark.IR.Syntax.Core

Associated Types

type Rep Space :: Type -> Type #

Methods

from :: Space -> Rep Space x #

to :: Rep Space x -> Space #

Pretty Space Source # 
Instance details

Defined in Futhark.IR.Pretty

Methods

ppr :: Space -> Doc #

pprPrec :: Int -> Space -> Doc #

pprList :: [Space] -> Doc #

SexpIso Space Source # 
Instance details

Defined in Futhark.IR.Syntax.Core

FreeIn Space Source # 
Instance details

Defined in Futhark.IR.Prop.Names

Methods

freeIn' :: Space -> FV Source #

Simplifiable Space Source # 
Instance details

Defined in Futhark.Optimise.Simplify.Engine

Methods

simplify :: SimplifiableLore lore => Space -> SimpleM lore Space Source #

type Rep Space Source # 
Instance details

Defined in Futhark.IR.Syntax.Core

data TypeBase shape u Source #

A Futhark type is either an array or an element type. When comparing types for equality with ==, shapes must match.

Constructors

Prim PrimType 
Array PrimType shape u 
Mem Space 

Instances

Instances details
SetType Type Source # 
Instance details

Defined in Futhark.IR.Prop.Types

Methods

setType :: Type -> Type -> Type Source #

DeclExtTyped DeclExtType Source # 
Instance details

Defined in Futhark.IR.Prop.Types

ExtTyped ExtType Source # 
Instance details

Defined in Futhark.IR.Prop.Types

DeclTyped DeclType Source # 
Instance details

Defined in Futhark.IR.Prop.Types

Typed DeclType Source # 
Instance details

Defined in Futhark.IR.Prop.Types

Methods

typeOf :: DeclType -> Type Source #

Typed Type Source # 
Instance details

Defined in Futhark.IR.Prop.Types

Methods

typeOf :: Type -> Type Source #

IsRetType DeclExtType Source # 
Instance details

Defined in Futhark.IR.RetType

IsBodyType ExtType Source # 
Instance details

Defined in Futhark.IR.RetType

Pretty (PatElemT Type) Source # 
Instance details

Defined in Futhark.IR.Pretty

Pretty (Param DeclType) Source # 
Instance details

Defined in Futhark.IR.Pretty

Pretty (Param Type) Source # 
Instance details

Defined in Futhark.IR.Pretty

Methods

ppr :: Param Type -> Doc #

pprPrec :: Int -> Param Type -> Doc #

pprList :: [Param Type] -> Doc #

PrettyAnnot (PatElemT (TypeBase shape u)) Source # 
Instance details

Defined in Futhark.IR.Pretty

Methods

ppAnnot :: PatElemT (TypeBase shape u) -> Maybe Doc Source #

PrettyAnnot (Param (TypeBase shape u)) Source # 
Instance details

Defined in Futhark.IR.Pretty

Methods

ppAnnot :: Param (TypeBase shape u) -> Maybe Doc Source #

(Eq shape, Eq u) => Eq (TypeBase shape u) Source # 
Instance details

Defined in Futhark.IR.Syntax.Core

Methods

(==) :: TypeBase shape u -> TypeBase shape u -> Bool #

(/=) :: TypeBase shape u -> TypeBase shape u -> Bool #

(Ord shape, Ord u) => Ord (TypeBase shape u) Source # 
Instance details

Defined in Futhark.IR.Syntax.Core

Methods

compare :: TypeBase shape u -> TypeBase shape u -> Ordering #

(<) :: TypeBase shape u -> TypeBase shape u -> Bool #

(<=) :: TypeBase shape u -> TypeBase shape u -> Bool #

(>) :: TypeBase shape u -> TypeBase shape u -> Bool #

(>=) :: TypeBase shape u -> TypeBase shape u -> Bool #

max :: TypeBase shape u -> TypeBase shape u -> TypeBase shape u #

min :: TypeBase shape u -> TypeBase shape u -> TypeBase shape u #

(Show shape, Show u) => Show (TypeBase shape u) Source # 
Instance details

Defined in Futhark.IR.Syntax.Core

Methods

showsPrec :: Int -> TypeBase shape u -> ShowS #

show :: TypeBase shape u -> String #

showList :: [TypeBase shape u] -> ShowS #

Generic (TypeBase shape u) Source # 
Instance details

Defined in Futhark.IR.Syntax.Core

Associated Types

type Rep (TypeBase shape u) :: Type -> Type #

Methods

from :: TypeBase shape u -> Rep (TypeBase shape u) x #

to :: Rep (TypeBase shape u) x -> TypeBase shape u #

Pretty u => Pretty (TypeBase Rank u) Source # 
Instance details

Defined in Futhark.IR.Pretty

Methods

ppr :: TypeBase Rank u -> Doc #

pprPrec :: Int -> TypeBase Rank u -> Doc #

pprList :: [TypeBase Rank u] -> Doc #

Pretty u => Pretty (TypeBase ExtShape u) Source # 
Instance details

Defined in Futhark.IR.Pretty

Pretty u => Pretty (TypeBase Shape u) Source # 
Instance details

Defined in Futhark.IR.Pretty

Methods

ppr :: TypeBase Shape u -> Doc #

pprPrec :: Int -> TypeBase Shape u -> Doc #

pprList :: [TypeBase Shape u] -> Doc #

(SexpIso shape, SexpIso u) => SexpIso (TypeBase shape u) Source # 
Instance details

Defined in Futhark.IR.Syntax.Core

Methods

sexpIso :: SexpGrammar (TypeBase shape u) #

(FixExt shape, ArrayShape shape) => FixExt (TypeBase shape u) Source # 
Instance details

Defined in Futhark.IR.Prop.Types

Methods

fixExt :: Int -> SubExp -> TypeBase shape u -> TypeBase shape u Source #

FreeIn shape => FreeIn (TypeBase shape u) Source # 
Instance details

Defined in Futhark.IR.Prop.Names

Methods

freeIn' :: TypeBase shape u -> FV Source #

Substitute shape => Substitute (TypeBase shape u) Source # 
Instance details

Defined in Futhark.Transform.Substitute

Methods

substituteNames :: Map VName VName -> TypeBase shape u -> TypeBase shape u Source #

Rename shape => Rename (TypeBase shape u) Source # 
Instance details

Defined in Futhark.Transform.Rename

Methods

rename :: TypeBase shape u -> RenameM (TypeBase shape u) Source #

Simplifiable shape => Simplifiable (TypeBase shape u) Source # 
Instance details

Defined in Futhark.Optimise.Simplify.Engine

Methods

simplify :: SimplifiableLore lore => TypeBase shape u -> SimpleM lore (TypeBase shape u) Source #

type Rep (TypeBase shape u) Source # 
Instance details

Defined in Futhark.IR.Syntax.Core

data Diet Source #

Information about which parts of a value/type are consumed. For example, we might say that a function taking three arguments of types ([int], *[int], [int]) has diet [Observe, Consume, Observe].

Constructors

Consume

Consumes this value.

Observe

Only observes value in this position, does not consume. A result may alias this.

ObservePrim

As Observe, but the result will not alias, because the parameter does not carry aliases.

Instances

Instances details
Eq Diet Source # 
Instance details

Defined in Futhark.IR.Syntax.Core

Methods

(==) :: Diet -> Diet -> Bool #

(/=) :: Diet -> Diet -> Bool #

Ord Diet Source # 
Instance details

Defined in Futhark.IR.Syntax.Core

Methods

compare :: Diet -> Diet -> Ordering #

(<) :: Diet -> Diet -> Bool #

(<=) :: Diet -> Diet -> Bool #

(>) :: Diet -> Diet -> Bool #

(>=) :: Diet -> Diet -> Bool #

max :: Diet -> Diet -> Diet #

min :: Diet -> Diet -> Diet #

Show Diet Source # 
Instance details

Defined in Futhark.IR.Syntax.Core

Methods

showsPrec :: Int -> Diet -> ShowS #

show :: Diet -> String #

showList :: [Diet] -> ShowS #

Generic Diet Source # 
Instance details

Defined in Futhark.IR.Syntax.Core

Associated Types

type Rep Diet :: Type -> Type #

Methods

from :: Diet -> Rep Diet x #

to :: Rep Diet x -> Diet #

SexpIso Diet Source # 
Instance details

Defined in Futhark.IR.Syntax.Core

type Rep Diet Source # 
Instance details

Defined in Futhark.IR.Syntax.Core

type Rep Diet = D1 ('MetaData "Diet" "Futhark.IR.Syntax.Core" "futhark-0.17.1-inplace" 'False) (C1 ('MetaCons "Consume" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "Observe" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "ObservePrim" 'PrefixI 'False) (U1 :: Type -> Type)))

Attributes

data Attr Source #

A single attribute.

Constructors

AttrAtom Name 
AttrComp Name [Attr] 

Instances

Instances details
Eq Attr Source # 
Instance details

Defined in Futhark.IR.Syntax

Methods

(==) :: Attr -> Attr -> Bool #

(/=) :: Attr -> Attr -> Bool #

Ord Attr Source # 
Instance details

Defined in Futhark.IR.Syntax

Methods

compare :: Attr -> Attr -> Ordering #

(<) :: Attr -> Attr -> Bool #

(<=) :: Attr -> Attr -> Bool #

(>) :: Attr -> Attr -> Bool #

(>=) :: Attr -> Attr -> Bool #

max :: Attr -> Attr -> Attr #

min :: Attr -> Attr -> Attr #

Show Attr Source # 
Instance details

Defined in Futhark.IR.Syntax

Methods

showsPrec :: Int -> Attr -> ShowS #

show :: Attr -> String #

showList :: [Attr] -> ShowS #

IsString Attr Source # 
Instance details

Defined in Futhark.IR.Syntax

Methods

fromString :: String -> Attr #

Generic Attr Source # 
Instance details

Defined in Futhark.IR.Syntax

Associated Types

type Rep Attr :: Type -> Type #

Methods

from :: Attr -> Rep Attr x #

to :: Rep Attr x -> Attr #

Pretty Attr Source # 
Instance details

Defined in Futhark.IR.Pretty

Methods

ppr :: Attr -> Doc #

pprPrec :: Int -> Attr -> Doc #

pprList :: [Attr] -> Doc #

SexpIso Attr Source # 
Instance details

Defined in Futhark.IR.Syntax

type Rep Attr Source # 
Instance details

Defined in Futhark.IR.Syntax

newtype Attrs Source #

Every statement is associated with a set of attributes, which can have various effects throughout the compiler.

Constructors

Attrs 

Fields

Instances

Instances details
Eq Attrs Source # 
Instance details

Defined in Futhark.IR.Syntax

Methods

(==) :: Attrs -> Attrs -> Bool #

(/=) :: Attrs -> Attrs -> Bool #

Ord Attrs Source # 
Instance details

Defined in Futhark.IR.Syntax

Methods

compare :: Attrs -> Attrs -> Ordering #

(<) :: Attrs -> Attrs -> Bool #

(<=) :: Attrs -> Attrs -> Bool #

(>) :: Attrs -> Attrs -> Bool #

(>=) :: Attrs -> Attrs -> Bool #

max :: Attrs -> Attrs -> Attrs #

min :: Attrs -> Attrs -> Attrs #

Show Attrs Source # 
Instance details

Defined in Futhark.IR.Syntax

Methods

showsPrec :: Int -> Attrs -> ShowS #

show :: Attrs -> String #

showList :: [Attrs] -> ShowS #

Generic Attrs Source # 
Instance details

Defined in Futhark.IR.Syntax

Associated Types

type Rep Attrs :: Type -> Type #

Methods

from :: Attrs -> Rep Attrs x #

to :: Rep Attrs x -> Attrs #

Semigroup Attrs Source # 
Instance details

Defined in Futhark.IR.Syntax

Methods

(<>) :: Attrs -> Attrs -> Attrs #

sconcat :: NonEmpty Attrs -> Attrs #

stimes :: Integral b => b -> Attrs -> Attrs #

Monoid Attrs Source # 
Instance details

Defined in Futhark.IR.Syntax

Methods

mempty :: Attrs #

mappend :: Attrs -> Attrs -> Attrs #

mconcat :: [Attrs] -> Attrs #

SexpIso Attrs Source # 
Instance details

Defined in Futhark.IR.Syntax

FreeIn Attrs Source # 
Instance details

Defined in Futhark.IR.Prop.Names

Methods

freeIn' :: Attrs -> FV Source #

Substitute Attrs Source # 
Instance details

Defined in Futhark.Transform.Substitute

Rename Attrs Source # 
Instance details

Defined in Futhark.Transform.Rename

type Rep Attrs Source # 
Instance details

Defined in Futhark.IR.Syntax

type Rep Attrs = D1 ('MetaData "Attrs" "Futhark.IR.Syntax" "futhark-0.17.1-inplace" 'True) (C1 ('MetaCons "Attrs" 'PrefixI 'True) (S1 ('MetaSel ('Just "unAttrs") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Set Attr))))

oneAttr :: Attr -> Attrs Source #

Construct Attrs from a single Attr.

inAttrs :: Attr -> Attrs -> Bool Source #

Is the given attribute to be found in the attribute set?

withoutAttrs :: Attrs -> Attrs -> Attrs Source #

x withoutAttrs y gives x except for any attributes also in y.

Abstract syntax tree

data Ident Source #

An identifier consists of its name and the type of the value bound to the identifier.

Constructors

Ident 

Fields

Instances

Instances details
Eq Ident Source # 
Instance details

Defined in Futhark.IR.Syntax.Core

Methods

(==) :: Ident -> Ident -> Bool #

(/=) :: Ident -> Ident -> Bool #

Ord Ident Source # 
Instance details

Defined in Futhark.IR.Syntax.Core

Methods

compare :: Ident -> Ident -> Ordering #

(<) :: Ident -> Ident -> Bool #

(<=) :: Ident -> Ident -> Bool #

(>) :: Ident -> Ident -> Bool #

(>=) :: Ident -> Ident -> Bool #

max :: Ident -> Ident -> Ident #

min :: Ident -> Ident -> Ident #

Show Ident Source # 
Instance details

Defined in Futhark.IR.Syntax.Core

Methods

showsPrec :: Int -> Ident -> ShowS #

show :: Ident -> String #

showList :: [Ident] -> ShowS #

Generic Ident Source # 
Instance details

Defined in Futhark.IR.Syntax.Core

Associated Types

type Rep Ident :: Type -> Type #

Methods

from :: Ident -> Rep Ident x #

to :: Rep Ident x -> Ident #

Pretty Ident Source # 
Instance details

Defined in Futhark.IR.Pretty

Methods

ppr :: Ident -> Doc #

pprPrec :: Int -> Ident -> Doc #

pprList :: [Ident] -> Doc #

SexpIso Ident Source # 
Instance details

Defined in Futhark.IR.Syntax.Core

Typed Ident Source # 
Instance details

Defined in Futhark.IR.Prop.Types

Methods

typeOf :: Ident -> Type Source #

FreeIn Ident Source # 
Instance details

Defined in Futhark.IR.Prop.Names

Methods

freeIn' :: Ident -> FV Source #

Substitute Ident Source # 
Instance details

Defined in Futhark.Transform.Substitute

Rename Ident Source # 
Instance details

Defined in Futhark.Transform.Rename

type Rep Ident Source # 
Instance details

Defined in Futhark.IR.Syntax.Core

type Rep Ident = D1 ('MetaData "Ident" "Futhark.IR.Syntax.Core" "futhark-0.17.1-inplace" 'False) (C1 ('MetaCons "Ident" 'PrefixI 'True) (S1 ('MetaSel ('Just "identName") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 VName) :*: S1 ('MetaSel ('Just "identType") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Type)))

data SubExp Source #

A subexpression is either a scalar constant or a variable. One important property is that evaluation of a subexpression is guaranteed to complete in constant time.

Constructors

Constant PrimValue 
Var VName 

Instances

Instances details
Eq SubExp Source # 
Instance details

Defined in Futhark.IR.Syntax.Core

Methods

(==) :: SubExp -> SubExp -> Bool #

(/=) :: SubExp -> SubExp -> Bool #

Ord SubExp Source # 
Instance details

Defined in Futhark.IR.Syntax.Core

Show SubExp Source # 
Instance details

Defined in Futhark.IR.Syntax.Core

Generic SubExp Source # 
Instance details

Defined in Futhark.IR.Syntax.Core

Associated Types

type Rep SubExp :: Type -> Type #

Methods

from :: SubExp -> Rep SubExp x #

to :: Rep SubExp x -> SubExp #

ToExp SubExp Source # 
Instance details

Defined in Futhark.CodeGen.Backends.GenericC

Methods

toExp :: SubExp -> SrcLoc -> Exp #

Pretty SubExp Source # 
Instance details

Defined in Futhark.IR.Pretty

Methods

ppr :: SubExp -> Doc #

pprPrec :: Int -> SubExp -> Doc #

pprList :: [SubExp] -> Doc #

Pretty ExtShape Source # 
Instance details

Defined in Futhark.IR.Pretty

Methods

ppr :: ExtShape -> Doc #

pprPrec :: Int -> ExtShape -> Doc #

pprList :: [ExtShape] -> Doc #

Pretty Shape Source # 
Instance details

Defined in Futhark.IR.Pretty

Methods

ppr :: Shape -> Doc #

pprPrec :: Int -> Shape -> Doc #

pprList :: [Shape] -> Doc #

SexpIso SubExp Source # 
Instance details

Defined in Futhark.IR.Syntax.Core

FixExt ExtSize Source # 
Instance details

Defined in Futhark.IR.Prop.Types

Methods

fixExt :: Int -> SubExp -> ExtSize -> ExtSize Source #

SetType Type Source # 
Instance details

Defined in Futhark.IR.Prop.Types

Methods

setType :: Type -> Type -> Type Source #

DeclExtTyped DeclExtType Source # 
Instance details

Defined in Futhark.IR.Prop.Types

ExtTyped ExtType Source # 
Instance details

Defined in Futhark.IR.Prop.Types

DeclTyped DeclType Source # 
Instance details

Defined in Futhark.IR.Prop.Types

Typed DeclType Source # 
Instance details

Defined in Futhark.IR.Prop.Types

Methods

typeOf :: DeclType -> Type Source #

Typed Type Source # 
Instance details

Defined in Futhark.IR.Prop.Types

Methods

typeOf :: Type -> Type Source #

IsRetType DeclExtType Source # 
Instance details

Defined in Futhark.IR.RetType

IsRetType FunReturns Source # 
Instance details

Defined in Futhark.IR.Mem

IsBodyType ExtType Source # 
Instance details

Defined in Futhark.IR.RetType

IsBodyType BodyReturns Source # 
Instance details

Defined in Futhark.IR.Mem

FreeIn SubExp Source # 
Instance details

Defined in Futhark.IR.Prop.Names

Methods

freeIn' :: SubExp -> FV Source #

Substitute SubExp Source # 
Instance details

Defined in Futhark.Transform.Substitute

Rename SubExp Source # 
Instance details

Defined in Futhark.Transform.Rename

Rename ExtSize Source # 
Instance details

Defined in Futhark.Transform.Rename

ToExp SubExp Source # 
Instance details

Defined in Futhark.Construct

Methods

toExp :: MonadBinder m => SubExp -> m (Exp (Lore m)) Source #

Simplifiable SubExp Source # 
Instance details

Defined in Futhark.Optimise.Simplify.Engine

Simplifiable ExtSize Source # 
Instance details

Defined in Futhark.Optimise.Simplify.Engine

ToExp SubExp Source # 
Instance details

Defined in Futhark.CodeGen.ImpGen

Pretty (PatElemT Type) Source # 
Instance details

Defined in Futhark.IR.Pretty

Pretty (PatElemT (MemInfo SubExp NoUniqueness ret)) Source # 
Instance details

Defined in Futhark.IR.Mem

Pretty (Param DeclType) Source # 
Instance details

Defined in Futhark.IR.Pretty

Pretty (Param Type) Source # 
Instance details

Defined in Futhark.IR.Pretty

Methods

ppr :: Param Type -> Doc #

pprPrec :: Int -> Param Type -> Doc #

pprList :: [Param Type] -> Doc #

Pretty (Param (MemInfo SubExp Uniqueness ret)) Source # 
Instance details

Defined in Futhark.IR.Mem

Pretty (Param (MemInfo SubExp NoUniqueness ret)) Source # 
Instance details

Defined in Futhark.IR.Mem

ArrayShape (ShapeBase SubExp) Source # 
Instance details

Defined in Futhark.IR.Syntax.Core

ArrayShape (ShapeBase ExtSize) Source # 
Instance details

Defined in Futhark.IR.Syntax.Core

(Pretty u, Pretty r) => PrettyAnnot (PatElemT (MemInfo SubExp u r)) Source # 
Instance details

Defined in Futhark.IR.Mem

(Pretty u, Pretty r) => PrettyAnnot (Param (MemInfo SubExp u r)) Source # 
Instance details

Defined in Futhark.IR.Mem

Simplifiable [FunReturns] Source # 
Instance details

Defined in Futhark.IR.Mem

Pretty u => Pretty (TypeBase ExtShape u) Source # 
Instance details

Defined in Futhark.IR.Pretty

Pretty u => Pretty (TypeBase Shape u) Source # 
Instance details

Defined in Futhark.IR.Pretty

Methods

ppr :: TypeBase Shape u -> Doc #

pprPrec :: Int -> TypeBase Shape u -> Doc #

pprList :: [TypeBase Shape u] -> Doc #

FixExt ret => FixExt (MemInfo ExtSize u ret) Source # 
Instance details

Defined in Futhark.IR.Mem

Methods

fixExt :: Int -> SubExp -> MemInfo ExtSize u ret -> MemInfo ExtSize u ret Source #

FixExt ret => DeclExtTyped (MemInfo ExtSize Uniqueness ret) Source # 
Instance details

Defined in Futhark.IR.Mem

FixExt ret => ExtTyped (MemInfo ExtSize NoUniqueness ret) Source # 
Instance details

Defined in Futhark.IR.Mem

DeclTyped (MemInfo SubExp Uniqueness ret) Source # 
Instance details

Defined in Futhark.IR.Mem

Typed (MemInfo SubExp Uniqueness ret) Source # 
Instance details

Defined in Futhark.IR.Mem

Typed (MemInfo SubExp NoUniqueness ret) Source # 
Instance details

Defined in Futhark.IR.Mem

type Rep SubExp Source # 
Instance details

Defined in Futhark.IR.Syntax.Core

type PatElem lore = PatElemT (LetDec lore) Source #

A type alias for namespace control.

data PatElemT dec Source #

An element of a pattern - consisting of a name and an addditional parametric decoration. This decoration is what is expected to contain the type of the resulting variable.

Constructors

PatElem 

Fields

Instances

Instances details
Functor PatElemT Source # 
Instance details

Defined in Futhark.IR.Syntax.Core

Methods

fmap :: (a -> b) -> PatElemT a -> PatElemT b #

(<$) :: a -> PatElemT b -> PatElemT a #

Foldable PatElemT Source # 
Instance details

Defined in Futhark.IR.Syntax.Core

Methods

fold :: Monoid m => PatElemT m -> m #

foldMap :: Monoid m => (a -> m) -> PatElemT a -> m #

foldMap' :: Monoid m => (a -> m) -> PatElemT a -> m #

foldr :: (a -> b -> b) -> b -> PatElemT a -> b #

foldr' :: (a -> b -> b) -> b -> PatElemT a -> b #

foldl :: (b -> a -> b) -> b -> PatElemT a -> b #

foldl' :: (b -> a -> b) -> b -> PatElemT a -> b #

foldr1 :: (a -> a -> a) -> PatElemT a -> a #

foldl1 :: (a -> a -> a) -> PatElemT a -> a #

toList :: PatElemT a -> [a] #

null :: PatElemT a -> Bool #

length :: PatElemT a -> Int #

elem :: Eq a => a -> PatElemT a -> Bool #

maximum :: Ord a => PatElemT a -> a #

minimum :: Ord a => PatElemT a -> a #

sum :: Num a => PatElemT a -> a #

product :: Num a => PatElemT a -> a #

Traversable PatElemT Source # 
Instance details

Defined in Futhark.IR.Syntax.Core

Methods

traverse :: Applicative f => (a -> f b) -> PatElemT a -> f (PatElemT b) #

sequenceA :: Applicative f => PatElemT (f a) -> f (PatElemT a) #

mapM :: Monad m => (a -> m b) -> PatElemT a -> m (PatElemT b) #

sequence :: Monad m => PatElemT (m a) -> m (PatElemT a) #

Eq dec => Eq (PatElemT dec) Source # 
Instance details

Defined in Futhark.IR.Syntax.Core

Methods

(==) :: PatElemT dec -> PatElemT dec -> Bool #

(/=) :: PatElemT dec -> PatElemT dec -> Bool #

Ord dec => Ord (PatElemT dec) Source # 
Instance details

Defined in Futhark.IR.Syntax.Core

Methods

compare :: PatElemT dec -> PatElemT dec -> Ordering #

(<) :: PatElemT dec -> PatElemT dec -> Bool #

(<=) :: PatElemT dec -> PatElemT dec -> Bool #

(>) :: PatElemT dec -> PatElemT dec -> Bool #

(>=) :: PatElemT dec -> PatElemT dec -> Bool #

max :: PatElemT dec -> PatElemT dec -> PatElemT dec #

min :: PatElemT dec -> PatElemT dec -> PatElemT dec #

Show dec => Show (PatElemT dec) Source # 
Instance details

Defined in Futhark.IR.Syntax.Core

Methods

showsPrec :: Int -> PatElemT dec -> ShowS #

show :: PatElemT dec -> String #

showList :: [PatElemT dec] -> ShowS #

Generic (PatElemT dec) Source # 
Instance details

Defined in Futhark.IR.Syntax.Core

Associated Types

type Rep (PatElemT dec) :: Type -> Type #

Methods

from :: PatElemT dec -> Rep (PatElemT dec) x #

to :: Rep (PatElemT dec) x -> PatElemT dec #

Pretty (PatElemT b) => Pretty (PatElemT (a, b)) Source # 
Instance details

Defined in Futhark.IR.Pretty

Methods

ppr :: PatElemT (a, b) -> Doc #

pprPrec :: Int -> PatElemT (a, b) -> Doc #

pprList :: [PatElemT (a, b)] -> Doc #

Pretty (PatElemT Type) Source # 
Instance details

Defined in Futhark.IR.Pretty

Pretty (PatElemT (MemInfo SubExp NoUniqueness ret)) Source # 
Instance details

Defined in Futhark.IR.Mem

SexpIso dec => SexpIso (PatElemT dec) Source # 
Instance details

Defined in Futhark.IR.Syntax.Core

Methods

sexpIso :: SexpGrammar (PatElemT dec) #

SetType dec => SetType (PatElemT dec) Source # 
Instance details

Defined in Futhark.IR.Prop.Types

Methods

setType :: PatElemT dec -> Type -> PatElemT dec Source #

Typed dec => Typed (PatElemT dec) Source # 
Instance details

Defined in Futhark.IR.Prop.Types

Methods

typeOf :: PatElemT dec -> Type Source #

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

Defined in Futhark.IR.Aliases

PrettyAnnot (PatElemT dec) => PrettyAnnot (PatElemT (VarWisdom, dec)) Source # 
Instance details

Defined in Futhark.Optimise.Simplify.Lore

Methods

ppAnnot :: PatElemT (VarWisdom, dec) -> Maybe Doc Source #

PrettyAnnot (PatElemT (TypeBase shape u)) Source # 
Instance details

Defined in Futhark.IR.Pretty

Methods

ppAnnot :: PatElemT (TypeBase shape u) -> Maybe Doc Source #

(Pretty u, Pretty r) => PrettyAnnot (PatElemT (MemInfo SubExp u r)) Source # 
Instance details

Defined in Futhark.IR.Mem

FreeIn dec => FreeIn (PatElemT dec) Source # 
Instance details

Defined in Futhark.IR.Prop.Names

Methods

freeIn' :: PatElemT dec -> FV Source #

Substitute dec => Substitute (PatElemT dec) Source # 
Instance details

Defined in Futhark.Transform.Substitute

Rename dec => Rename (PatElemT dec) Source # 
Instance details

Defined in Futhark.Transform.Rename

Methods

rename :: PatElemT dec -> RenameM (PatElemT dec) Source #

AliasesOf dec => AliasesOf (PatElemT dec) Source # 
Instance details

Defined in Futhark.IR.Prop.Aliases

Methods

aliasesOf :: PatElemT dec -> Names Source #

type Rep (PatElemT dec) Source # 
Instance details

Defined in Futhark.IR.Syntax.Core

type Rep (PatElemT dec) = D1 ('MetaData "PatElemT" "Futhark.IR.Syntax.Core" "futhark-0.17.1-inplace" 'False) (C1 ('MetaCons "PatElem" 'PrefixI 'True) (S1 ('MetaSel ('Just "patElemName") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 VName) :*: S1 ('MetaSel ('Just "patElemDec") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 dec)))

data PatternT dec Source #

A pattern is conceptually just a list of names and their types.

Constructors

Pattern 

Fields

Instances

Instances details
Functor PatternT Source # 
Instance details

Defined in Futhark.IR.Syntax

Methods

fmap :: (a -> b) -> PatternT a -> PatternT b #

(<$) :: a -> PatternT b -> PatternT a #

Foldable PatternT Source # 
Instance details

Defined in Futhark.IR.Syntax

Methods

fold :: Monoid m => PatternT m -> m #

foldMap :: Monoid m => (a -> m) -> PatternT a -> m #

foldMap' :: Monoid m => (a -> m) -> PatternT a -> m #

foldr :: (a -> b -> b) -> b -> PatternT a -> b #

foldr' :: (a -> b -> b) -> b -> PatternT a -> b #

foldl :: (b -> a -> b) -> b -> PatternT a -> b #

foldl' :: (b -> a -> b) -> b -> PatternT a -> b #

foldr1 :: (a -> a -> a) -> PatternT a -> a #

foldl1 :: (a -> a -> a) -> PatternT a -> a #

toList :: PatternT a -> [a] #

null :: PatternT a -> Bool #

length :: PatternT a -> Int #

elem :: Eq a => a -> PatternT a -> Bool #

maximum :: Ord a => PatternT a -> a #

minimum :: Ord a => PatternT a -> a #

sum :: Num a => PatternT a -> a #

product :: Num a => PatternT a -> a #

Traversable PatternT Source # 
Instance details

Defined in Futhark.IR.Syntax

Methods

traverse :: Applicative f => (a -> f b) -> PatternT a -> f (PatternT b) #

sequenceA :: Applicative f => PatternT (f a) -> f (PatternT a) #

mapM :: Monad m => (a -> m b) -> PatternT a -> m (PatternT b) #

sequence :: Monad m => PatternT (m a) -> m (PatternT a) #

Eq dec => Eq (PatternT dec) Source # 
Instance details

Defined in Futhark.IR.Syntax

Methods

(==) :: PatternT dec -> PatternT dec -> Bool #

(/=) :: PatternT dec -> PatternT dec -> Bool #

Ord dec => Ord (PatternT dec) Source # 
Instance details

Defined in Futhark.IR.Syntax

Methods

compare :: PatternT dec -> PatternT dec -> Ordering #

(<) :: PatternT dec -> PatternT dec -> Bool #

(<=) :: PatternT dec -> PatternT dec -> Bool #

(>) :: PatternT dec -> PatternT dec -> Bool #

(>=) :: PatternT dec -> PatternT dec -> Bool #

max :: PatternT dec -> PatternT dec -> PatternT dec #

min :: PatternT dec -> PatternT dec -> PatternT dec #

Show dec => Show (PatternT dec) Source # 
Instance details

Defined in Futhark.IR.Syntax

Methods

showsPrec :: Int -> PatternT dec -> ShowS #

show :: PatternT dec -> String #

showList :: [PatternT dec] -> ShowS #

Generic (PatternT dec) Source # 
Instance details

Defined in Futhark.IR.Syntax

Associated Types

type Rep (PatternT dec) :: Type -> Type #

Methods

from :: PatternT dec -> Rep (PatternT dec) x #

to :: Rep (PatternT dec) x -> PatternT dec #

Semigroup (PatternT dec) Source # 
Instance details

Defined in Futhark.IR.Syntax

Methods

(<>) :: PatternT dec -> PatternT dec -> PatternT dec #

sconcat :: NonEmpty (PatternT dec) -> PatternT dec #

stimes :: Integral b => b -> PatternT dec -> PatternT dec #

Monoid (PatternT dec) Source # 
Instance details

Defined in Futhark.IR.Syntax

Methods

mempty :: PatternT dec #

mappend :: PatternT dec -> PatternT dec -> PatternT dec #

mconcat :: [PatternT dec] -> PatternT dec #

Pretty (PatElemT dec) => Pretty (PatternT dec) Source # 
Instance details

Defined in Futhark.IR.Pretty

Methods

ppr :: PatternT dec -> Doc #

pprPrec :: Int -> PatternT dec -> Doc #

pprList :: [PatternT dec] -> Doc #

SexpIso dec => SexpIso (PatternT dec) Source # 
Instance details

Defined in Futhark.IR.Syntax

Methods

sexpIso :: SexpGrammar (PatternT dec) #

FreeIn dec => FreeIn (PatternT dec) Source # 
Instance details

Defined in Futhark.IR.Prop.Names

Methods

freeIn' :: PatternT dec -> FV Source #

Substitute dec => Substitute (PatternT dec) Source # 
Instance details

Defined in Futhark.Transform.Substitute

Rename dec => Rename (PatternT dec) Source # 
Instance details

Defined in Futhark.Transform.Rename

Methods

rename :: PatternT dec -> RenameM (PatternT dec) Source #

type Rep (PatternT dec) Source # 
Instance details

Defined in Futhark.IR.Syntax

type Rep (PatternT dec) = D1 ('MetaData "PatternT" "Futhark.IR.Syntax" "futhark-0.17.1-inplace" 'False) (C1 ('MetaCons "Pattern" 'PrefixI 'True) (S1 ('MetaSel ('Just "patternContextElements") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 [PatElemT dec]) :*: S1 ('MetaSel ('Just "patternValueElements") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 [PatElemT dec])))

type Pattern lore = PatternT (LetDec lore) Source #

A type alias for namespace control.

data StmAux dec Source #

Auxilliary Information associated with a statement.

Constructors

StmAux 

Instances

Instances details
Eq dec => Eq (StmAux dec) Source # 
Instance details

Defined in Futhark.IR.Syntax

Methods

(==) :: StmAux dec -> StmAux dec -> Bool #

(/=) :: StmAux dec -> StmAux dec -> Bool #

Ord dec => Ord (StmAux dec) Source # 
Instance details

Defined in Futhark.IR.Syntax

Methods

compare :: StmAux dec -> StmAux dec -> Ordering #

(<) :: StmAux dec -> StmAux dec -> Bool #

(<=) :: StmAux dec -> StmAux dec -> Bool #

(>) :: StmAux dec -> StmAux dec -> Bool #

(>=) :: StmAux dec -> StmAux dec -> Bool #

max :: StmAux dec -> StmAux dec -> StmAux dec #

min :: StmAux dec -> StmAux dec -> StmAux dec #

Show dec => Show (StmAux dec) Source # 
Instance details

Defined in Futhark.IR.Syntax

Methods

showsPrec :: Int -> StmAux dec -> ShowS #

show :: StmAux dec -> String #

showList :: [StmAux dec] -> ShowS #

Generic (StmAux dec) Source # 
Instance details

Defined in Futhark.IR.Syntax

Associated Types

type Rep (StmAux dec) :: Type -> Type #

Methods

from :: StmAux dec -> Rep (StmAux dec) x #

to :: Rep (StmAux dec) x -> StmAux dec #

Semigroup dec => Semigroup (StmAux dec) Source # 
Instance details

Defined in Futhark.IR.Syntax

Methods

(<>) :: StmAux dec -> StmAux dec -> StmAux dec #

sconcat :: NonEmpty (StmAux dec) -> StmAux dec #

stimes :: Integral b => b -> StmAux dec -> StmAux dec #

SexpIso dec => SexpIso (StmAux dec) Source # 
Instance details

Defined in Futhark.IR.Syntax

Methods

sexpIso :: SexpGrammar (StmAux dec) #

FreeIn dec => FreeIn (StmAux dec) Source # 
Instance details

Defined in Futhark.IR.Prop.Names

Methods

freeIn' :: StmAux dec -> FV Source #

Substitute dec => Substitute (StmAux dec) Source # 
Instance details

Defined in Futhark.Transform.Substitute

Rename dec => Rename (StmAux dec) Source # 
Instance details

Defined in Futhark.Transform.Rename

Methods

rename :: StmAux dec -> RenameM (StmAux dec) Source #

type Rep (StmAux dec) Source # 
Instance details

Defined in Futhark.IR.Syntax

type Rep (StmAux dec) = D1 ('MetaData "StmAux" "Futhark.IR.Syntax" "futhark-0.17.1-inplace" 'False) (C1 ('MetaCons "StmAux" 'PrefixI 'True) (S1 ('MetaSel ('Just "stmAuxCerts") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Certificates) :*: (S1 ('MetaSel ('Just "stmAuxAttrs") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Attrs) :*: S1 ('MetaSel ('Just "stmAuxDec") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 dec))))

data Stm lore Source #

A local variable binding.

Constructors

Let 

Fields

Instances

Instances details
Scoped lore (Stm lore) Source # 
Instance details

Defined in Futhark.IR.Prop.Scope

Methods

scopeOf :: Stm lore -> Scope lore Source #

Scoped lore (Stms lore) Source # 
Instance details

Defined in Futhark.IR.Prop.Scope

Methods

scopeOf :: Stms lore -> Scope lore Source #

Decorations lore => Eq (Stm lore) Source # 
Instance details

Defined in Futhark.IR.Syntax

Methods

(==) :: Stm lore -> Stm lore -> Bool #

(/=) :: Stm lore -> Stm lore -> Bool #

Decorations lore => Ord (Stm lore) Source # 
Instance details

Defined in Futhark.IR.Syntax

Methods

compare :: Stm lore -> Stm lore -> Ordering #

(<) :: Stm lore -> Stm lore -> Bool #

(<=) :: Stm lore -> Stm lore -> Bool #

(>) :: Stm lore -> Stm lore -> Bool #

(>=) :: Stm lore -> Stm lore -> Bool #

max :: Stm lore -> Stm lore -> Stm lore #

min :: Stm lore -> Stm lore -> Stm lore #

Decorations lore => Show (Stm lore) Source # 
Instance details

Defined in Futhark.IR.Syntax

Methods

showsPrec :: Int -> Stm lore -> ShowS #

show :: Stm lore -> String #

showList :: [Stm lore] -> ShowS #

Generic (Stm lore) Source # 
Instance details

Defined in Futhark.IR.Syntax

Associated Types

type Rep (Stm lore) :: Type -> Type #

Methods

from :: Stm lore -> Rep (Stm lore) x #

to :: Rep (Stm lore) x -> Stm lore #

PrettyLore lore => Pretty (Stms lore) Source # 
Instance details

Defined in Futhark.IR.Pretty

Methods

ppr :: Stms lore -> Doc #

pprPrec :: Int -> Stms lore -> Doc #

pprList :: [Stms lore] -> Doc #

PrettyLore lore => Pretty (Stm lore) Source # 
Instance details

Defined in Futhark.IR.Pretty

Methods

ppr :: Stm lore -> Doc #

pprPrec :: Int -> Stm lore -> Doc #

pprList :: [Stm lore] -> Doc #

Decorations lore => SexpIso (Stms lore) Source # 
Instance details

Defined in Futhark.IR.Syntax

Methods

sexpIso :: SexpGrammar (Stms lore) #

Decorations lore => SexpIso (Stm lore) Source # 
Instance details

Defined in Futhark.IR.Syntax

Methods

sexpIso :: SexpGrammar (Stm lore) #

FreeIn (Stm lore) => FreeIn (Stms lore) Source # 
Instance details

Defined in Futhark.IR.Prop.Names

Methods

freeIn' :: Stms lore -> FV Source #

(FreeDec (ExpDec lore), FreeDec (BodyDec lore), FreeIn (FParamInfo lore), FreeIn (LParamInfo lore), FreeIn (LetDec lore), FreeIn (Op lore)) => FreeIn (Stm lore) Source # 
Instance details

Defined in Futhark.IR.Prop.Names

Methods

freeIn' :: Stm lore -> FV Source #

Substitute (Stm lore) => Substitute (Stms lore) Source # 
Instance details

Defined in Futhark.Transform.Substitute

Methods

substituteNames :: Map VName VName -> Stms lore -> Stms lore Source #

Substitutable lore => Substitute (Stm lore) Source # 
Instance details

Defined in Futhark.Transform.Substitute

Methods

substituteNames :: Map VName VName -> Stm lore -> Stm lore Source #

Renameable lore => Rename (Stm lore) Source # 
Instance details

Defined in Futhark.Transform.Rename

Methods

rename :: Stm lore -> RenameM (Stm lore) Source #

type Rep (Stm lore) Source # 
Instance details

Defined in Futhark.IR.Syntax

type Rep (Stm lore) = D1 ('MetaData "Stm" "Futhark.IR.Syntax" "futhark-0.17.1-inplace" 'False) (C1 ('MetaCons "Let" 'PrefixI 'True) (S1 ('MetaSel ('Just "stmPattern") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Pattern lore)) :*: (S1 ('MetaSel ('Just "stmAux") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (StmAux (ExpDec lore))) :*: S1 ('MetaSel ('Just "stmExp") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Exp lore)))))

type Stms lore = Seq (Stm lore) Source #

A sequence of statements.

type Result = [SubExp] Source #

The result of a body is a sequence of subexpressions.

data BodyT lore Source #

A body consists of a number of bindings, terminating in a result (essentially a tuple literal).

Constructors

Body 

Fields

Instances

Instances details
Decorations lore => Eq (BodyT lore) Source # 
Instance details

Defined in Futhark.IR.Syntax

Methods

(==) :: BodyT lore -> BodyT lore -> Bool #

(/=) :: BodyT lore -> BodyT lore -> Bool #

Decorations lore => Ord (BodyT lore) Source # 
Instance details

Defined in Futhark.IR.Syntax

Methods

compare :: BodyT lore -> BodyT lore -> Ordering #

(<) :: BodyT lore -> BodyT lore -> Bool #

(<=) :: BodyT lore -> BodyT lore -> Bool #

(>) :: BodyT lore -> BodyT lore -> Bool #

(>=) :: BodyT lore -> BodyT lore -> Bool #

max :: BodyT lore -> BodyT lore -> BodyT lore #

min :: BodyT lore -> BodyT lore -> BodyT lore #

Decorations lore => Show (BodyT lore) Source # 
Instance details

Defined in Futhark.IR.Syntax

Methods

showsPrec :: Int -> BodyT lore -> ShowS #

show :: BodyT lore -> String #

showList :: [BodyT lore] -> ShowS #

Generic (BodyT lore) Source # 
Instance details

Defined in Futhark.IR.Syntax

Associated Types

type Rep (BodyT lore) :: Type -> Type #

Methods

from :: BodyT lore -> Rep (BodyT lore) x #

to :: Rep (BodyT lore) x -> BodyT lore #

PrettyLore lore => Pretty (Body lore) Source # 
Instance details

Defined in Futhark.IR.Pretty

Methods

ppr :: Body lore -> Doc #

pprPrec :: Int -> Body lore -> Doc #

pprList :: [Body lore] -> Doc #

Decorations lore => SexpIso (BodyT lore) Source # 
Instance details

Defined in Futhark.IR.Syntax

Methods

sexpIso :: SexpGrammar (BodyT lore) #

(FreeDec (ExpDec lore), FreeDec (BodyDec lore), FreeIn (FParamInfo lore), FreeIn (LParamInfo lore), FreeIn (LetDec lore), FreeIn (Op lore)) => FreeIn (Body lore) Source # 
Instance details

Defined in Futhark.IR.Prop.Names

Methods

freeIn' :: Body lore -> FV Source #

Substitutable lore => Substitute (Body lore) Source # 
Instance details

Defined in Futhark.Transform.Substitute

Methods

substituteNames :: Map VName VName -> Body lore -> Body lore Source #

Renameable lore => Rename (Body lore) Source # 
Instance details

Defined in Futhark.Transform.Rename

Methods

rename :: Body lore -> RenameM (Body lore) Source #

type Rep (BodyT lore) Source # 
Instance details

Defined in Futhark.IR.Syntax

type Rep (BodyT lore) = D1 ('MetaData "BodyT" "Futhark.IR.Syntax" "futhark-0.17.1-inplace" 'False) (C1 ('MetaCons "Body" 'PrefixI 'True) (S1 ('MetaSel ('Just "bodyDec") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (BodyDec lore)) :*: (S1 ('MetaSel ('Just "bodyStms") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Stms lore)) :*: S1 ('MetaSel ('Just "bodyResult") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Result))))

type Body = BodyT Source #

Type alias for namespace reasons.

data BasicOp Source #

A primitive operation that returns something of known size and does not itself contain any bindings.

Constructors

SubExp SubExp

A variable or constant.

Opaque SubExp

Semantically and operationally just identity, but is invisible/impenetrable to optimisations (hopefully). This is just a hack to avoid optimisation (so, to work around compiler limitations).

ArrayLit [SubExp] Type

Array literals, e.g., [ [1+x, 3], [2, 1+4] ]. Second arg is the element type of the rows of the array. Scalar operations

UnOp UnOp SubExp

Unary operation.

BinOp BinOp SubExp SubExp

Binary operation.

CmpOp CmpOp SubExp SubExp

Comparison - result type is always boolean.

ConvOp ConvOp SubExp

Conversion "casting".

Assert SubExp (ErrorMsg SubExp) (SrcLoc, [SrcLoc])

Turn a boolean into a certificate, halting the program with the given error message if the boolean is false.

Index VName (Slice SubExp)

The certificates for bounds-checking are part of the Stm.

Update VName (Slice SubExp) SubExp

An in-place update of the given array at the given position. Consumes the array.

Concat Int VName [VName] SubExp

concat0([1],[2, 3, 4]) = [1, 2, 3, 4]@.

Copy VName

Copy the given array. The result will not alias anything.

Manifest [Int] VName

Manifest an array with dimensions represented in the given order. The result will not alias anything.

Iota SubExp SubExp SubExp IntType

iota(n, x, s) = [x,x+s,..,x+(n-1)*s].

The IntType indicates the type of the array returned and the offset/stride arguments, but not the length argument.

Replicate Shape SubExp
replicate([3][2],1) = [[1,1], [1,1], [1,1]]
Scratch PrimType [SubExp]

Create array of given type and shape, with undefined elements.

Reshape (ShapeChange SubExp) VName

1st arg is the new shape, 2nd arg is the input array *)

Rearrange [Int] VName

Permute the dimensions of the input array. The list of integers is a list of dimensions (0-indexed), which must be a permutation of [0,n-1], where n is the number of dimensions in the input array.

Rotate [SubExp] VName

Rotate the dimensions of the input array. The list of subexpressions specify how much each dimension is rotated. The length of this list must be equal to the rank of the array.

Instances

Instances details
Eq BasicOp Source # 
Instance details

Defined in Futhark.IR.Syntax

Methods

(==) :: BasicOp -> BasicOp -> Bool #

(/=) :: BasicOp -> BasicOp -> Bool #

Ord BasicOp Source # 
Instance details

Defined in Futhark.IR.Syntax

Show BasicOp Source # 
Instance details

Defined in Futhark.IR.Syntax

Generic BasicOp Source # 
Instance details

Defined in Futhark.IR.Syntax

Associated Types

type Rep BasicOp :: Type -> Type #

Methods

from :: BasicOp -> Rep BasicOp x #

to :: Rep BasicOp x -> BasicOp #

Pretty BasicOp Source # 
Instance details

Defined in Futhark.IR.Pretty

Methods

ppr :: BasicOp -> Doc #

pprPrec :: Int -> BasicOp -> Doc #

pprList :: [BasicOp] -> Doc #

SexpIso BasicOp Source # 
Instance details

Defined in Futhark.IR.Syntax

type Rep BasicOp Source # 
Instance details

Defined in Futhark.IR.Syntax

type Rep BasicOp = D1 ('MetaData "BasicOp" "Futhark.IR.Syntax" "futhark-0.17.1-inplace" 'False) ((((C1 ('MetaCons "SubExp" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 SubExp)) :+: C1 ('MetaCons "Opaque" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 SubExp))) :+: (C1 ('MetaCons "ArrayLit" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 [SubExp]) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Type)) :+: C1 ('MetaCons "UnOp" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 UnOp) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 SubExp)))) :+: ((C1 ('MetaCons "BinOp" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 BinOp) :*: (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 SubExp) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 SubExp))) :+: C1 ('MetaCons "CmpOp" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 CmpOp) :*: (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 SubExp) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 SubExp)))) :+: (C1 ('MetaCons "ConvOp" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 ConvOp) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 SubExp)) :+: (C1 ('MetaCons "Assert" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 SubExp) :*: (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (ErrorMsg SubExp)) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (SrcLoc, [SrcLoc])))) :+: C1 ('MetaCons "Index" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 VName) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Slice SubExp))))))) :+: (((C1 ('MetaCons "Update" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 VName) :*: (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Slice SubExp)) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 SubExp))) :+: C1 ('MetaCons "Concat" 'PrefixI 'False) ((S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Int) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 VName)) :*: (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 [VName]) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 SubExp)))) :+: (C1 ('MetaCons "Copy" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 VName)) :+: (C1 ('MetaCons "Manifest" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 [Int]) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 VName)) :+: C1 ('MetaCons "Iota" 'PrefixI 'False) ((S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 SubExp) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 SubExp)) :*: (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 SubExp) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 IntType)))))) :+: ((C1 ('MetaCons "Replicate" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Shape) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 SubExp)) :+: C1 ('MetaCons "Scratch" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 PrimType) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 [SubExp]))) :+: (C1 ('MetaCons "Reshape" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (ShapeChange SubExp)) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 VName)) :+: (C1 ('MetaCons "Rearrange" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 [Int]) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 VName)) :+: C1 ('MetaCons "Rotate" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 [SubExp]) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 VName)))))))

data UnOp Source #

Various unary operators. It is a bit ad-hoc what is a unary operator and what is a built-in function. Perhaps these should all go away eventually.

Constructors

Not

E.g., ! True == False.

Complement IntType

E.g., ~(~1) = 1.

Abs IntType

abs(-2) = 2.

FAbs FloatType

fabs(-2.0) = 2.0.

SSignum IntType

Signed sign function: ssignum(-2) = -1.

USignum IntType

Unsigned sign function: usignum(2) = 1.

Instances

Instances details
Eq UnOp Source # 
Instance details

Defined in Futhark.IR.Primitive

Methods

(==) :: UnOp -> UnOp -> Bool #

(/=) :: UnOp -> UnOp -> Bool #

Ord UnOp Source # 
Instance details

Defined in Futhark.IR.Primitive

Methods

compare :: UnOp -> UnOp -> Ordering #

(<) :: UnOp -> UnOp -> Bool #

(<=) :: UnOp -> UnOp -> Bool #

(>) :: UnOp -> UnOp -> Bool #

(>=) :: UnOp -> UnOp -> Bool #

max :: UnOp -> UnOp -> UnOp #

min :: UnOp -> UnOp -> UnOp #

Show UnOp Source # 
Instance details

Defined in Futhark.IR.Primitive

Methods

showsPrec :: Int -> UnOp -> ShowS #

show :: UnOp -> String #

showList :: [UnOp] -> ShowS #

Generic UnOp Source # 
Instance details

Defined in Futhark.IR.Primitive

Associated Types

type Rep UnOp :: Type -> Type #

Methods

from :: UnOp -> Rep UnOp x #

to :: Rep UnOp x -> UnOp #

Pretty UnOp Source # 
Instance details

Defined in Futhark.IR.Primitive

Methods

ppr :: UnOp -> Doc #

pprPrec :: Int -> UnOp -> Doc #

pprList :: [UnOp] -> Doc #

SexpIso UnOp Source # 
Instance details

Defined in Futhark.IR.Primitive

type Rep UnOp Source # 
Instance details

Defined in Futhark.IR.Primitive

data BinOp Source #

Binary operators. These correspond closely to the binary operators in LLVM. Most are parametrised by their expected input and output types.

Constructors

Add IntType Overflow

Integer addition.

FAdd FloatType

Floating-point addition.

Sub IntType Overflow

Integer subtraction.

FSub FloatType

Floating-point subtraction.

Mul IntType Overflow

Integer multiplication.

FMul FloatType

Floating-point multiplication.

UDiv IntType Safety

Unsigned integer division. Rounds towards negativity infinity. Note: this is different from LLVM.

UDivUp IntType Safety

Unsigned integer division. Rounds towards positive infinity.

SDiv IntType Safety

Signed integer division. Rounds towards negativity infinity. Note: this is different from LLVM.

SDivUp IntType Safety

Signed integer division. Rounds towards positive infinity.

FDiv FloatType

Floating-point division.

FMod FloatType

Floating-point modulus.

UMod IntType Safety

Unsigned integer modulus; the countepart to UDiv.

SMod IntType Safety

Signed integer modulus; the countepart to SDiv.

SQuot IntType Safety

Signed integer division. Rounds towards zero. This corresponds to the sdiv instruction in LLVM and integer division in C.

SRem IntType Safety

Signed integer division. Rounds towards zero. This corresponds to the srem instruction in LLVM and integer modulo in C.

SMin IntType

Returns the smallest of two signed integers.

UMin IntType

Returns the smallest of two unsigned integers.

FMin FloatType

Returns the smallest of two floating-point numbers.

SMax IntType

Returns the greatest of two signed integers.

UMax IntType

Returns the greatest of two unsigned integers.

FMax FloatType

Returns the greatest of two floating-point numbers.

Shl IntType

Left-shift.

LShr IntType

Logical right-shift, zero-extended.

AShr IntType

Arithmetic right-shift, sign-extended.

And IntType

Bitwise and.

Or IntType

Bitwise or.

Xor IntType

Bitwise exclusive-or.

Pow IntType

Integer exponentiation.

FPow FloatType

Floating-point exponentiation.

LogAnd

Boolean and - not short-circuiting.

LogOr

Boolean or - not short-circuiting.

Instances

Instances details
Eq BinOp Source # 
Instance details

Defined in Futhark.IR.Primitive

Methods

(==) :: BinOp -> BinOp -> Bool #

(/=) :: BinOp -> BinOp -> Bool #

Ord BinOp Source # 
Instance details

Defined in Futhark.IR.Primitive

Methods

compare :: BinOp -> BinOp -> Ordering #

(<) :: BinOp -> BinOp -> Bool #

(<=) :: BinOp -> BinOp -> Bool #

(>) :: BinOp -> BinOp -> Bool #

(>=) :: BinOp -> BinOp -> Bool #

max :: BinOp -> BinOp -> BinOp #

min :: BinOp -> BinOp -> BinOp #

Show BinOp Source # 
Instance details

Defined in Futhark.IR.Primitive

Methods

showsPrec :: Int -> BinOp -> ShowS #

show :: BinOp -> String #

showList :: [BinOp] -> ShowS #

Generic BinOp Source # 
Instance details

Defined in Futhark.IR.Primitive

Associated Types

type Rep BinOp :: Type -> Type #

Methods

from :: BinOp -> Rep BinOp x #

to :: Rep BinOp x -> BinOp #

Pretty BinOp Source # 
Instance details

Defined in Futhark.IR.Primitive

Methods

ppr :: BinOp -> Doc #

pprPrec :: Int -> BinOp -> Doc #

pprList :: [BinOp] -> Doc #

SexpIso BinOp Source # 
Instance details

Defined in Futhark.IR.Primitive

type Rep BinOp Source # 
Instance details

Defined in Futhark.IR.Primitive

type Rep BinOp = D1 ('MetaData "BinOp" "Futhark.IR.Primitive" "futhark-0.17.1-inplace" 'False) (((((C1 ('MetaCons "Add" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 IntType) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Overflow)) :+: C1 ('MetaCons "FAdd" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 FloatType))) :+: (C1 ('MetaCons "Sub" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 IntType) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Overflow)) :+: C1 ('MetaCons "FSub" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 FloatType)))) :+: ((C1 ('MetaCons "Mul" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 IntType) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Overflow)) :+: C1 ('MetaCons "FMul" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 FloatType))) :+: (C1 ('MetaCons "UDiv" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 IntType) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Safety)) :+: C1 ('MetaCons "UDivUp" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 IntType) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Safety))))) :+: (((C1 ('MetaCons "SDiv" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 IntType) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Safety)) :+: C1 ('MetaCons "SDivUp" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 IntType) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Safety))) :+: (C1 ('MetaCons "FDiv" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 FloatType)) :+: C1 ('MetaCons "FMod" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 FloatType)))) :+: ((C1 ('MetaCons "UMod" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 IntType) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Safety)) :+: C1 ('MetaCons "SMod" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 IntType) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Safety))) :+: (C1 ('MetaCons "SQuot" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 IntType) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Safety)) :+: C1 ('MetaCons "SRem" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 IntType) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Safety)))))) :+: ((((C1 ('MetaCons "SMin" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 IntType)) :+: C1 ('MetaCons "UMin" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 IntType))) :+: (C1 ('MetaCons "FMin" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 FloatType)) :+: C1 ('MetaCons "SMax" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 IntType)))) :+: ((C1 ('MetaCons "UMax" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 IntType)) :+: C1 ('MetaCons "FMax" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 FloatType))) :+: (C1 ('MetaCons "Shl" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 IntType)) :+: C1 ('MetaCons "LShr" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 IntType))))) :+: (((C1 ('MetaCons "AShr" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 IntType)) :+: C1 ('MetaCons "And" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 IntType))) :+: (C1 ('MetaCons "Or" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 IntType)) :+: C1 ('MetaCons "Xor" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 IntType)))) :+: ((C1 ('MetaCons "Pow" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 IntType)) :+: C1 ('MetaCons "FPow" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 FloatType))) :+: (C1 ('MetaCons "LogAnd" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "LogOr" 'PrefixI 'False) (U1 :: Type -> Type))))))

data CmpOp Source #

Comparison operators are like BinOps, but they always return a boolean value. The somewhat ugly constructor names are straight out of LLVM.

Constructors

CmpEq PrimType

All types equality.

CmpUlt IntType

Unsigned less than.

CmpUle IntType

Unsigned less than or equal.

CmpSlt IntType

Signed less than.

CmpSle IntType

Signed less than or equal.

FCmpLt FloatType

Floating-point less than.

FCmpLe FloatType

Floating-point less than or equal.

CmpLlt

Boolean less than.

CmpLle

Boolean less than or equal.

Instances

Instances details
Eq CmpOp Source # 
Instance details

Defined in Futhark.IR.Primitive

Methods

(==) :: CmpOp -> CmpOp -> Bool #

(/=) :: CmpOp -> CmpOp -> Bool #

Ord CmpOp Source # 
Instance details

Defined in Futhark.IR.Primitive

Methods

compare :: CmpOp -> CmpOp -> Ordering #

(<) :: CmpOp -> CmpOp -> Bool #

(<=) :: CmpOp -> CmpOp -> Bool #

(>) :: CmpOp -> CmpOp -> Bool #

(>=) :: CmpOp -> CmpOp -> Bool #

max :: CmpOp -> CmpOp -> CmpOp #

min :: CmpOp -> CmpOp -> CmpOp #

Show CmpOp Source # 
Instance details

Defined in Futhark.IR.Primitive

Methods

showsPrec :: Int -> CmpOp -> ShowS #

show :: CmpOp -> String #

showList :: [CmpOp] -> ShowS #

Generic CmpOp Source # 
Instance details

Defined in Futhark.IR.Primitive

Associated Types

type Rep CmpOp :: Type -> Type #

Methods

from :: CmpOp -> Rep CmpOp x #

to :: Rep CmpOp x -> CmpOp #

Pretty CmpOp Source # 
Instance details

Defined in Futhark.IR.Primitive

Methods

ppr :: CmpOp -> Doc #

pprPrec :: Int -> CmpOp -> Doc #

pprList :: [CmpOp] -> Doc #

SexpIso CmpOp Source # 
Instance details

Defined in Futhark.IR.Primitive

type Rep CmpOp Source # 
Instance details

Defined in Futhark.IR.Primitive

data ConvOp Source #

Conversion operators try to generalise the from t0 x to t1 instructions from LLVM.

Constructors

ZExt IntType IntType

Zero-extend the former integer type to the latter. If the new type is smaller, the result is a truncation.

SExt IntType IntType

Sign-extend the former integer type to the latter. If the new type is smaller, the result is a truncation.

FPConv FloatType FloatType

Convert value of the former floating-point type to the latter. If the new type is smaller, the result is a truncation.

FPToUI FloatType IntType

Convert a floating-point value to the nearest unsigned integer (rounding towards zero).

FPToSI FloatType IntType

Convert a floating-point value to the nearest signed integer (rounding towards zero).

UIToFP IntType FloatType

Convert an unsigned integer to a floating-point value.

SIToFP IntType FloatType

Convert a signed integer to a floating-point value.

IToB IntType

Convert an integer to a boolean value. Zero becomes false; anything else is true.

BToI IntType

Convert a boolean to an integer. True is converted to 1 and False to 0.

Instances

Instances details
Eq ConvOp Source # 
Instance details

Defined in Futhark.IR.Primitive

Methods

(==) :: ConvOp -> ConvOp -> Bool #

(/=) :: ConvOp -> ConvOp -> Bool #

Ord ConvOp Source # 
Instance details

Defined in Futhark.IR.Primitive

Show ConvOp Source # 
Instance details

Defined in Futhark.IR.Primitive

Generic ConvOp Source # 
Instance details

Defined in Futhark.IR.Primitive

Associated Types

type Rep ConvOp :: Type -> Type #

Methods

from :: ConvOp -> Rep ConvOp x #

to :: Rep ConvOp x -> ConvOp #

Pretty ConvOp Source # 
Instance details

Defined in Futhark.IR.Primitive

Methods

ppr :: ConvOp -> Doc #

pprPrec :: Int -> ConvOp -> Doc #

pprList :: [ConvOp] -> Doc #

SexpIso ConvOp Source # 
Instance details

Defined in Futhark.IR.Primitive

type Rep ConvOp Source # 
Instance details

Defined in Futhark.IR.Primitive

type Rep ConvOp = D1 ('MetaData "ConvOp" "Futhark.IR.Primitive" "futhark-0.17.1-inplace" 'False) (((C1 ('MetaCons "ZExt" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 IntType) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 IntType)) :+: C1 ('MetaCons "SExt" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 IntType) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 IntType))) :+: (C1 ('MetaCons "FPConv" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 FloatType) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 FloatType)) :+: C1 ('MetaCons "FPToUI" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 FloatType) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 IntType)))) :+: ((C1 ('MetaCons "FPToSI" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 FloatType) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 IntType)) :+: C1 ('MetaCons "UIToFP" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 IntType) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 FloatType))) :+: (C1 ('MetaCons "SIToFP" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 IntType) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 FloatType)) :+: (C1 ('MetaCons "IToB" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 IntType)) :+: C1 ('MetaCons "BToI" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 IntType))))))

data DimChange d Source #

The new dimension in a Reshape-like operation. This allows us to disambiguate "real" reshapes, that change the actual shape of the array, from type coercions that are just present to make the types work out. The two constructors are considered equal for purposes of Eq.

Constructors

DimCoercion d

The new dimension is guaranteed to be numerically equal to the old one.

DimNew d

The new dimension is not necessarily numerically equal to the old one.

Instances

Instances details
Functor DimChange Source # 
Instance details

Defined in Futhark.IR.Syntax

Methods

fmap :: (a -> b) -> DimChange a -> DimChange b #

(<$) :: a -> DimChange b -> DimChange a #

Foldable DimChange Source # 
Instance details

Defined in Futhark.IR.Syntax

Methods

fold :: Monoid m => DimChange m -> m #

foldMap :: Monoid m => (a -> m) -> DimChange a -> m #

foldMap' :: Monoid m => (a -> m) -> DimChange a -> m #

foldr :: (a -> b -> b) -> b -> DimChange a -> b #

foldr' :: (a -> b -> b) -> b -> DimChange a -> b #

foldl :: (b -> a -> b) -> b -> DimChange a -> b #

foldl' :: (b -> a -> b) -> b -> DimChange a -> b #

foldr1 :: (a -> a -> a) -> DimChange a -> a #

foldl1 :: (a -> a -> a) -> DimChange a -> a #

toList :: DimChange a -> [a] #

null :: DimChange a -> Bool #

length :: DimChange a -> Int #

elem :: Eq a => a -> DimChange a -> Bool #

maximum :: Ord a => DimChange a -> a #

minimum :: Ord a => DimChange a -> a #

sum :: Num a => DimChange a -> a #

product :: Num a => DimChange a -> a #

Traversable DimChange Source # 
Instance details

Defined in Futhark.IR.Syntax

Methods

traverse :: Applicative f => (a -> f b) -> DimChange a -> f (DimChange b) #

sequenceA :: Applicative f => DimChange (f a) -> f (DimChange a) #

mapM :: Monad m => (a -> m b) -> DimChange a -> m (DimChange b) #

sequence :: Monad m => DimChange (m a) -> m (DimChange a) #

Eq d => Eq (DimChange d) Source # 
Instance details

Defined in Futhark.IR.Syntax

Methods

(==) :: DimChange d -> DimChange d -> Bool #

(/=) :: DimChange d -> DimChange d -> Bool #

Ord d => Ord (DimChange d) Source # 
Instance details

Defined in Futhark.IR.Syntax

Show d => Show (DimChange d) Source # 
Instance details

Defined in Futhark.IR.Syntax

Generic (DimChange d) Source # 
Instance details

Defined in Futhark.IR.Syntax

Associated Types

type Rep (DimChange d) :: Type -> Type #

Methods

from :: DimChange d -> Rep (DimChange d) x #

to :: Rep (DimChange d) x -> DimChange d #

Pretty d => Pretty (DimChange d) Source # 
Instance details

Defined in Futhark.IR.Pretty

Methods

ppr :: DimChange d -> Doc #

pprPrec :: Int -> DimChange d -> Doc #

pprList :: [DimChange d] -> Doc #

SexpIso d => SexpIso (DimChange d) Source # 
Instance details

Defined in Futhark.IR.Syntax

FreeIn d => FreeIn (DimChange d) Source # 
Instance details

Defined in Futhark.IR.Prop.Names

Methods

freeIn' :: DimChange d -> FV Source #

Substitute d => Substitute (DimChange d) Source # 
Instance details

Defined in Futhark.Transform.Substitute

type Rep (DimChange d) Source # 
Instance details

Defined in Futhark.IR.Syntax

type Rep (DimChange d) = D1 ('MetaData "DimChange" "Futhark.IR.Syntax" "futhark-0.17.1-inplace" 'False) (C1 ('MetaCons "DimCoercion" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 d)) :+: C1 ('MetaCons "DimNew" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 d)))

type ShapeChange d = [DimChange d] Source #

A list of DimChanges, indicating the new dimensions of an array.

data ExpT lore Source #

The root Futhark expression type. The Op constructor contains a lore-specific operation. Do-loops, branches and function calls are special. Everything else is a simple BasicOp.

Constructors

BasicOp BasicOp

A simple (non-recursive) operation.

Apply Name [(SubExp, Diet)] [RetType lore] (Safety, SrcLoc, [SrcLoc]) 
If SubExp (BodyT lore) (BodyT lore) (IfDec (BranchType lore)) 
DoLoop [(FParam lore, SubExp)] [(FParam lore, SubExp)] (LoopForm lore) (BodyT lore)

loop {a} = {v} (for i < n|while b) do b. The merge parameters are divided into context and value part.

Op (Op lore) 

Instances

Instances details
Decorations lore => Eq (ExpT lore) Source # 
Instance details

Defined in Futhark.IR.Syntax

Methods

(==) :: ExpT lore -> ExpT lore -> Bool #

(/=) :: ExpT lore -> ExpT lore -> Bool #

Decorations lore => Ord (ExpT lore) Source # 
Instance details

Defined in Futhark.IR.Syntax

Methods

compare :: ExpT lore -> ExpT lore -> Ordering #

(<) :: ExpT lore -> ExpT lore -> Bool #

(<=) :: ExpT lore -> ExpT lore -> Bool #

(>) :: ExpT lore -> ExpT lore -> Bool #

(>=) :: ExpT lore -> ExpT lore -> Bool #

max :: ExpT lore -> ExpT lore -> ExpT lore #

min :: ExpT lore -> ExpT lore -> ExpT lore #

Decorations lore => Show (ExpT lore) Source # 
Instance details

Defined in Futhark.IR.Syntax

Methods

showsPrec :: Int -> ExpT lore -> ShowS #

show :: ExpT lore -> String #

showList :: [ExpT lore] -> ShowS #

Generic (ExpT lore) Source # 
Instance details

Defined in Futhark.IR.Syntax

Associated Types

type Rep (ExpT lore) :: Type -> Type #

Methods

from :: ExpT lore -> Rep (ExpT lore) x #

to :: Rep (ExpT lore) x -> ExpT lore #

PrettyLore lore => Pretty (Exp lore) Source # 
Instance details

Defined in Futhark.IR.Pretty

Methods

ppr :: Exp lore -> Doc #

pprPrec :: Int -> Exp lore -> Doc #

pprList :: [Exp lore] -> Doc #

Decorations lore => SexpIso (ExpT lore) Source # 
Instance details

Defined in Futhark.IR.Syntax

Methods

sexpIso :: SexpGrammar (ExpT lore) #

(FreeDec (ExpDec lore), FreeDec (BodyDec lore), FreeIn (FParamInfo lore), FreeIn (LParamInfo lore), FreeIn (LetDec lore), FreeIn (Op lore)) => FreeIn (Exp lore) Source # 
Instance details

Defined in Futhark.IR.Prop.Names

Methods

freeIn' :: Exp lore -> FV Source #

Substitutable lore => Substitute (Exp lore) Source # 
Instance details

Defined in Futhark.Transform.Substitute

Methods

substituteNames :: Map VName VName -> Exp lore -> Exp lore Source #

Renameable lore => Rename (Exp lore) Source # 
Instance details

Defined in Futhark.Transform.Rename

Methods

rename :: Exp lore -> RenameM (Exp lore) Source #

type Rep (ExpT lore) Source # 
Instance details

Defined in Futhark.IR.Syntax

type Rep (ExpT lore) = D1 ('MetaData "ExpT" "Futhark.IR.Syntax" "futhark-0.17.1-inplace" 'False) ((C1 ('MetaCons "BasicOp" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 BasicOp)) :+: C1 ('MetaCons "Apply" 'PrefixI 'False) ((S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Name) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 [(SubExp, Diet)])) :*: (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 [RetType lore]) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Safety, SrcLoc, [SrcLoc]))))) :+: (C1 ('MetaCons "If" 'PrefixI 'False) ((S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 SubExp) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (BodyT lore))) :*: (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (BodyT lore)) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (IfDec (BranchType lore))))) :+: (C1 ('MetaCons "DoLoop" 'PrefixI 'False) ((S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 [(FParam lore, SubExp)]) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 [(FParam lore, SubExp)])) :*: (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (LoopForm lore)) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (BodyT lore)))) :+: C1 ('MetaCons "Op" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Op lore))))))

type Exp = ExpT Source #

A type alias for namespace control.

data LoopForm lore Source #

For-loop or while-loop?

Instances

Instances details
Scoped lore (LoopForm lore) Source # 
Instance details

Defined in Futhark.IR.Prop.Scope

Methods

scopeOf :: LoopForm lore -> Scope lore Source #

Decorations lore => Eq (LoopForm lore) Source # 
Instance details

Defined in Futhark.IR.Syntax

Methods

(==) :: LoopForm lore -> LoopForm lore -> Bool #

(/=) :: LoopForm lore -> LoopForm lore -> Bool #

Decorations lore => Ord (LoopForm lore) Source # 
Instance details

Defined in Futhark.IR.Syntax

Methods

compare :: LoopForm lore -> LoopForm lore -> Ordering #

(<) :: LoopForm lore -> LoopForm lore -> Bool #

(<=) :: LoopForm lore -> LoopForm lore -> Bool #

(>) :: LoopForm lore -> LoopForm lore -> Bool #

(>=) :: LoopForm lore -> LoopForm lore -> Bool #

max :: LoopForm lore -> LoopForm lore -> LoopForm lore #

min :: LoopForm lore -> LoopForm lore -> LoopForm lore #

Decorations lore => Show (LoopForm lore) Source # 
Instance details

Defined in Futhark.IR.Syntax

Methods

showsPrec :: Int -> LoopForm lore -> ShowS #

show :: LoopForm lore -> String #

showList :: [LoopForm lore] -> ShowS #

Generic (LoopForm lore) Source # 
Instance details

Defined in Futhark.IR.Syntax

Associated Types

type Rep (LoopForm lore) :: Type -> Type #

Methods

from :: LoopForm lore -> Rep (LoopForm lore) x #

to :: Rep (LoopForm lore) x -> LoopForm lore #

Decorations lore => SexpIso (LoopForm lore) Source # 
Instance details

Defined in Futhark.IR.Syntax

Methods

sexpIso :: SexpGrammar (LoopForm lore) #

FreeIn (LParamInfo lore) => FreeIn (LoopForm lore) Source # 
Instance details

Defined in Futhark.IR.Prop.Names

Methods

freeIn' :: LoopForm lore -> FV Source #

type Rep (LoopForm lore) Source # 
Instance details

Defined in Futhark.IR.Syntax

data IfDec rt Source #

Data associated with a branch.

Constructors

IfDec 

Fields

Instances

Instances details
Eq rt => Eq (IfDec rt) Source # 
Instance details

Defined in Futhark.IR.Syntax

Methods

(==) :: IfDec rt -> IfDec rt -> Bool #

(/=) :: IfDec rt -> IfDec rt -> Bool #

Ord rt => Ord (IfDec rt) Source # 
Instance details

Defined in Futhark.IR.Syntax

Methods

compare :: IfDec rt -> IfDec rt -> Ordering #

(<) :: IfDec rt -> IfDec rt -> Bool #

(<=) :: IfDec rt -> IfDec rt -> Bool #

(>) :: IfDec rt -> IfDec rt -> Bool #

(>=) :: IfDec rt -> IfDec rt -> Bool #

max :: IfDec rt -> IfDec rt -> IfDec rt #

min :: IfDec rt -> IfDec rt -> IfDec rt #

Show rt => Show (IfDec rt) Source # 
Instance details

Defined in Futhark.IR.Syntax

Methods

showsPrec :: Int -> IfDec rt -> ShowS #

show :: IfDec rt -> String #

showList :: [IfDec rt] -> ShowS #

Generic (IfDec rt) Source # 
Instance details

Defined in Futhark.IR.Syntax

Associated Types

type Rep (IfDec rt) :: Type -> Type #

Methods

from :: IfDec rt -> Rep (IfDec rt) x #

to :: Rep (IfDec rt) x -> IfDec rt #

SexpIso rt => SexpIso (IfDec rt) Source # 
Instance details

Defined in Futhark.IR.Syntax

Methods

sexpIso :: SexpGrammar (IfDec rt) #

FreeIn a => FreeIn (IfDec a) Source # 
Instance details

Defined in Futhark.IR.Prop.Names

Methods

freeIn' :: IfDec a -> FV Source #

type Rep (IfDec rt) Source # 
Instance details

Defined in Futhark.IR.Syntax

type Rep (IfDec rt) = D1 ('MetaData "IfDec" "Futhark.IR.Syntax" "futhark-0.17.1-inplace" 'False) (C1 ('MetaCons "IfDec" 'PrefixI 'True) (S1 ('MetaSel ('Just "ifReturns") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 [rt]) :*: S1 ('MetaSel ('Just "ifSort") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 IfSort)))

data IfSort Source #

What kind of branch is this? This has no semantic meaning, but provides hints to simplifications.

Constructors

IfNormal

An ordinary branch.

IfFallback

A branch where the "true" case is what we are actually interested in, and the "false" case is only present as a fallback for when the true case cannot be safely evaluated. The compiler is permitted to optimise away the branch if the true case contains only safe statements.

IfEquiv

Both of these branches are semantically equivalent, and it is fine to eliminate one if it turns out to have problems (e.g. contain things we cannot generate code for).

Instances

Instances details
Eq IfSort Source # 
Instance details

Defined in Futhark.IR.Syntax

Methods

(==) :: IfSort -> IfSort -> Bool #

(/=) :: IfSort -> IfSort -> Bool #

Ord IfSort Source # 
Instance details

Defined in Futhark.IR.Syntax

Show IfSort Source # 
Instance details

Defined in Futhark.IR.Syntax

Generic IfSort Source # 
Instance details

Defined in Futhark.IR.Syntax

Associated Types

type Rep IfSort :: Type -> Type #

Methods

from :: IfSort -> Rep IfSort x #

to :: Rep IfSort x -> IfSort #

SexpIso IfSort Source # 
Instance details

Defined in Futhark.IR.Syntax

type Rep IfSort Source # 
Instance details

Defined in Futhark.IR.Syntax

type Rep IfSort = D1 ('MetaData "IfSort" "Futhark.IR.Syntax" "futhark-0.17.1-inplace" 'False) (C1 ('MetaCons "IfNormal" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "IfFallback" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "IfEquiv" 'PrefixI 'False) (U1 :: Type -> Type)))

data Safety Source #

Whether something is safe or unsafe (mostly function calls, and in the context of whether operations are dynamically checked). When we inline an Unsafe function, we remove all safety checks in its body. The Ord instance picks Unsafe as being less than Safe.

For operations like integer division, a safe division will not explode the computer in case of division by zero, but instead return some unspecified value. This always involves a run-time check, so generally the unsafe variant is what the compiler will insert, but guarded by an explicit assertion elsewhere. Safe operations are useful when the optimiser wants to move e.g. a division to a location where the divisor may be zero, but where the result will only be used when it is non-zero (so it doesn't matter what result is provided with a zero divisor, as long as the program keeps running).

Constructors

Unsafe 
Safe 

Instances

Instances details
Eq Safety Source # 
Instance details

Defined in Futhark.IR.Primitive

Methods

(==) :: Safety -> Safety -> Bool #

(/=) :: Safety -> Safety -> Bool #

Ord Safety Source # 
Instance details

Defined in Futhark.IR.Primitive

Show Safety Source # 
Instance details

Defined in Futhark.IR.Primitive

Generic Safety Source # 
Instance details

Defined in Futhark.IR.Primitive

Associated Types

type Rep Safety :: Type -> Type #

Methods

from :: Safety -> Rep Safety x #

to :: Rep Safety x -> Safety #

SexpIso Safety Source # 
Instance details

Defined in Futhark.IR.Primitive

type Rep Safety Source # 
Instance details

Defined in Futhark.IR.Primitive

type Rep Safety = D1 ('MetaData "Safety" "Futhark.IR.Primitive" "futhark-0.17.1-inplace" 'False) (C1 ('MetaCons "Unsafe" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "Safe" 'PrefixI 'False) (U1 :: Type -> Type))

data LambdaT lore Source #

Anonymous function for use in a SOAC.

Constructors

Lambda 

Fields

Instances

Instances details
Scoped lore (Lambda lore) Source # 
Instance details

Defined in Futhark.IR.Prop.Scope

Methods

scopeOf :: Lambda lore -> Scope lore Source #

Decorations lore => Eq (LambdaT lore) Source # 
Instance details

Defined in Futhark.IR.Syntax

Methods

(==) :: LambdaT lore -> LambdaT lore -> Bool #

(/=) :: LambdaT lore -> LambdaT lore -> Bool #

Decorations lore => Ord (LambdaT lore) Source # 
Instance details

Defined in Futhark.IR.Syntax

Methods

compare :: LambdaT lore -> LambdaT lore -> Ordering #

(<) :: LambdaT lore -> LambdaT lore -> Bool #

(<=) :: LambdaT lore -> LambdaT lore -> Bool #

(>) :: LambdaT lore -> LambdaT lore -> Bool #

(>=) :: LambdaT lore -> LambdaT lore -> Bool #

max :: LambdaT lore -> LambdaT lore -> LambdaT lore #

min :: LambdaT lore -> LambdaT lore -> LambdaT lore #

Decorations lore => Show (LambdaT lore) Source # 
Instance details

Defined in Futhark.IR.Syntax

Methods

showsPrec :: Int -> LambdaT lore -> ShowS #

show :: LambdaT lore -> String #

showList :: [LambdaT lore] -> ShowS #

Generic (LambdaT lore) Source # 
Instance details

Defined in Futhark.IR.Syntax

Associated Types

type Rep (LambdaT lore) :: Type -> Type #

Methods

from :: LambdaT lore -> Rep (LambdaT lore) x #

to :: Rep (LambdaT lore) x -> LambdaT lore #

PrettyLore lore => Pretty (Lambda lore) Source # 
Instance details

Defined in Futhark.IR.Pretty

Methods

ppr :: Lambda lore -> Doc #

pprPrec :: Int -> Lambda lore -> Doc #

pprList :: [Lambda lore] -> Doc #

Decorations lore => SexpIso (LambdaT lore) Source # 
Instance details

Defined in Futhark.IR.Syntax

Methods

sexpIso :: SexpGrammar (LambdaT lore) #

(FreeDec (ExpDec lore), FreeDec (BodyDec lore), FreeIn (FParamInfo lore), FreeIn (LParamInfo lore), FreeIn (LetDec lore), FreeIn (Op lore)) => FreeIn (Lambda lore) Source # 
Instance details

Defined in Futhark.IR.Prop.Names

Methods

freeIn' :: Lambda lore -> FV Source #

Substitutable lore => Substitute (Lambda lore) Source # 
Instance details

Defined in Futhark.Transform.Substitute

Methods

substituteNames :: Map VName VName -> Lambda lore -> Lambda lore Source #

Renameable lore => Rename (Lambda lore) Source # 
Instance details

Defined in Futhark.Transform.Rename

Methods

rename :: Lambda lore -> RenameM (Lambda lore) Source #

type Rep (LambdaT lore) Source # 
Instance details

Defined in Futhark.IR.Syntax

type Rep (LambdaT lore) = D1 ('MetaData "LambdaT" "Futhark.IR.Syntax" "futhark-0.17.1-inplace" 'False) (C1 ('MetaCons "Lambda" 'PrefixI 'True) (S1 ('MetaSel ('Just "lambdaParams") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 [LParam lore]) :*: (S1 ('MetaSel ('Just "lambdaBody") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (BodyT lore)) :*: S1 ('MetaSel ('Just "lambdaReturnType") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 [Type]))))

type Lambda = LambdaT Source #

Type alias for namespacing reasons.

Definitions

data Param dec Source #

A function or lambda parameter.

Constructors

Param 

Fields

Instances

Instances details
Functor Param Source # 
Instance details

Defined in Futhark.IR.Syntax.Core

Methods

fmap :: (a -> b) -> Param a -> Param b #

(<$) :: a -> Param b -> Param a #

Foldable Param Source # 
Instance details

Defined in Futhark.IR.Syntax.Core

Methods

fold :: Monoid m => Param m -> m #

foldMap :: Monoid m => (a -> m) -> Param a -> m #

foldMap' :: Monoid m => (a -> m) -> Param a -> m #

foldr :: (a -> b -> b) -> b -> Param a -> b #

foldr' :: (a -> b -> b) -> b -> Param a -> b #

foldl :: (b -> a -> b) -> b -> Param a -> b #

foldl' :: (b -> a -> b) -> b -> Param a -> b #

foldr1 :: (a -> a -> a) -> Param a -> a #

foldl1 :: (a -> a -> a) -> Param a -> a #

toList :: Param a -> [a] #

null :: Param a -> Bool #

length :: Param a -> Int #

elem :: Eq a => a -> Param a -> Bool #

maximum :: Ord a => Param a -> a #

minimum :: Ord a => Param a -> a #

sum :: Num a => Param a -> a #

product :: Num a => Param a -> a #

Traversable Param Source # 
Instance details

Defined in Futhark.IR.Syntax.Core

Methods

traverse :: Applicative f => (a -> f b) -> Param a -> f (Param b) #

sequenceA :: Applicative f => Param (f a) -> f (Param a) #

mapM :: Monad m => (a -> m b) -> Param a -> m (Param b) #

sequence :: Monad m => Param (m a) -> m (Param a) #

Eq dec => Eq (Param dec) Source # 
Instance details

Defined in Futhark.IR.Syntax.Core

Methods

(==) :: Param dec -> Param dec -> Bool #

(/=) :: Param dec -> Param dec -> Bool #

Ord dec => Ord (Param dec) Source # 
Instance details

Defined in Futhark.IR.Syntax.Core

Methods

compare :: Param dec -> Param dec -> Ordering #

(<) :: Param dec -> Param dec -> Bool #

(<=) :: Param dec -> Param dec -> Bool #

(>) :: Param dec -> Param dec -> Bool #

(>=) :: Param dec -> Param dec -> Bool #

max :: Param dec -> Param dec -> Param dec #

min :: Param dec -> Param dec -> Param dec #

Show dec => Show (Param dec) Source # 
Instance details

Defined in Futhark.IR.Syntax.Core

Methods

showsPrec :: Int -> Param dec -> ShowS #

show :: Param dec -> String #

showList :: [Param dec] -> ShowS #

Generic (Param dec) Source # 
Instance details

Defined in Futhark.IR.Syntax.Core

Associated Types

type Rep (Param dec) :: Type -> Type #

Methods

from :: Param dec -> Rep (Param dec) x #

to :: Rep (Param dec) x -> Param dec #

Pretty (Param b) => Pretty (Param (a, b)) Source # 
Instance details

Defined in Futhark.IR.Pretty

Methods

ppr :: Param (a, b) -> Doc #

pprPrec :: Int -> Param (a, b) -> Doc #

pprList :: [Param (a, b)] -> Doc #

Pretty (Param DeclType) Source # 
Instance details

Defined in Futhark.IR.Pretty

Pretty (Param Type) Source # 
Instance details

Defined in Futhark.IR.Pretty

Methods

ppr :: Param Type -> Doc #

pprPrec :: Int -> Param Type -> Doc #

pprList :: [Param Type] -> Doc #

Pretty (Param (MemInfo SubExp Uniqueness ret)) Source # 
Instance details

Defined in Futhark.IR.Mem

Pretty (Param (MemInfo SubExp NoUniqueness ret)) Source # 
Instance details

Defined in Futhark.IR.Mem

SexpIso dec => SexpIso (Param dec) Source # 
Instance details

Defined in Futhark.IR.Syntax.Core

Methods

sexpIso :: SexpGrammar (Param dec) #

DeclTyped dec => DeclTyped (Param dec) Source # 
Instance details

Defined in Futhark.IR.Prop.Types

Methods

declTypeOf :: Param dec -> DeclType Source #

Typed dec => Typed (Param dec) Source # 
Instance details

Defined in Futhark.IR.Prop.Types

Methods

typeOf :: Param dec -> Type Source #

PrettyAnnot (Param (TypeBase shape u)) Source # 
Instance details

Defined in Futhark.IR.Pretty

Methods

ppAnnot :: Param (TypeBase shape u) -> Maybe Doc Source #

(Pretty u, Pretty r) => PrettyAnnot (Param (MemInfo SubExp u r)) Source # 
Instance details

Defined in Futhark.IR.Mem

FreeIn dec => FreeIn (Param dec) Source # 
Instance details

Defined in Futhark.IR.Prop.Names

Methods

freeIn' :: Param dec -> FV Source #

Substitute dec => Substitute (Param dec) Source # 
Instance details

Defined in Futhark.Transform.Substitute

Methods

substituteNames :: Map VName VName -> Param dec -> Param dec Source #

Rename dec => Rename (Param dec) Source # 
Instance details

Defined in Futhark.Transform.Rename

Methods

rename :: Param dec -> RenameM (Param dec) Source #

type Rep (Param dec) Source # 
Instance details

Defined in Futhark.IR.Syntax.Core

type Rep (Param dec) = D1 ('MetaData "Param" "Futhark.IR.Syntax.Core" "futhark-0.17.1-inplace" 'False) (C1 ('MetaCons "Param" 'PrefixI 'True) (S1 ('MetaSel ('Just "paramName") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 VName) :*: S1 ('MetaSel ('Just "paramDec") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 dec)))

type FParam lore = Param (FParamInfo lore) Source #

A function and loop parameter.

type LParam lore = Param (LParamInfo lore) Source #

A lambda parameter.

data FunDef lore Source #

Function Declarations

Constructors

FunDef 

Fields

Instances

Instances details
Scoped lore (FunDef lore) Source # 
Instance details

Defined in Futhark.IR.Prop.Scope

Methods

scopeOf :: FunDef lore -> Scope lore Source #

Decorations lore => Eq (FunDef lore) Source # 
Instance details

Defined in Futhark.IR.Syntax

Methods

(==) :: FunDef lore -> FunDef lore -> Bool #

(/=) :: FunDef lore -> FunDef lore -> Bool #

Decorations lore => Ord (FunDef lore) Source # 
Instance details

Defined in Futhark.IR.Syntax

Methods

compare :: FunDef lore -> FunDef lore -> Ordering #

(<) :: FunDef lore -> FunDef lore -> Bool #

(<=) :: FunDef lore -> FunDef lore -> Bool #

(>) :: FunDef lore -> FunDef lore -> Bool #

(>=) :: FunDef lore -> FunDef lore -> Bool #

max :: FunDef lore -> FunDef lore -> FunDef lore #

min :: FunDef lore -> FunDef lore -> FunDef lore #

Decorations lore => Show (FunDef lore) Source # 
Instance details

Defined in Futhark.IR.Syntax

Methods

showsPrec :: Int -> FunDef lore -> ShowS #

show :: FunDef lore -> String #

showList :: [FunDef lore] -> ShowS #

Generic (FunDef lore) Source # 
Instance details

Defined in Futhark.IR.Syntax

Associated Types

type Rep (FunDef lore) :: Type -> Type #

Methods

from :: FunDef lore -> Rep (FunDef lore) x #

to :: Rep (FunDef lore) x -> FunDef lore #

PrettyLore lore => Pretty (FunDef lore) Source # 
Instance details

Defined in Futhark.IR.Pretty

Methods

ppr :: FunDef lore -> Doc #

pprPrec :: Int -> FunDef lore -> Doc #

pprList :: [FunDef lore] -> Doc #

Decorations lore => SexpIso (FunDef lore) Source # 
Instance details

Defined in Futhark.IR.Syntax

Methods

sexpIso :: SexpGrammar (FunDef lore) #

(FreeDec (ExpDec lore), FreeDec (BodyDec lore), FreeIn (FParamInfo lore), FreeIn (LParamInfo lore), FreeIn (LetDec lore), FreeIn (RetType lore), FreeIn (Op lore)) => FreeIn (FunDef lore) Source # 
Instance details

Defined in Futhark.IR.Prop.Names

Methods

freeIn' :: FunDef lore -> FV Source #

Renameable lore => Rename (FunDef lore) Source # 
Instance details

Defined in Futhark.Transform.Rename

Methods

rename :: FunDef lore -> RenameM (FunDef lore) Source #

type Rep (FunDef lore) Source # 
Instance details

Defined in Futhark.IR.Syntax

type EntryPoint = ([EntryPointType], [EntryPointType]) Source #

Information about the parameters and return value of an entry point. The first element is for parameters, the second for return value.

data EntryPointType Source #

Every entry point argument and return value has an annotation indicating how it maps to the original source program type.

Constructors

TypeUnsigned

Is an unsigned integer or array of unsigned integers.

TypeOpaque String Int

A black box type comprising this many core values. The string is a human-readable description with no other semantics.

TypeDirect

Maps directly.

Instances

Instances details
Eq EntryPointType Source # 
Instance details

Defined in Futhark.IR.Syntax

Ord EntryPointType Source # 
Instance details

Defined in Futhark.IR.Syntax

Show EntryPointType Source # 
Instance details

Defined in Futhark.IR.Syntax

Generic EntryPointType Source # 
Instance details

Defined in Futhark.IR.Syntax

Associated Types

type Rep EntryPointType :: Type -> Type #

SexpIso EntryPointType Source # 
Instance details

Defined in Futhark.IR.Syntax

type Rep EntryPointType Source # 
Instance details

Defined in Futhark.IR.Syntax

type Rep EntryPointType = D1 ('MetaData "EntryPointType" "Futhark.IR.Syntax" "futhark-0.17.1-inplace" 'False) (C1 ('MetaCons "TypeUnsigned" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "TypeOpaque" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 String) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Int)) :+: C1 ('MetaCons "TypeDirect" 'PrefixI 'False) (U1 :: Type -> Type)))

data Prog lore Source #

An entire Futhark program.

Constructors

Prog 

Fields

  • progConsts :: Stms lore

    Top-level constants that are computed at program startup, and which are in scope inside all functions.

  • progFuns :: [FunDef lore]

    The functions comprising the program. All funtions are also available in scope in the definitions of the constants, so be careful not to introduce circular dependencies (not currently checked).

Instances

Instances details
Decorations lore => Eq (Prog lore) Source # 
Instance details

Defined in Futhark.IR.Syntax

Methods

(==) :: Prog lore -> Prog lore -> Bool #

(/=) :: Prog lore -> Prog lore -> Bool #

Decorations lore => Ord (Prog lore) Source # 
Instance details

Defined in Futhark.IR.Syntax

Methods

compare :: Prog lore -> Prog lore -> Ordering #

(<) :: Prog lore -> Prog lore -> Bool #

(<=) :: Prog lore -> Prog lore -> Bool #

(>) :: Prog lore -> Prog lore -> Bool #

(>=) :: Prog lore -> Prog lore -> Bool #

max :: Prog lore -> Prog lore -> Prog lore #

min :: Prog lore -> Prog lore -> Prog lore #

Decorations lore => Show (Prog lore) Source # 
Instance details

Defined in Futhark.IR.Syntax

Methods

showsPrec :: Int -> Prog lore -> ShowS #

show :: Prog lore -> String #

showList :: [Prog lore] -> ShowS #

Generic (Prog lore) Source # 
Instance details

Defined in Futhark.IR.Syntax

Associated Types

type Rep (Prog lore) :: Type -> Type #

Methods

from :: Prog lore -> Rep (Prog lore) x #

to :: Rep (Prog lore) x -> Prog lore #

PrettyLore lore => Pretty (Prog lore) Source # 
Instance details

Defined in Futhark.IR.Pretty

Methods

ppr :: Prog lore -> Doc #

pprPrec :: Int -> Prog lore -> Doc #

pprList :: [Prog lore] -> Doc #

Decorations lore => SexpIso (Prog lore) Source # 
Instance details

Defined in Futhark.IR.Syntax

Methods

sexpIso :: SexpGrammar (Prog lore) #

type Rep (Prog lore) Source # 
Instance details

Defined in Futhark.IR.Syntax

type Rep (Prog lore) = D1 ('MetaData "Prog" "Futhark.IR.Syntax" "futhark-0.17.1-inplace" 'False) (C1 ('MetaCons "Prog" 'PrefixI 'True) (S1 ('MetaSel ('Just "progConsts") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Stms lore)) :*: S1 ('MetaSel ('Just "progFuns") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 [FunDef lore])))

Utils

oneStm :: Stm lore -> Stms lore Source #

A single statement.

stmsFromList :: [Stm lore] -> Stms lore Source #

Convert a statement list to a statement sequence.

stmsToList :: Stms lore -> [Stm lore] Source #

Convert a statement sequence to a statement list.

stmsHead :: Stms lore -> Maybe (Stm lore, Stms lore) Source #

The first statement in the sequence, if any.