We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7379d24 commit 92186cbCopy full SHA for 92186cb
compiler/rustc_data_structures/src/graph/dominators/mod.rs
@@ -91,7 +91,13 @@ fn dominators_given_rpo<G: ControlFlowGraph>(graph: G, rpo: &[G::Node]) -> Domin
91
}
92
// semi[w] is now semidominator(w).
93
94
- bucket[semi[w]].push(w);
+ // Optimization: Do not insert into buckets if parent[w] = semi[w], as
95
+ // we then immediately know the idom.
96
+ if parent[w].unwrap() != semi[w] {
97
+ bucket[semi[w]].push(w);
98
+ } else {
99
+ idom[w] = parent[w].unwrap();
100
+ }
101
102
// Optimization: We share the parent array between processed and not
103
// processed elements; lastlinked represents the divider.
0 commit comments