Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Representation used by the simplification engine. It contains aliasing information and a bit of caching for various information that is looked up frequently. The name is an old relic; feel free to suggest a better one.
Synopsis
- data Wise rep
- newtype VarWisdom = VarWisdom {}
- data ExpWisdom
- removeStmWisdom :: RephraseOp (OpC rep) => Stm (Wise rep) -> Stm rep
- removeLambdaWisdom :: RephraseOp (OpC rep) => Lambda (Wise rep) -> Lambda rep
- removeFunDefWisdom :: RephraseOp (OpC rep) => FunDef (Wise rep) -> FunDef rep
- removeExpWisdom :: RephraseOp (OpC rep) => Exp (Wise rep) -> Exp rep
- removePatWisdom :: Pat (VarWisdom, a) -> Pat a
- removeBodyWisdom :: RephraseOp (OpC rep) => Body (Wise rep) -> Body rep
- removeScopeWisdom :: Scope (Wise rep) -> Scope rep
- addScopeWisdom :: Scope rep -> Scope (Wise rep)
- addWisdomToPat :: Informing rep => Pat (LetDec rep) -> Exp (Wise rep) -> Pat (LetDec (Wise rep))
- mkWiseBody :: Informing rep => BodyDec rep -> Stms (Wise rep) -> Result -> Body (Wise rep)
- mkWiseStm :: Informing rep => Pat (LetDec rep) -> StmAux (ExpDec rep) -> Exp (Wise rep) -> Stm (Wise rep)
- mkWiseExpDec :: Informing rep => Pat (LetDec (Wise rep)) -> ExpDec rep -> Exp (Wise rep) -> ExpDec (Wise rep)
- class CanBeWise op where
- addOpWisdom :: Informing rep => op rep -> op (Wise rep)
- type Informing rep = (ASTRep rep, AliasedOp (OpC rep (Wise rep)), RephraseOp (OpC rep), CanBeWise (OpC rep), FreeIn (OpC rep (Wise rep)))
- informLambda :: Informing rep => Lambda rep -> Lambda (Wise rep)
- informFunDef :: Informing rep => FunDef rep -> FunDef (Wise rep)
- informStms :: Informing rep => Stms rep -> Stms (Wise rep)
- informBody :: Informing rep => Body rep -> Body (Wise rep)
Documentation
Representative phantom type for the simplifier representation.
Instances
The information associated with a let-bound variable.
Instances
Show VarWisdom Source # | |
FreeIn VarWisdom Source # | |
Rename VarWisdom Source # | |
Substitute VarWisdom Source # | |
Defined in Futhark.Optimise.Simplify.Rep | |
Eq VarWisdom Source # | |
Ord VarWisdom Source # | |
Defined in Futhark.Optimise.Simplify.Rep | |
Pretty VarWisdom Source # | |
Defined in Futhark.Optimise.Simplify.Rep | |
AliasesOf (VarWisdom, dec) Source # | |
Simplifier information about an expression.
Instances
Show ExpWisdom Source # | |
FreeDec ExpWisdom Source # | |
Defined in Futhark.Optimise.Simplify.Rep | |
FreeIn ExpWisdom Source # | |
Rename ExpWisdom Source # | |
Substitute ExpWisdom Source # | |
Defined in Futhark.Optimise.Simplify.Rep | |
Eq ExpWisdom Source # | |
Ord ExpWisdom Source # | |
Defined in Futhark.Optimise.Simplify.Rep |
removeStmWisdom :: RephraseOp (OpC rep) => Stm (Wise rep) -> Stm rep Source #
Remove simplifier information from statement.
removeLambdaWisdom :: RephraseOp (OpC rep) => Lambda (Wise rep) -> Lambda rep Source #
Remove simplifier information from lambda.
removeFunDefWisdom :: RephraseOp (OpC rep) => FunDef (Wise rep) -> FunDef rep Source #
Remove simplifier information from function.
removeExpWisdom :: RephraseOp (OpC rep) => Exp (Wise rep) -> Exp rep Source #
Remove simplifier information from expression.
removeBodyWisdom :: RephraseOp (OpC rep) => Body (Wise rep) -> Body rep Source #
Remove simplifier information from body.
removeScopeWisdom :: Scope (Wise rep) -> Scope rep Source #
Remove simplifier information from scope.
addScopeWisdom :: Scope rep -> Scope (Wise rep) Source #
Add simplifier information to scope. All the aliasing information will be vacuous, however.
addWisdomToPat :: Informing rep => Pat (LetDec rep) -> Exp (Wise rep) -> Pat (LetDec (Wise rep)) Source #
Add simplifier information to pattern.
mkWiseBody :: Informing rep => BodyDec rep -> Stms (Wise rep) -> Result -> Body (Wise rep) Source #
Produce a body with simplifier information.
mkWiseStm :: Informing rep => Pat (LetDec rep) -> StmAux (ExpDec rep) -> Exp (Wise rep) -> Stm (Wise rep) Source #
Produce a statement with simplifier information.
mkWiseExpDec :: Informing rep => Pat (LetDec (Wise rep)) -> ExpDec rep -> Exp (Wise rep) -> ExpDec (Wise rep) Source #
Produce simplifier information for an expression.
class CanBeWise op where Source #
A type class for indicating that this operation can be lifted into the simplifier representation.
addOpWisdom :: Informing rep => op rep -> op (Wise rep) Source #
Instances
CanBeWise SOAC Source # | |
Defined in Futhark.IR.SOACS.SOAC | |
CanBeWise op => CanBeWise (HostOp op) Source # | |
Defined in Futhark.IR.GPU.Op | |
CanBeWise op => CanBeWise (MCOp op) Source # | |
Defined in Futhark.IR.MC.Op | |
CanBeWise inner => CanBeWise (MemOp inner) Source # | |
Defined in Futhark.IR.Mem | |
CanBeWise (NoOp :: Type -> Type) Source # | |
Defined in Futhark.Optimise.Simplify.Rep | |
CanBeWise (SegOp lvl) Source # | |
Defined in Futhark.IR.SegOp |
Constructing representation
type Informing rep = (ASTRep rep, AliasedOp (OpC rep (Wise rep)), RephraseOp (OpC rep), CanBeWise (OpC rep), FreeIn (OpC rep (Wise rep))) Source #
Constraints that let us transform a representation into a Wise
representation.