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
2b60a19f
Commit
2b60a19f
authored
1 month ago
by
Russel Arbore
Browse files
Options
Downloads
Patches
Plain Diff
Allocate more memory for calls inside fork-joins
parent
3d1e5b15
No related branches found
No related tags found
1 merge request
!198
Optimization for miranda
Pipeline
#201859
passed
1 month ago
Stage: test
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
hercules_opt/src/gcm.rs
+21
-2
21 additions, 2 deletions
hercules_opt/src/gcm.rs
with
21 additions
and
2 deletions
hercules_opt/src/gcm.rs
+
21
−
2
View file @
2b60a19f
...
@@ -152,6 +152,7 @@ pub fn gcm(
...
@@ -152,6 +152,7 @@ pub fn gcm(
let
backing_allocation
=
object_allocation
(
let
backing_allocation
=
object_allocation
(
editor
,
editor
,
typing
,
typing
,
fork_join_nest
,
&
node_colors
,
&
node_colors
,
&
alignments
,
&
alignments
,
&
liveness
,
&
liveness
,
...
@@ -1148,6 +1149,7 @@ fn add_extra_collection_dims(
...
@@ -1148,6 +1149,7 @@ fn add_extra_collection_dims(
collect
:
new_cons
,
collect
:
new_cons
,
indices
:
Box
::
new
([
Index
::
Position
(
tids
.into_boxed_slice
())]),
indices
:
Box
::
new
([
Index
::
Position
(
tids
.into_boxed_slice
())]),
});
});
edit
.sub_edit
(
id
,
new_cons
);
edit
=
edit
.replace_all_uses
(
id
,
read
)
?
;
edit
=
edit
.replace_all_uses
(
id
,
read
)
?
;
edit
=
edit
.delete_node
(
id
)
?
;
edit
=
edit
.delete_node
(
id
)
?
;
Ok
(
edit
)
Ok
(
edit
)
...
@@ -1639,6 +1641,7 @@ fn type_size(edit: &mut FunctionEdit, ty_id: TypeID, alignments: &Vec<usize>) ->
...
@@ -1639,6 +1641,7 @@ fn type_size(edit: &mut FunctionEdit, ty_id: TypeID, alignments: &Vec<usize>) ->
fn
object_allocation
(
fn
object_allocation
(
editor
:
&
mut
FunctionEditor
,
editor
:
&
mut
FunctionEditor
,
typing
:
&
Vec
<
TypeID
>
,
typing
:
&
Vec
<
TypeID
>
,
fork_join_nest
:
&
HashMap
<
NodeID
,
Vec
<
NodeID
>>
,
node_colors
:
&
FunctionNodeColors
,
node_colors
:
&
FunctionNodeColors
,
alignments
:
&
Vec
<
usize
>
,
alignments
:
&
Vec
<
usize
>
,
_liveness
:
&
Liveness
,
_liveness
:
&
Liveness
,
...
@@ -1664,7 +1667,7 @@ fn object_allocation(
...
@@ -1664,7 +1667,7 @@ fn object_allocation(
}
}
}
}
Node
::
Call
{
Node
::
Call
{
control
:
_
,
control
,
function
:
callee
,
function
:
callee
,
ref
dynamic_constants
,
ref
dynamic_constants
,
args
:
_
,
args
:
_
,
...
@@ -1694,9 +1697,25 @@ fn object_allocation(
...
@@ -1694,9 +1697,25 @@ fn object_allocation(
callee_backing_size
,
callee_backing_size
,
&
mut
edit
,
&
mut
edit
,
);
);
// Multiply the backing allocation size of the
// callee by the number of parallel threads that
// will call the function.
let
forks
=
&
fork_join_nest
[
&
control
];
let
factors
:
Vec
<
_
>
=
forks
.into_iter
()
.rev
()
.flat_map
(|
id
|
edit
.get_node
(
*
id
)
.try_fork
()
.unwrap
()
.1
.into_iter
())
.map
(|
dc
|
*
dc
)
.collect
();
let
mut
multiplied_callee_backing_size
=
callee_backing_size
;
for
factor
in
factors
{
multiplied_callee_backing_size
=
edit
.add_dynamic_constant
(
DynamicConstant
::
mul
(
multiplied_callee_backing_size
,
factor
),
);
}
*
total
=
edit
.add_dynamic_constant
(
DynamicConstant
::
add
(
*
total
=
edit
.add_dynamic_constant
(
DynamicConstant
::
add
(
*
total
,
*
total
,
callee_backing_size
,
multiplied_
callee_backing_size
,
));
));
}
}
}
}
...
...
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