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
Merge requests
!156
Support selection for inlining
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
Support selection for inlining
directed_inlining
into
main
Overview
0
Commits
3
Pipelines
1
Changes
5
Merged
rarbore2
requested to merge
directed_inlining
into
main
5 months ago
Overview
0
Commits
3
Pipelines
1
Changes
5
Expand
Add methodology to make editors for every function when sub-selection is given (useful for inter-procedural transformations).
Allow inlining to take in a selection.
Remove
inline(*);
from cava and edge detection.
0
0
Merge request reports
Compare
main
main (base)
and
latest version
latest version
30be516b
3 commits,
5 months ago
5 files
+
85
−
43
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
5
Search (e.g. *.vue) (Ctrl+P)
hercules_opt/src/editor.rs
+
37
−
2
Options
@@ -108,8 +108,8 @@ impl<'a: 'b, 'b> FunctionEditor<'a> {
}
}
// Constructs an editor but only makes the nodes with at least one of the
set of labels as
// mutable
// Constructs an editor but only makes the nodes with at least one of the
//
set of labels as
mutable
.
pub
fn
new_labeled
(
function
:
&
'a
mut
Function
,
function_id
:
FunctionID
,
@@ -151,6 +151,41 @@ impl<'a: 'b, 'b> FunctionEditor<'a> {
}
}
// Constructs an editor but makes every node immutable.
pub
fn
new_immutable
(
function
:
&
'a
mut
Function
,
function_id
:
FunctionID
,
constants
:
&
'a
RefCell
<
Vec
<
Constant
>>
,
dynamic_constants
:
&
'a
RefCell
<
Vec
<
DynamicConstant
>>
,
types
:
&
'a
RefCell
<
Vec
<
Type
>>
,
labels
:
&
'a
RefCell
<
Vec
<
String
>>
,
def_use
:
&
ImmutableDefUseMap
,
)
->
Self
{
let
mut_def_use
=
(
0
..
function
.nodes
.len
())
.map
(|
idx
|
{
def_use
.get_users
(
NodeID
::
new
(
idx
))
.into_iter
()
.map
(|
x
|
*
x
)
.collect
()
})
.collect
();
let
mutable_nodes
=
bitvec!
[
u8
,
Lsb0
;
0
;
function
.nodes
.len
()];
FunctionEditor
{
function
,
function_id
,
constants
,
dynamic_constants
,
types
,
labels
,
mut_def_use
,
mutable_nodes
,
modified
:
false
,
}
}
pub
fn
modified
(
&
self
)
->
bool
{
self
.modified
}
Loading