Skip to content
Snippets Groups Projects
Commit 7c66673d authored by Russel Arbore's avatar Russel Arbore
Browse files

BFS needs const inlining

parent 0303d9e8
No related branches found
No related tags found
1 merge request!202Round 1 of rodinia schedule optimization
Pipeline #201893 passed
......@@ -22,4 +22,3 @@ fixpoint {
}
gcm(*);
......@@ -13,6 +13,8 @@ fn main() {
JunoCompiler::new()
.file_in_src("bfs.jn")
.unwrap()
.schedule_in_src("cpu.sch")
.unwrap()
.build()
.unwrap();
}
......@@ -13,8 +13,8 @@ fn bfs<n, m: usize>(graph_nodes: Node[n], source: u32, edges: u32[m]) -> i32[n]
let visited: bool[n];
visited[source as u64] = true;
let cost: i32[n];
for i in 0..n {
@cost let cost: i32[n];
@cost_init for i in 0..n {
cost[i] = -1;
}
cost[source as u64] = 0;
......@@ -25,7 +25,7 @@ fn bfs<n, m: usize>(graph_nodes: Node[n], source: u32, edges: u32[m]) -> i32[n]
while !stop {
stop = true;
for i in 0..n {
@loop1 for i in 0..n {
if mask[i] {
mask[i] = false;
......@@ -42,7 +42,7 @@ fn bfs<n, m: usize>(graph_nodes: Node[n], source: u32, edges: u32[m]) -> i32[n]
}
}
for i in 0..n {
@loop2 for i in 0..n {
if updated[i] {
mask[i] = true;
visited[i] = true;
......
macro simpl!(X) {
ccp(X);
simplify-cfg(X);
lift-dc-math(X);
gvn(X);
phi-elim(X);
dce(X);
infer-schedules(X);
}
phi-elim(bfs);
no-memset(bfs@cost);
outline(bfs@cost_init);
let loop1 = outline(bfs@loop1);
let loop2 = outline(bfs@loop2);
simpl!(*);
predication(*);
fixpoint {
forkify(*);
fork-guard-elim(*);
fork-coalesce(*);
}
gcm(*);
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment