ghc-6.10.1: The GHC APIContentsIndex
DFMonad
Synopsis
data DataflowLattice a = DataflowLattice {
fact_name :: String
fact_bot :: a
fact_add_to :: a -> a -> TxRes a
fact_do_logging :: Bool
}
class DataflowAnalysis m where
markFactsUnchanged :: m f ()
factsStatus :: m f ChangeFlag
subAnalysis :: m f a -> m f a
getFact :: BlockId -> m f f
setFact :: Outputable f => BlockId -> f -> m f ()
getExitFact :: m f f
setExitFact :: Outputable f => f -> m f ()
checkFactMatch :: Outputable f => BlockId -> f -> m f ()
botFact :: m f f
forgetFact :: BlockId -> m f ()
addLastOutFact :: (BlockId, f) -> m f ()
bareLastOutFacts :: m f [(BlockId, f)]
forgetLastOutFacts :: m f ()
getAllFacts :: m f (BlockEnv f)
setAllFacts :: BlockEnv f -> m f ()
factsEnv :: Monad (m f) => m f (BlockId -> f)
markFactsUnchanged :: DataflowAnalysis m => m f ()
factsStatus :: DataflowAnalysis m => m f ChangeFlag
getFact :: DataflowAnalysis m => BlockId -> m f f
setFact :: (DataflowAnalysis m, Outputable f) => BlockId -> f -> m f ()
getExitFact :: DataflowAnalysis m => m f f
setExitFact :: (DataflowAnalysis m, Outputable f) => f -> m f ()
forgetFact :: DataflowAnalysis m => BlockId -> m f ()
botFact :: DataflowAnalysis m => m f f
setAllFacts :: DataflowAnalysis m => BlockEnv f -> m f ()
getAllFacts :: DataflowAnalysis m => m f (BlockEnv f)
factsEnv :: (DataflowAnalysis m, Monad (m f)) => m f (BlockId -> f)
addLastOutFact :: DataflowAnalysis m => (BlockId, f) -> m f ()
bareLastOutFacts :: DataflowAnalysis m => m f [(BlockId, f)]
forgetLastOutFacts :: DataflowAnalysis m => m f ()
checkFactMatch :: (DataflowAnalysis m, Outputable f) => BlockId -> f -> m f ()
subAnalysis :: DataflowAnalysis m => m f a -> m f a
type DFM fact a = DFM' FuelMonad fact a
runDFM :: Monad m => DataflowLattice f -> DFM' m f a -> m a
liftToDFM :: FuelMonad x -> DFM f x
markGraphRewritten :: Monad m => DFM' m f ()
graphWasRewritten :: DFM f ChangeFlag
freshBlockId :: String -> DFM f BlockId
module OptimizationFuel
Documentation
data DataflowLattice a
Constructors
DataflowLattice
fact_name :: String
fact_bot :: a
fact_add_to :: a -> a -> TxRes acompute join of two args; something changed iff join is greater than 2nd arg
fact_do_logging :: Bool
class DataflowAnalysis m where
Methods
markFactsUnchanged
::
=> m f ()Useful for starting a new iteration
factsStatus :: m f ChangeFlag
subAnalysis
::
=> m f a
-> m f aDo a new analysis and then throw away all the related state.
getFact :: BlockId -> m f f
setFact :: Outputable f => BlockId -> f -> m f ()
getExitFact :: m f f
setExitFact :: Outputable f => f -> m f ()
checkFactMatch
:: Outputable f
=> BlockId
-> f
-> m f ()assert fact already at this val
botFact :: m f f
forgetFact :: BlockId -> m f ()
addLastOutFact :: (BlockId, f) -> m f ()
It might be surprising these next two are needed in a pure analysis, but for some problems we do a shallow rewriting in which a rewritten graph is not itself considered for further rewriting but merely undergoes an analysis. In this case the results of a forward analysis might produce new facts that go on BlockId's that reside outside the graph being analyzed. Thus these lastOutFacts need to be available even in a pure analysis.
bareLastOutFacts :: m f [(BlockId, f)]
forgetLastOutFacts :: m f ()
getAllFacts :: m f (BlockEnv f)
setAllFacts :: BlockEnv f -> m f ()
factsEnv :: Monad (m f) => m f (BlockId -> f)
show/hide Instances
Monad m => DataflowAnalysis (DFM' m)
markFactsUnchanged
:: DataflowAnalysis m
=> m f ()Useful for starting a new iteration
factsStatus :: DataflowAnalysis m => m f ChangeFlag
getFact :: DataflowAnalysis m => BlockId -> m f f
setFact :: (DataflowAnalysis m, Outputable f) => BlockId -> f -> m f ()
getExitFact :: DataflowAnalysis m => m f f
setExitFact :: (DataflowAnalysis m, Outputable f) => f -> m f ()
forgetFact :: DataflowAnalysis m => BlockId -> m f ()
botFact :: DataflowAnalysis m => m f f
setAllFacts :: DataflowAnalysis m => BlockEnv f -> m f ()
getAllFacts :: DataflowAnalysis m => m f (BlockEnv f)
factsEnv :: (DataflowAnalysis m, Monad (m f)) => m f (BlockId -> f)
addLastOutFact :: DataflowAnalysis m => (BlockId, f) -> m f ()
It might be surprising these next two are needed in a pure analysis, but for some problems we do a shallow rewriting in which a rewritten graph is not itself considered for further rewriting but merely undergoes an analysis. In this case the results of a forward analysis might produce new facts that go on BlockId's that reside outside the graph being analyzed. Thus these lastOutFacts need to be available even in a pure analysis.
bareLastOutFacts :: DataflowAnalysis m => m f [(BlockId, f)]
forgetLastOutFacts :: DataflowAnalysis m => m f ()
checkFactMatch
:: (DataflowAnalysis m, Outputable f)
=> BlockId
-> f
-> m f ()assert fact already at this val
subAnalysis
:: DataflowAnalysis m
=> m f a
-> m f aDo a new analysis and then throw away all the related state.
type DFM fact a = DFM' FuelMonad fact a
runDFM :: Monad m => DataflowLattice f -> DFM' m f a -> m a
liftToDFM :: FuelMonad x -> DFM f x
markGraphRewritten :: Monad m => DFM' m f ()
graphWasRewritten :: DFM f ChangeFlag
freshBlockId :: String -> DFM f BlockId
module OptimizationFuel
Produced by Haddock version 2.3.0