HORIZON HASKELLDocslts/ghc-10.0.x8174fa42026-10-11Search names, modules, packages, or :: a typeCtrl K

GHC 10.0.0.20260917 · lts/ghc-10.0.x · 8174fa4 · 2026-10-11

Dominator analysis and representation of results

4 declarations
datadata DominatorSet
#

Dominator sets

Node X dominates node Y if and only if every path from the entry to Y includes X. Node Y technically dominates itself, but it is never included in the *representation* of its dominator set.

A dominator set is represented as a linked list in which each node points to its *immediate* dominator, which is its parent in the dominator tree. In many circumstances the immediate dominator will be the only dominator of interest.

Constructors

Instances2Eq, Outputable
newtypenewtype RPNum
#

Reverse postorder number of a node in a CFG

Instances4Eq, Ord, Show, Outputable
  • Eq RPNumDefined in ghc-10.0.0.20260917 · GHC.Cmm.Dominators
  • Ord RPNumDefined in ghc-10.0.0.20260917 · GHC.Cmm.Dominators
  • Show RPNumDefined in ghc-10.0.0.20260917 · GHC.Cmm.Dominators
  • Outputable RPNumDefined in ghc-10.0.0.20260917 · GHC.Cmm.Dominators

Utility functions on graphs or graphs-with-dominators

4 declarations

Utility functions on dominator sets

2 declarations

Use to tell if the given label is in the given dominator set. Which is to say, does the bloc with with given label _properly_ and _non-vacuously_ dominate the node whose dominator set this is?

Takes linear time in the height of the dominator tree, but uses space efficiently.

Intersect two dominator sets to produce a third dominator set. This function takes time linear in the size of the sets. As such it is inefficient and should be used only for things like visualizations or linters.