Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- simplifyProg :: SimplifiableLore lore => SimpleOps lore -> RuleBook (Wise lore) -> HoistBlockers lore -> Prog lore -> PassM (Prog lore)
- simplifySomething :: (MonadFreshNames m, SimplifiableLore lore) => (a -> SimpleM lore b) -> (b -> a) -> SimpleOps lore -> RuleBook (Wise lore) -> HoistBlockers lore -> SymbolTable (Wise lore) -> a -> m a
- simplifyFun :: (MonadFreshNames m, SimplifiableLore lore) => SimpleOps lore -> RuleBook (Wise lore) -> HoistBlockers lore -> SymbolTable (Wise lore) -> FunDef lore -> m (FunDef lore)
- simplifyLambda :: (MonadFreshNames m, HasScope lore m, SimplifiableLore lore) => SimpleOps lore -> RuleBook (Wise lore) -> HoistBlockers lore -> Lambda lore -> m (Lambda lore)
- simplifyStms :: (MonadFreshNames m, SimplifiableLore lore) => SimpleOps lore -> RuleBook (Wise lore) -> HoistBlockers lore -> Scope lore -> Stms lore -> m (SymbolTable (Wise lore), Stms lore)
- data SimpleOps lore = SimpleOps {
- mkExpDecS :: SymbolTable (Wise lore) -> Pattern (Wise lore) -> Exp (Wise lore) -> SimpleM lore (ExpDec (Wise lore))
- mkBodyS :: SymbolTable (Wise lore) -> Stms (Wise lore) -> Result -> SimpleM lore (Body (Wise lore))
- protectHoistedOpS :: Protect (Binder (Wise lore))
- opUsageS :: Op (Wise lore) -> UsageTable
- simplifyOpS :: SimplifyOp lore (Op lore)
- data SimpleM lore a
- type SimplifyOp lore op = op -> SimpleM lore (OpWithWisdom op, Stms (Wise lore))
- bindableSimpleOps :: (SimplifiableLore lore, Bindable lore) => SimplifyOp lore (Op lore) -> SimpleOps lore
- noExtraHoistBlockers :: HoistBlockers lore
- neverHoist :: HoistBlockers lore
- type SimplifiableLore lore = (ASTLore lore, Simplifiable (LetDec lore), Simplifiable (FParamInfo lore), Simplifiable (LParamInfo lore), Simplifiable (RetType lore), Simplifiable (BranchType lore), CanBeWise (Op lore), IndexOp (OpWithWisdom (Op lore)), BinderOps (Wise lore), IsOp (Op lore))
- data HoistBlockers lore
- data RuleBook lore
Documentation
simplifyProg :: SimplifiableLore lore => SimpleOps lore -> RuleBook (Wise lore) -> HoistBlockers lore -> Prog lore -> PassM (Prog lore) 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, SimplifiableLore lore) => (a -> SimpleM lore b) -> (b -> a) -> SimpleOps lore -> RuleBook (Wise lore) -> HoistBlockers lore -> SymbolTable (Wise lore) -> a -> m a Source #
Run a simplification operation to convergence.
simplifyFun :: (MonadFreshNames m, SimplifiableLore lore) => SimpleOps lore -> RuleBook (Wise lore) -> HoistBlockers lore -> SymbolTable (Wise lore) -> FunDef lore -> m (FunDef lore) 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 lore m, SimplifiableLore lore) => SimpleOps lore -> RuleBook (Wise lore) -> HoistBlockers lore -> Lambda lore -> m (Lambda lore) Source #
Simplify just a single Lambda
.
simplifyStms :: (MonadFreshNames m, SimplifiableLore lore) => SimpleOps lore -> RuleBook (Wise lore) -> HoistBlockers lore -> Scope lore -> Stms lore -> m (SymbolTable (Wise lore), Stms lore) Source #
Simplify a sequence of Stm
s.
SimpleOps | |
|
Instances
Monad (SimpleM lore) Source # | |
Functor (SimpleM lore) Source # | |
Applicative (SimpleM lore) Source # | |
Defined in Futhark.Optimise.Simplify.Engine | |
MonadFreshNames (SimpleM lore) Source # | |
Defined in Futhark.Optimise.Simplify.Engine getNameSource :: SimpleM lore VNameSource Source # putNameSource :: VNameSource -> SimpleM lore () Source # | |
SimplifiableLore lore => LocalScope (Wise lore) (SimpleM lore) Source # | |
Defined in Futhark.Optimise.Simplify.Engine | |
SimplifiableLore lore => HasScope (Wise lore) (SimpleM lore) Source # | |
MonadReader (SimpleOps lore, Env lore) (SimpleM lore) Source # | |
MonadState (VNameSource, Bool, Certificates) (SimpleM lore) Source # | |
Defined in Futhark.Optimise.Simplify.Engine get :: SimpleM lore (VNameSource, Bool, Certificates) # put :: (VNameSource, Bool, Certificates) -> SimpleM lore () # state :: ((VNameSource, Bool, Certificates) -> (a, (VNameSource, Bool, Certificates))) -> SimpleM lore a # |
type SimplifyOp lore op = op -> SimpleM lore (OpWithWisdom op, Stms (Wise lore)) Source #
bindableSimpleOps :: (SimplifiableLore lore, Bindable lore) => SimplifyOp lore (Op lore) -> SimpleOps lore Source #
noExtraHoistBlockers :: HoistBlockers lore Source #
neverHoist :: HoistBlockers lore Source #
type SimplifiableLore lore = (ASTLore lore, Simplifiable (LetDec lore), Simplifiable (FParamInfo lore), Simplifiable (LParamInfo lore), Simplifiable (RetType lore), Simplifiable (BranchType lore), CanBeWise (Op lore), IndexOp (OpWithWisdom (Op lore)), BinderOps (Wise lore), IsOp (Op lore)) Source #
data HoistBlockers lore Source #