Safe Haskell | None |
---|---|
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 rep => Exp rep -> [Names]
- patAliases :: AliasesOf dec => Pat dec -> [Names]
- lookupAliases :: AliasesOf (LetDec rep) => VName -> Scope rep -> Names
- class (RepTypes rep, AliasedOp (Op rep), AliasesOf (LetDec rep)) => Aliased rep where
- bodyAliases :: Body rep -> [Names]
- consumedInBody :: Body rep -> Names
- class AliasesOf a where
- consumedInStm :: Aliased rep => Stm rep -> Names
- consumedInExp :: Aliased rep => Exp rep -> Names
- consumedByLambda :: Aliased rep => Lambda rep -> 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 rep => Exp rep -> [Names] Source #
The aliases of an expression, one per non-context value returned.
patAliases :: AliasesOf dec => Pat dec -> [Names] Source #
The aliases of each pattern element (including the context).
lookupAliases :: AliasesOf (LetDec rep) => VName -> Scope rep -> Names Source #
Also includes the name itself.
class (RepTypes rep, AliasedOp (Op rep), AliasesOf (LetDec rep)) => Aliased rep where Source #
The class of representations that contain aliasing information.
bodyAliases :: Body rep -> [Names] Source #
The aliases of the body results.
consumedInBody :: Body rep -> Names Source #
The variables consumed in the body.
class AliasesOf a where Source #
Something that contains alias information.
Consumption
consumedByLambda :: Aliased rep => Lambda rep -> 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 # | |
(ASTRep rep, Aliased rep) => AliasedOp (SOAC rep) Source # | |
AliasedOp inner => AliasedOp (MemOp inner) Source # | |
(ASTRep rep, Aliased rep, ASTConstraints lvl) => AliasedOp (SegOp lvl rep) Source # | |
(Aliased rep, AliasedOp op, ASTRep rep) => AliasedOp (MCOp rep op) Source # | |
(Aliased rep, AliasedOp op, ASTRep rep) => AliasedOp (HostOp rep 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 "rep 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.