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
954339eb
Commit
954339eb
authored
1 month ago
by
Russel Arbore
Browse files
Options
Downloads
Patches
Plain Diff
Do DC subst in float-collections
parent
b903546c
No related branches found
Branches containing commit
No related tags found
1 merge request
!148
Do DC subst in float-collections
Pipeline
#201424
passed
1 month ago
Stage: test
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
hercules_opt/src/float_collections.rs
+14
-5
14 additions, 5 deletions
hercules_opt/src/float_collections.rs
with
14 additions
and
5 deletions
hercules_opt/src/float_collections.rs
+
14
−
5
View file @
954339eb
use
std
::
collections
::
BTreeMap
;
use
std
::
collections
::
{
BTreeMap
,
HashMap
}
;
use
hercules_ir
::
*
;
use
hercules_ir
::
*
;
...
@@ -83,10 +83,6 @@ pub fn float_collections(
...
@@ -83,10 +83,6 @@ pub fn float_collections(
.map
(|(
idx
,
node
)|
(
NodeID
::
new
(
idx
),
node
.clone
()))
.map
(|(
idx
,
node
)|
(
NodeID
::
new
(
idx
),
node
.clone
()))
.collect
();
.collect
();
let
success
=
editors
.get_mut
(
&
caller
)
.unwrap
()
.edit
(|
mut
edit
|
{
let
success
=
editors
.get_mut
(
&
caller
)
.unwrap
()
.edit
(|
mut
edit
|
{
let
cons_ids
:
Vec
<
_
>
=
cons
.iter
()
.map
(|(
_
,
node
)|
edit
.add_node
(
node
.clone
()))
.collect
();
for
(
id
,
node
)
in
calls
{
for
(
id
,
node
)
in
calls
{
let
Node
::
Call
{
let
Node
::
Call
{
control
,
control
,
...
@@ -97,6 +93,19 @@ pub fn float_collections(
...
@@ -97,6 +93,19 @@ pub fn float_collections(
else
{
else
{
panic!
()
panic!
()
};
};
let
dc_args
=
(
0
..
dynamic_constants
.len
())
.map
(|
i
|
edit
.add_dynamic_constant
(
DynamicConstant
::
Parameter
(
i
)));
let
substs
=
dc_args
.zip
(
dynamic_constants
.iter
()
.map
(|
id
|
*
id
))
.collect
::
<
HashMap
<
_
,
_
>>
();
let
cons_ids
:
Vec
<
_
>
=
cons
.iter
()
.map
(|(
_
,
node
)|
{
let
mut
node
=
node
.clone
();
substitute_dynamic_constants_in_node
(
&
substs
,
&
mut
node
,
&
mut
edit
);
edit
.add_node
(
node
)
})
.collect
();
let
mut
args
=
Vec
::
from
(
args
);
let
mut
args
=
Vec
::
from
(
args
);
args
.extend
(
cons_ids
.iter
());
args
.extend
(
cons_ids
.iter
());
let
new_call
=
edit
.add_node
(
Node
::
Call
{
let
new_call
=
edit
.add_node
(
Node
::
Call
{
...
...
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