Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- type C = 'Closed
- type O = 'Open
- data Block (n :: Extensibility -> Extensibility -> Type) (e :: Extensibility) (x :: Extensibility)
- lastNode :: forall n (x :: Extensibility). Block n x C -> n O C
- entryLabel :: forall (x :: Extensibility). NonLocal thing => thing C x -> Label
- foldNodesBwdOO :: (CmmNode O O -> f -> f) -> Block CmmNode O O -> f -> f
- foldRewriteNodesBwdOO :: forall f. (CmmNode O O -> f -> UniqSM (Block CmmNode O O, f)) -> Block CmmNode O O -> f -> UniqSM (Block CmmNode O O, f)
- data DataflowLattice a = DataflowLattice {}
- newtype OldFact a = OldFact a
- newtype NewFact a = NewFact a
- data JoinedFact a
- = Changed !a
- | NotChanged !a
- type TransferFun f = CmmBlock -> FactBase f -> FactBase f
- type RewriteFun f = CmmBlock -> FactBase f -> UniqSM (CmmBlock, FactBase f)
- type family Fact (x :: Extensibility) f :: Type
- type FactBase f = LabelMap f
- getFact :: DataflowLattice f -> Label -> FactBase f -> f
- mkFactBase :: DataflowLattice f -> [(Label, f)] -> FactBase f
- analyzeCmmFwd :: DataflowLattice f -> TransferFun f -> CmmGraph -> FactBase f -> FactBase f
- analyzeCmmBwd :: DataflowLattice f -> TransferFun f -> CmmGraph -> FactBase f -> FactBase f
- rewriteCmmBwd :: DataflowLattice f -> RewriteFun f -> CmmGraph -> FactBase f -> UniqSM (CmmGraph, FactBase f)
- changedIf :: Bool -> a -> JoinedFact a
- joinOutFacts :: NonLocal n => DataflowLattice f -> n e C -> FactBase f -> f
- joinFacts :: DataflowLattice f -> [f] -> f
Documentation
data Block (n :: Extensibility -> Extensibility -> Type) (e :: Extensibility) (x :: Extensibility) #
Instances
OutputableP Platform (Block CmmNode C C) | |
Defined in GHC.Cmm.Ppr | |
OutputableP Platform (Block CmmNode C O) | |
Defined in GHC.Cmm.Ppr | |
OutputableP Platform (Block CmmNode O C) | |
Defined in GHC.Cmm.Ppr | |
OutputableP Platform (Block CmmNode O O) | |
Defined in GHC.Cmm.Ppr | |
OutputableP Platform (Graph CmmNode e x) | |
Defined in GHC.Cmm.Ppr pdoc :: Platform -> Graph CmmNode e x -> SDoc | |
NonLocal n => NonLocal (Block n) | |
Defined in GHC.Cmm.Dataflow.Graph entryLabel :: forall (x :: Extensibility). Block n C x -> Label # successors :: forall (e :: Extensibility). Block n e C -> [Label] |
entryLabel :: forall (x :: Extensibility). NonLocal thing => thing C x -> Label #
foldNodesBwdOO :: (CmmNode O O -> f -> f) -> Block CmmNode O O -> f -> f Source #
Folds backward over all nodes of an open-open block. Strict in the accumulator.
foldRewriteNodesBwdOO :: forall f. (CmmNode O O -> f -> UniqSM (Block CmmNode O O, f)) -> Block CmmNode O O -> f -> UniqSM (Block CmmNode O O, f) Source #
Folds backward over all the nodes of an open-open block and allows
rewriting them. The accumulator is both the block of nodes and f
(usually
dataflow facts).
Strict in both accumulated parts.
data JoinedFact a Source #
The result of joining OldFact and NewFact.
Changed !a | Result is different than OldFact. |
NotChanged !a | Result is the same as OldFact. |
type TransferFun f = CmmBlock -> FactBase f -> FactBase f Source #
type RewriteFun f = CmmBlock -> FactBase f -> UniqSM (CmmBlock, FactBase f) Source #
Function for rewrtiting and analysis combined. To be used with
rewriteCmm
.
Currently set to work with UniqSM
monad, but we could probably abstract
that away (if we do that, we might want to specialize the fixpoint algorithms
to the particular monads through SPECIALIZE).
getFact :: DataflowLattice f -> Label -> FactBase f -> f Source #
mkFactBase :: DataflowLattice f -> [(Label, f)] -> FactBase f Source #
Returns the joined facts for each label.
analyzeCmmFwd :: DataflowLattice f -> TransferFun f -> CmmGraph -> FactBase f -> FactBase f Source #
analyzeCmmBwd :: DataflowLattice f -> TransferFun f -> CmmGraph -> FactBase f -> FactBase f Source #
rewriteCmmBwd :: DataflowLattice f -> RewriteFun f -> CmmGraph -> FactBase f -> UniqSM (CmmGraph, FactBase f) Source #
changedIf :: Bool -> a -> JoinedFact a Source #
joinOutFacts :: NonLocal n => DataflowLattice f -> n e C -> FactBase f -> f Source #
Returns the result of joining the facts from all the successors of the provided node or block.
joinFacts :: DataflowLattice f -> [f] -> f Source #