Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
The IR tracks aliases, mostly to ensure the soundness of in-place updates, but it can also be used for other things (such as memory optimisations). This module contains the raw building blocks for determining the aliases of the values produced by expressions. It also contains some building blocks for inspecting consumption.
One important caveat is that all aliases computed here are local. Thus, they do not take aliases-of-aliases into account. See Futhark.Analysis.Alias if this is not what you want.
Synopsis
- subExpAliases :: SubExp -> Names
- expAliases :: Aliased lore => Exp lore -> [Names]
- patternAliases :: AliasesOf dec => PatternT dec -> [Names]
- lookupAliases :: AliasesOf (LetDec lore) => VName -> Scope lore -> Names
- class (Decorations lore, AliasedOp (Op lore), AliasesOf (LetDec lore)) => Aliased lore where
- bodyAliases :: Body lore -> [Names]
- consumedInBody :: Body lore -> Names
- class AliasesOf a where
- consumedInStm :: Aliased lore => Stm lore -> Names
- consumedInExp :: Aliased lore => Exp lore -> Names
- consumedByLambda :: Aliased lore => Lambda lore -> Names
- type AliasTable = Map VName Names
- class IsOp op => AliasedOp op where
- opAliases :: op -> [Names]
- consumedInOp :: op -> Names
- class AliasedOp (OpWithAliases op) => CanBeAliased op where
- type OpWithAliases op :: Type
- removeOpAliases :: OpWithAliases op -> op
- addOpAliases :: AliasTable -> op -> OpWithAliases op
Documentation
subExpAliases :: SubExp -> Names Source #
The alises of a subexpression.
expAliases :: Aliased lore => Exp lore -> [Names] Source #
The aliases of an expression, one per non-context value returned.
patternAliases :: AliasesOf dec => PatternT dec -> [Names] Source #
The aliases of each pattern element (including the context).
lookupAliases :: AliasesOf (LetDec lore) => VName -> Scope lore -> Names Source #
Also includes the name itself.
class (Decorations lore, AliasedOp (Op lore), AliasesOf (LetDec lore)) => Aliased lore where Source #
The class of lores that contain aliasing information.
bodyAliases :: Body lore -> [Names] Source #
The aliases of the body results.
consumedInBody :: Body lore -> Names Source #
The variables consumed in the body.
class AliasesOf a where Source #
Something that contains alias information.
Consumption
consumedInStm :: Aliased lore => Stm lore -> Names Source #
The variables consumed in this statement.
consumedInExp :: Aliased lore => Exp lore -> Names Source #
The variables consumed in this expression.
consumedByLambda :: Aliased lore => Lambda lore -> Names Source #
The variables consumed by this lambda.
Extensibility
type AliasTable = Map VName Names Source #
Pre-existing aliases for variables. Used to add transitive aliases.
class IsOp op => AliasedOp op where Source #
The class of operations that can produce aliasing and consumption information.
Instances
AliasedOp () Source # | |
Defined in Futhark.IR.Prop.Aliases | |
AliasedOp SizeOp Source # | |
(ASTLore lore, Aliased lore) => AliasedOp (SOAC lore) Source # | |
AliasedOp inner => AliasedOp (MemOp inner) Source # | |
(ASTLore lore, Aliased lore, ASTConstraints lvl) => AliasedOp (SegOp lvl lore) Source # | |
(Aliased lore, AliasedOp op, ASTLore lore) => AliasedOp (MCOp lore op) Source # | |
(Aliased lore, AliasedOp op, ASTLore lore) => AliasedOp (HostOp lore op) Source # | |
class AliasedOp (OpWithAliases op) => CanBeAliased op where Source #
The class of operations that can be given aliasing information. This is a somewhat subtle concept that is only used in the simplifier and when using "lore adapters".
type OpWithAliases op :: Type Source #
The op that results when we add aliases to this op.
removeOpAliases :: OpWithAliases op -> op Source #
Remove aliases from this op.
addOpAliases :: AliasTable -> op -> OpWithAliases op Source #
Add aliases to this op.