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
1aad2842
Commit
1aad2842
authored
1 month ago
by
rarbore2
Browse files
Options
Downloads
Plain Diff
Merge branch 'delete-uncalled-fix' into 'main'
Fix delete uncalled bugs See merge request
!173
parents
f394bf1e
eda921ae
No related branches found
Branches containing commit
No related tags found
1 merge request
!173
Fix delete uncalled bugs
Pipeline
#201624
passed
1 month ago
Stage: test
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
hercules_opt/src/delete_uncalled.rs
+5
-0
5 additions, 0 deletions
hercules_opt/src/delete_uncalled.rs
juno_utils/src/env.rs
+6
-0
6 additions, 0 deletions
juno_utils/src/env.rs
with
11 additions
and
0 deletions
hercules_opt/src/delete_uncalled.rs
+
5
−
0
View file @
1aad2842
...
...
@@ -50,6 +50,11 @@ pub fn delete_uncalled(
// that all nodes in all functions will be mutable, so panic if any
// edit fails.
for
editor
in
editors
.iter_mut
()
{
// Don't make edits to dead functions as they may include calls to dead functions
if
new_idx
[
editor
.func_id
()
.idx
()]
.is_none
()
{
continue
;
}
let
callsites
:
Vec
<
_
>
=
editor
.node_ids
()
.filter
(|
id
|
editor
.func
()
.nodes
[
id
.idx
()]
.is_call
())
...
...
This diff is collapsed.
Click to expand it.
juno_utils/src/env.rs
+
6
−
0
View file @
1aad2842
...
...
@@ -2,6 +2,7 @@ use std::collections::HashMap;
use
std
::
collections
::
HashSet
;
use
std
::
hash
::
Hash
;
#[derive(Debug)]
pub
struct
Env
<
K
,
V
>
{
table
:
HashMap
<
K
,
Vec
<
V
>>
,
scope
:
Vec
<
HashSet
<
K
>>
,
...
...
@@ -98,6 +99,11 @@ impl<K: Eq + Hash + Copy, V> Env<K, V> {
let
mut
new_scopes
:
HashMap
<
K
,
Vec
<
usize
>>
=
HashMap
::
new
();
for
(
k
,
vs
)
in
std
::
mem
::
take
(
&
mut
self
.table
)
{
if
vs
.is_empty
()
{
assert!
(
!
scopes
.contains_key
(
&
k
));
continue
;
}
let
scope_list
=
scopes
.remove
(
&
k
)
.unwrap
();
assert!
(
scope_list
.len
()
==
vs
.len
());
...
...
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