HORIZON HASKELLDocslts/ghc-9.10.x248f8f02026-10-05Search names, modules, packages, or :: a typeCtrl K

GHC 9.10.3 · lts/ghc-9.10.x · 248f8f0 · 2026-10-05

  • Packageghc-9.10.3
  • Exports10
  • LanguageGHC2021
  • LicenceBSD-3-Clause
  • SourceDominators.hs

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-9.10.3 · GHC.Cmm.Dominators
  • Ord RPNumDefined in ghc-9.10.3 · GHC.Cmm.Dominators
  • Show RPNumDefined in ghc-9.10.3 · GHC.Cmm.Dominators
  • Outputable RPNumDefined in ghc-9.10.3 · 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.