| Safe Haskell | None |
|---|---|
| Language | GHC2021 |
Futhark.Internalise.TypesValues
Synopsis
- internaliseReturnType :: [Tree (TypeBase Shape Diet)] -> ResRetType -> [(TypeBase ExtShape NoMode, RetAls)]
- internaliseCoerceType :: StructType -> [TypeBase ExtShape NoMode]
- internaliseLambdaReturnType :: ResType -> [TypeBase shape o] -> InternaliseM [TypeBase Shape NoMode]
- internaliseEntryReturnType :: [Tree (TypeBase Shape Diet)] -> ResRetType -> [[(TypeBase ExtShape Freshness, RetAls)]]
- internaliseType :: TypeBase Size NoMode -> [Tree (TypeBase ExtShape NoMode)]
- internaliseParamTypes :: [ParamType] -> InternaliseM [[Tree (TypeBase Shape Diet)]]
- internaliseLoopParamType :: ParamType -> [TypeBase shape o] -> InternaliseM [TypeBase Shape Diet]
- internalisePrimType :: PrimType -> PrimType
- internalisedTypeSize :: TypeBase Size o -> Int
- internaliseSumTypeRep :: Map Name [StructType] -> ([TypeBase ExtShape NoMode], [(Name, [Int])])
- internaliseSumType :: Map Name [StructType] -> InternaliseM ([TypeBase ExtShape NoMode], [(Name, [Int])])
- type Tree = Free []
- internalisePrimValue :: PrimValue -> PrimValue
- inferAliases :: [Tree (TypeBase Shape Diet)] -> [Tree (TypeBase ExtShape Freshness)] -> [[(TypeBase ExtShape Freshness, RetAls)]]
- internaliseConstructors :: Map Name [Tree (TypeBase ExtShape o)] -> ([Tree (TypeBase ExtShape o)], [(Name, [Int])])
Internalising types
internaliseReturnType :: [Tree (TypeBase Shape Diet)] -> ResRetType -> [(TypeBase ExtShape NoMode, RetAls)] Source #
The mode of the source-level return type is used to compute the
RetAls, and then discarded: an IR return type says nothing about
aliasing on its own.
internaliseLambdaReturnType :: ResType -> [TypeBase shape o] -> InternaliseM [TypeBase Shape NoMode] Source #
internaliseEntryReturnType :: [Tree (TypeBase Shape Diet)] -> ResRetType -> [[(TypeBase ExtShape Freshness, RetAls)]] Source #
As internaliseReturnType, but returns components of a top-level
tuple type piecemeal.
internaliseParamTypes :: [ParamType] -> InternaliseM [[Tree (TypeBase Shape Diet)]] Source #
internaliseLoopParamType :: ParamType -> [TypeBase shape o] -> InternaliseM [TypeBase Shape Diet] Source #
internalisePrimType :: PrimType -> PrimType Source #
Convert an external primitive to an internal primitive.
internalisedTypeSize :: TypeBase Size o -> Int Source #
How many core language values are needed to represent one source language value of the given type?
internaliseSumTypeRep :: Map Name [StructType] -> ([TypeBase ExtShape NoMode], [(Name, [Int])]) Source #
internaliseSumType :: Map Name [StructType] -> InternaliseM ([TypeBase ExtShape NoMode], [(Name, [Int])]) Source #
A tree is just an instantiation of the free monad with a list monad.
The important thing is that we use it to represent the original
structure of arrayss, as this matters for aliasing. Each Free
constructor corresponds to an array dimension. Only non-arrays
have a Pure at the top level. See Note [Alias Inference].
Internalising values
internalisePrimValue :: PrimValue -> PrimValue Source #
Convert an external primitive value to an internal primitive value.