Safe Haskell | Safe-Inferred |
---|---|
Language | GHC2021 |
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 => [PatElem dec] -> Exp rep -> [Names]
- patAliases :: AliasesOf dec => Pat dec -> [Names]
- lookupAliases :: AliasesOf (LetDec rep) => VName -> Scope rep -> Names
- class (ASTRep 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
Documentation
subExpAliases :: SubExp -> Names Source #
The aliases of a subexpression.
expAliases :: Aliased rep => [PatElem dec] -> Exp rep -> [Names] Source #
The aliases of an expression, one for each pattern element.
The pattern is important because some aliasing might be through variables that are no longer in scope (consider the aliases for a body that returns the same value multiple times).
lookupAliases :: AliasesOf (LetDec rep) => VName -> Scope rep -> Names Source #
Also includes the name itself.
class (ASTRep 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. Note that this includes names bound in the body!
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 SizeOp Source # | |
Aliased rep => AliasedOp (SOAC rep) Source # | |
(Aliased rep, AliasedOp (op rep)) => AliasedOp (HostOp op rep) Source # | |
(Aliased rep, AliasedOp (op rep)) => AliasedOp (MCOp op rep) Source # | |
AliasedOp (inner rep) => AliasedOp (MemOp inner rep) Source # | |
AliasedOp (NoOp rep) Source # | |
(ASTConstraints lvl, Aliased rep) => AliasedOp (SegOp lvl rep) Source # | |