ghc-9.8.0.20230919: The GHC API
Copyright(c) Matt Morrow 2009
LicenseBSD3
Maintainer<klebinger.andreas@gmx.at>
Stabilitystable
Portabilityportable
Safe HaskellNone
LanguageHaskell2010

GHC.CmmToAsm.CFG.Dominators

Description

The Lengauer-Tarjan graph dominators algorithm.

\[1\] Lengauer, Tarjan, A Fast Algorithm for Finding Dominators in a Flowgraph, 1979.

\[2\] Muchnick, Advanced Compiler Design and Implementation, 1997.

\[3\] Brisk, Sarrafzadeh, Interference Graphs for Procedures in Static Single Information Form are Interval Graphs, 2007.

  • Strictness

Unless stated otherwise all exposed functions might fully evaluate their input but are not guaranteed to do so.

Synopsis

Documentation

type Node = Int Source #

type Path = [Node] Source #

type Edge = (Node, Node) Source #

idom :: Rooted -> [(Node, Node)] Source #

Immediate dominators. O(|E|*alpha(|E|,|V|)), where alpha(m,n) is "a functional inverse of Ackermann's function".

This Complexity bound assumes O(1) indexing. Since we're using IntMap, it has an additional lg |V| factor somewhere in there. I'm not sure where.

ipdom :: Rooted -> [(Node, Node)] Source #

Immediate post-dominators. Complexity as for idom.

domTree :: Rooted -> Tree Node Source #

Dominator tree. Complexity as for idom.

pdomTree :: Rooted -> Tree Node Source #

Post-dominator tree. Complexity as for idom.

dom :: Rooted -> [(Node, Path)] Source #

Dominators. Complexity as for idom

pdom :: Rooted -> [(Node, Path)] Source #

Post-dominators. Complexity as for idom.

pddfs :: Rooted -> [Node] Source #

Post-dominated depth-first search.

rpddfs :: Rooted -> [Node] Source #

Reverse post-dominated depth-first search.

fromAdj :: [(Node, [Node])] -> Graph Source #

toAdj :: Graph -> [(Node, [Node])] Source #

parents :: Tree a -> [(a, a)] Source #

ancestors :: Tree a -> [(a, [a])] Source #