Safe Haskell | Safe-Inferred |
---|---|
Language | GHC2021 |
Synopsis
- simplifyProg :: SimplifiableRep rep => SimpleOps rep -> RuleBook (Wise rep) -> HoistBlockers rep -> Prog rep -> PassM (Prog rep)
- simplifySomething :: (MonadFreshNames m, SimplifiableRep rep) => (a -> SimpleM rep b) -> (b -> a) -> SimpleOps rep -> RuleBook (Wise rep) -> HoistBlockers rep -> SymbolTable (Wise rep) -> a -> m a
- simplifyFun :: (MonadFreshNames m, SimplifiableRep rep) => SimpleOps rep -> RuleBook (Wise rep) -> HoistBlockers rep -> SymbolTable (Wise rep) -> FunDef rep -> m (FunDef rep)
- simplifyLambda :: (MonadFreshNames m, HasScope rep m, SimplifiableRep rep) => SimpleOps rep -> RuleBook (Wise rep) -> HoistBlockers rep -> Lambda rep -> m (Lambda rep)
- simplifyStms :: (MonadFreshNames m, SimplifiableRep rep) => SimpleOps rep -> RuleBook (Wise rep) -> HoistBlockers rep -> Scope rep -> Stms rep -> m (Stms rep)
- data SimpleOps rep = SimpleOps {
- mkExpDecS :: SymbolTable (Wise rep) -> Pat (LetDec (Wise rep)) -> Exp (Wise rep) -> SimpleM rep (ExpDec (Wise rep))
- mkBodyS :: SymbolTable (Wise rep) -> Stms (Wise rep) -> Result -> SimpleM rep (Body (Wise rep))
- protectHoistedOpS :: Protect (Builder (Wise rep))
- opUsageS :: Op (Wise rep) -> UsageTable
- simplifyOpS :: SimplifyOp rep (Op (Wise rep))
- data SimpleM rep a
- type SimplifyOp rep op = op -> SimpleM rep (op, Stms (Wise rep))
- bindableSimpleOps :: (SimplifiableRep rep, Buildable rep) => SimplifyOp rep (Op (Wise rep)) -> SimpleOps rep
- noExtraHoistBlockers :: HoistBlockers rep
- neverHoist :: HoistBlockers rep
- type SimplifiableRep rep = (ASTRep rep, Simplifiable (LetDec rep), Simplifiable (FParamInfo rep), Simplifiable (LParamInfo rep), Simplifiable (RetType rep), Simplifiable (BranchType rep), TraverseOpStms (Wise rep), CanBeWise (OpC rep), IndexOp (Op (Wise rep)), IsOp (OpC rep), ASTConstraints (OpC rep (Wise rep)), AliasedOp (OpC (Wise rep)), RephraseOp (OpC rep), BuilderOps (Wise rep), IsOp (OpC rep))
- data HoistBlockers rep
- data RuleBook rep
Documentation
simplifyProg :: SimplifiableRep rep => SimpleOps rep -> RuleBook (Wise rep) -> HoistBlockers rep -> Prog rep -> PassM (Prog rep) Source #
Simplify the given program. Even if the output differs from the output, meaningful simplification may not have taken place - the order of bindings may simply have been rearranged.
simplifySomething :: (MonadFreshNames m, SimplifiableRep rep) => (a -> SimpleM rep b) -> (b -> a) -> SimpleOps rep -> RuleBook (Wise rep) -> HoistBlockers rep -> SymbolTable (Wise rep) -> a -> m a Source #
Run a simplification operation to convergence.
simplifyFun :: (MonadFreshNames m, SimplifiableRep rep) => SimpleOps rep -> RuleBook (Wise rep) -> HoistBlockers rep -> SymbolTable (Wise rep) -> FunDef rep -> m (FunDef rep) Source #
Simplify the given function. Even if the output differs from the output, meaningful simplification may not have taken place - the order of bindings may simply have been rearranged. Runs in a loop until convergence.
simplifyLambda :: (MonadFreshNames m, HasScope rep m, SimplifiableRep rep) => SimpleOps rep -> RuleBook (Wise rep) -> HoistBlockers rep -> Lambda rep -> m (Lambda rep) Source #
Simplify just a single Lambda
.
simplifyStms :: (MonadFreshNames m, SimplifiableRep rep) => SimpleOps rep -> RuleBook (Wise rep) -> HoistBlockers rep -> Scope rep -> Stms rep -> m (Stms rep) Source #
Simplify a sequence of Stm
s.
SimpleOps | |
|
Instances
Applicative (SimpleM rep) Source # | |
Defined in Futhark.Optimise.Simplify.Engine | |
Functor (SimpleM rep) Source # | |
Monad (SimpleM rep) Source # | |
MonadFreshNames (SimpleM rep) Source # | |
Defined in Futhark.Optimise.Simplify.Engine getNameSource :: SimpleM rep VNameSource Source # putNameSource :: VNameSource -> SimpleM rep () Source # | |
SimplifiableRep rep => HasScope (Wise rep) (SimpleM rep) Source # | |
SimplifiableRep rep => LocalScope (Wise rep) (SimpleM rep) Source # | |
Defined in Futhark.Optimise.Simplify.Engine | |
MonadReader (SimpleOps rep, Env rep) (SimpleM rep) Source # | |
MonadState (VNameSource, Bool, Certs) (SimpleM rep) Source # | |
Defined in Futhark.Optimise.Simplify.Engine |
bindableSimpleOps :: (SimplifiableRep rep, Buildable rep) => SimplifyOp rep (Op (Wise rep)) -> SimpleOps rep Source #
noExtraHoistBlockers :: HoistBlockers rep Source #
neverHoist :: HoistBlockers rep Source #
type SimplifiableRep rep = (ASTRep rep, Simplifiable (LetDec rep), Simplifiable (FParamInfo rep), Simplifiable (LParamInfo rep), Simplifiable (RetType rep), Simplifiable (BranchType rep), TraverseOpStms (Wise rep), CanBeWise (OpC rep), IndexOp (Op (Wise rep)), IsOp (OpC rep), ASTConstraints (OpC rep (Wise rep)), AliasedOp (OpC (Wise rep)), RephraseOp (OpC rep), BuilderOps (Wise rep), IsOp (OpC rep)) Source #
data HoistBlockers rep Source #