Document wf constraints on control flow in cleanup blocks

Also fixes a bug in dominator computation
This commit is contained in:
Jakob Degen 2023-01-08 18:23:13 -08:00
parent 4781233a77
commit f49126e3d6
3 changed files with 68 additions and 6 deletions

View file

@ -135,7 +135,10 @@ pub fn dominators<G: ControlFlowGraph>(graph: G) -> Dominators<G::Node> {
// This loop computes the semi[w] for w.
semi[w] = w;
for v in graph.predecessors(pre_order_to_real[w]) {
let v = real_to_pre_order[v].unwrap();
// Reachable vertices may have unreachable predecessors, so ignore any of them
let Some(v) = real_to_pre_order[v] else {
continue
};
// eval returns a vertex x from which semi[x] is minimum among
// vertices semi[v] +> x *> v.