Skip to content
Snippets Groups Projects
Commit e252af2a authored by Aaron Councilman's avatar Aaron Councilman
Browse files

Merge branch 'main' into sroa

parents c9445e52 29e1a477
No related branches found
No related tags found
1 merge request!57Intraprocedural SROA
...@@ -82,6 +82,9 @@ impl DomTree { ...@@ -82,6 +82,9 @@ impl DomTree {
* ancestor of the two nodes that is as far down the tree as possible. * ancestor of the two nodes that is as far down the tree as possible.
*/ */
pub fn least_common_ancestor(&self, mut a: NodeID, mut b: NodeID) -> NodeID { pub fn least_common_ancestor(&self, mut a: NodeID, mut b: NodeID) -> NodeID {
if a == self.root || b == self.root {
return self.root;
}
while self.idom[&a].0 > self.idom[&b].0 { while self.idom[&a].0 > self.idom[&b].0 {
a = self.idom[&a].1; a = self.idom[&a].1;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment