Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Synopsis
- data SymbolTable lore
- empty :: SymbolTable lore
- fromScope :: ASTLore lore => Scope lore -> SymbolTable lore
- toScope :: SymbolTable lore -> Scope lore
- data Entry lore
- deepen :: SymbolTable lore -> SymbolTable lore
- entryDepth :: Entry lore -> Int
- entryLetBoundDec :: Entry lore -> Maybe (LetDec lore)
- entryIsSize :: Entry lore -> Bool
- entryStm :: Entry lore -> Maybe (Stm lore)
- entryFParam :: Entry lore -> Maybe (FParamInfo lore)
- elem :: VName -> SymbolTable lore -> Bool
- lookup :: VName -> SymbolTable lore -> Maybe (Entry lore)
- lookupStm :: VName -> SymbolTable lore -> Maybe (Stm lore)
- lookupExp :: VName -> SymbolTable lore -> Maybe (Exp lore, Certificates)
- lookupBasicOp :: VName -> SymbolTable lore -> Maybe (BasicOp, Certificates)
- lookupType :: ASTLore lore => VName -> SymbolTable lore -> Maybe Type
- lookupSubExp :: VName -> SymbolTable lore -> Maybe (SubExp, Certificates)
- lookupAliases :: VName -> SymbolTable lore -> Names
- lookupLoopVar :: VName -> SymbolTable lore -> Maybe SubExp
- lookupLoopParam :: VName -> SymbolTable lore -> Maybe (SubExp, SubExp)
- available :: VName -> SymbolTable lore -> Bool
- consume :: VName -> SymbolTable lore -> SymbolTable lore
- index :: ASTLore lore => VName -> [SubExp] -> SymbolTable lore -> Maybe Indexed
- index' :: VName -> [TPrimExp Int64 VName] -> SymbolTable lore -> Maybe Indexed
- data Indexed
- indexedAddCerts :: Certificates -> Indexed -> Indexed
- class IndexOp op where
- insertStm :: (ASTLore lore, IndexOp (Op lore), Aliased lore) => Stm lore -> SymbolTable lore -> SymbolTable lore
- insertStms :: (ASTLore lore, IndexOp (Op lore), Aliased lore) => Stms lore -> SymbolTable lore -> SymbolTable lore
- insertFParams :: ASTLore lore => [FParam lore] -> SymbolTable lore -> SymbolTable lore
- insertLParam :: ASTLore lore => LParam lore -> SymbolTable lore -> SymbolTable lore
- insertLoopVar :: ASTLore lore => VName -> IntType -> SubExp -> SymbolTable lore -> SymbolTable lore
- insertLoopMerge :: ASTLore lore => [(FParam lore, SubExp, SubExp)] -> SymbolTable lore -> SymbolTable lore
- hideCertified :: Names -> SymbolTable lore -> SymbolTable lore
Documentation
data SymbolTable lore Source #
Instances
Semigroup (SymbolTable lore) Source # | |
Defined in Futhark.Analysis.SymbolTable (<>) :: SymbolTable lore -> SymbolTable lore -> SymbolTable lore # sconcat :: NonEmpty (SymbolTable lore) -> SymbolTable lore # stimes :: Integral b => b -> SymbolTable lore -> SymbolTable lore # | |
Monoid (SymbolTable lore) Source # | |
Defined in Futhark.Analysis.SymbolTable mempty :: SymbolTable lore # mappend :: SymbolTable lore -> SymbolTable lore -> SymbolTable lore # mconcat :: [SymbolTable lore] -> SymbolTable lore # |
empty :: SymbolTable lore Source #
toScope :: SymbolTable lore -> Scope lore Source #
Entries
deepen :: SymbolTable lore -> SymbolTable lore Source #
entryDepth :: Entry lore -> Int Source #
entryIsSize :: Entry lore -> Bool Source #
True if this name has been used as an array size, implying that it is non-negative.
entryFParam :: Entry lore -> Maybe (FParamInfo lore) Source #
Lookup
lookupExp :: VName -> SymbolTable lore -> Maybe (Exp lore, Certificates) Source #
lookupBasicOp :: VName -> SymbolTable lore -> Maybe (BasicOp, Certificates) Source #
lookupType :: ASTLore lore => VName -> SymbolTable lore -> Maybe Type Source #
lookupSubExp :: VName -> SymbolTable lore -> Maybe (SubExp, Certificates) Source #
lookupAliases :: VName -> SymbolTable lore -> Names Source #
lookupLoopVar :: VName -> SymbolTable lore -> Maybe SubExp Source #
If the given variable name is the name of a ForLoop
parameter,
then return the bound of that loop.
lookupLoopParam :: VName -> SymbolTable lore -> Maybe (SubExp, SubExp) Source #
consume :: VName -> SymbolTable lore -> SymbolTable lore Source #
The result of indexing a delayed array.
Indexed Certificates (PrimExp VName) | A PrimExp based on the indexes (that is, without accessing any actual array). |
IndexedArray Certificates VName [TPrimExp Int64 VName] | The indexing corresponds to another (perhaps more advantageous) array. |
indexedAddCerts :: Certificates -> Indexed -> Indexed Source #
class IndexOp op where Source #
Nothing
indexOp :: (ASTLore lore, IndexOp (Op lore)) => SymbolTable lore -> Int -> op -> [TPrimExp Int64 VName] -> Maybe Indexed Source #
Instances
Insertion
insertStm :: (ASTLore lore, IndexOp (Op lore), Aliased lore) => Stm lore -> SymbolTable lore -> SymbolTable lore Source #
insertStms :: (ASTLore lore, IndexOp (Op lore), Aliased lore) => Stms lore -> SymbolTable lore -> SymbolTable lore Source #
insertFParams :: ASTLore lore => [FParam lore] -> SymbolTable lore -> SymbolTable lore Source #
insertLParam :: ASTLore lore => LParam lore -> SymbolTable lore -> SymbolTable lore Source #
insertLoopVar :: ASTLore lore => VName -> IntType -> SubExp -> SymbolTable lore -> SymbolTable lore Source #
insertLoopMerge :: ASTLore lore => [(FParam lore, SubExp, SubExp)] -> SymbolTable lore -> SymbolTable lore Source #
Insert entries corresponding to the parameters of a loop (not distinguishing contect and value part). Apart from the parameter itself, we also insert the initial value and the subexpression providing the final value. Note that the latter is likely not in scope in the symbol at this point. This is OK, and can still be used to help some loop optimisations detect invariant loop parameters.
Misc
hideCertified :: Names -> SymbolTable lore -> SymbolTable lore Source #
Hide these definitions, if they are protected by certificates in the set of names.