pub fn simple_fast<G>(graph: G, root: G::NodeId) -> Dominators<G::NodeId>
Expand description
This is an implementation of the engineered “Simple, Fast Dominance Algorithm” discovered by Cooper et al.
This algorithm is O(|V|²) where V is the set of nodes, and therefore has slower theoretical running time than the Lengauer-Tarjan algorithm (which is O(|E| log |V|) where E is the set of edges). However, Cooper et al found it to be faster in practice on control flow graphs of up to ~30,000 nodes.
§Arguments
graph
: a control-flow graph.root
: the root node of thegraph
.
§Returns
Dominators
: the dominance relation for givengraph
androot
represented byDominators
.
§Complexity
- Time complexity: O(|V|²).
- Auxiliary space: O(|V| + |E|).
where |V| is the number of nodes and |E| is the number of edges.