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
232e6627
Commit
232e6627
authored
1 month ago
by
rarbore2
Browse files
Options
Downloads
Patches
Plain Diff
Misc.
parent
ef4797ad
No related branches found
Branches containing commit
No related tags found
1 merge request
!217
Misc.
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
hercules_opt/src/gcm.rs
+25
-0
25 additions, 0 deletions
hercules_opt/src/gcm.rs
hercules_rt/src/lib.rs
+28
-0
28 additions, 0 deletions
hercules_rt/src/lib.rs
juno_samples/rodinia/bfs/src/cpu.sch
+1
-1
1 addition, 1 deletion
juno_samples/rodinia/bfs/src/cpu.sch
with
54 additions
and
1 deletion
hercules_opt/src/gcm.rs
+
25
−
0
View file @
232e6627
...
...
@@ -221,6 +221,31 @@ fn preliminary_fixups(
}
}
// Add region nodes between join nodes and loop headers to aid in block
// placement.
for
(
_
,
join
)
in
fork_join_map
{
let
control_user
=
editor
.get_users
(
*
join
)
.filter
(|
id
|
nodes
[
id
.idx
()]
.is_control
())
.next
()
.unwrap
();
if
nodes
[
control_user
.idx
()]
.is_fork
()
||
nodes
[
control_user
.idx
()]
.try_region
()
.map
(|
preds
|
preds
.len
()
>
1
)
.unwrap_or
(
false
)
{
let
success
=
editor
.edit
(|
mut
edit
|
{
let
region
=
edit
.add_node
(
Node
::
Region
{
preds
:
Box
::
new
([
*
join
]),
});
edit
.replace_all_uses_where
(
*
join
,
region
,
|
id
|
*
id
==
control_user
)
});
assert!
(
success
);
return
true
;
}
}
false
}
...
...
This diff is collapsed.
Click to expand it.
hercules_rt/src/lib.rs
+
28
−
0
View file @
232e6627
...
...
@@ -5,6 +5,7 @@ use std::future::Future;
use
std
::
marker
::
PhantomData
;
use
std
::
ptr
::{
copy_nonoverlapping
,
write_bytes
,
NonNull
};
use
std
::
slice
::{
from_raw_parts
,
from_raw_parts_mut
};
use
std
::
sync
::
atomic
::{
AtomicUsize
,
Ordering
};
use
std
::
sync
::
OnceLock
;
/*
...
...
@@ -928,3 +929,30 @@ unsafe impl GlobalAlloc for AlignedAlloc {
#[global_allocator]
static
A
:
AlignedAlloc
=
AlignedAlloc
;
pub
struct
SpinBarrier
{
num
:
usize
,
waiting
:
AtomicUsize
,
gen
:
AtomicUsize
,
}
impl
SpinBarrier
{
pub
const
fn
new
(
num
:
usize
)
->
Self
{
SpinBarrier
{
num
,
waiting
:
AtomicUsize
::
new
(
0
),
gen
:
AtomicUsize
::
new
(
0
),
}
}
pub
fn
wait
(
&
self
)
{
let
old_gen
=
self
.gen
.load
(
Ordering
::
Acquire
);
let
old_waiting
=
self
.waiting
.fetch_add
(
1
,
Ordering
::
Relaxed
);
if
old_waiting
+
1
==
self
.num
{
self
.waiting
.store
(
0
,
Ordering
::
Relaxed
);
self
.gen
.fetch_add
(
1
,
Ordering
::
Release
);
}
else
{
while
old_gen
==
self
.gen
.load
(
Ordering
::
Acquire
)
{}
}
}
}
This diff is collapsed.
Click to expand it.
juno_samples/rodinia/bfs/src/cpu.sch
+
1
−
1
View file @
232e6627
...
...
@@ -50,7 +50,7 @@ fork-tile[32, 0, false, true](init);
let (outer, inner) = fork-reshape[[1], [0]](init);
let init_body = outline(inner);
inline(bfs@loop1, bfs@loop2);
inline(
bfs@cost_init,
bfs@loop1, bfs@loop2);
delete-uncalled(*);
const-inline(*);
simpl!(*);
...
...
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