hoopl-3.10.0.1: A library to support dataflow analysis and optimization

Safe Haskell | Safe
Language | Haskell2010

Compiler.Hoopl.Passes.Dominator

Synopsis

- type Doms = WithBot DPath
- newtype DPath = DPath [Label]
- domPath :: Doms -> [Label]
- domEntry :: Doms
- domLattice :: DataflowLattice Doms
- extendDom :: Label -> DPath -> DPath
- data DominatorNode
  - = Entry
  - | Labelled Label
- data DominatorTree = Dominates DominatorNode [DominatorTree]
- tree :: [(Label, Doms)] -> DominatorTree
- immediateDominators :: FactBase Doms -> LabelMap Label
- domPass :: (NonLocal n, Monad m) => FwdPass m n Doms

# Documentation

type Doms = WithBot DPath

List of labels, extended with a standard bottom element

newtype DPath

Constructors

DPath [Label] | represents part of the domination relation: each label in a list is dominated by all its successors. This is a newtype only so we can give it a fancy Show instance.

Instances

Show DPath |

domPath :: Doms -> [Label]

domEntry :: Doms

The fact that goes into the entry of a dominator analysis: the first node is dominated only by the entry point, which is represented by the empty list of labels.

domLattice :: DataflowLattice Doms

extendDom :: Label -> DPath -> DPath

data DominatorNode

Constructors

Entry |
Labelled Label |

Instances

Show DominatorNode |

data DominatorTree

This data structure is a *rose tree* in which each node may have arbitrarily many children. Each node dominates all its descendants.

Constructors

Dominates DominatorNode [DominatorTree] |

Instances

Show DominatorTree |

tree :: [(Label, Doms)] -> DominatorTree

Map from a FactBase for dominator lists into a dominator tree.

immediateDominators :: FactBase Doms -> LabelMap Label

Takes FactBase from dominator analysis and returns a map from each label to its immediate dominator, if any

domPass :: (NonLocal n, Monad m) => FwdPass m n Doms

Dominator pass