Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
H
Hercules
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
llvm
Hercules
Commits
29e1a477
Commit
29e1a477
authored
4 months ago
by
rarbore2
Browse files
Options
Downloads
Plain Diff
Merge branch 'dom_fix' into 'main'
Fix LCA calculation in dom tree See merge request
llvm/hercules!54
parents
62b32318
6fed1b7d
No related branches found
No related tags found
1 merge request
!54
Fix LCA calculation in dom tree
Pipeline
#200272
passed
4 months ago
Stage: build
Stage: test
Changes
1
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
hercules_ir/src/dom.rs
+3
-0
3 additions, 0 deletions
hercules_ir/src/dom.rs
with
3 additions
and
0 deletions
hercules_ir/src/dom.rs
+
3
−
0
View file @
29e1a477
...
@@ -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
;
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment