dom-lt-0.1.1: The Lengauer-Tarjan graph dominators algorithm.




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.

TODO: An ST version.



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 NodeSource

Dominator tree. Complexity as for idom.

pdomTree :: Rooted -> Tree NodeSource

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.

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

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

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