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

work on bfs

parent 3b1aa5d4
No related branches found
No related tags found
2 merge requests!215Large benches,!214More optimizations
Pipeline #202013 failed
...@@ -44,11 +44,12 @@ fn bfs<n, m: usize>(graph_nodes: Node[n], source: u32, edges: u32[m]) -> i32[n] ...@@ -44,11 +44,12 @@ fn bfs<n, m: usize>(graph_nodes: Node[n], source: u32, edges: u32[m]) -> i32[n]
@loop2 for i in 0..n { @loop2 for i in 0..n {
stop = stop && !updated[i]; stop = stop && !updated[i];
if updated[i] { }
mask[i] = true;
visited[i] = true; @loop3 for i in 0..n {
updated[i] = false; mask[i] = mask[i] || updated[i];
} visited[i] = visited[i] || updated[i];
updated[i] = false;
} }
} }
......
...@@ -11,9 +11,9 @@ macro simpl!(X) { ...@@ -11,9 +11,9 @@ macro simpl!(X) {
phi-elim(bfs); phi-elim(bfs);
no-memset(bfs@cost); no-memset(bfs@cost);
let init = outline(bfs@cost_init); let init = outline(bfs@cost_init);
let loop1 = outline(bfs@loop1); let traverse = outline(bfs@loop1);
let loop2 = outline(bfs@loop2); let collect = outline(bfs@loop2 | bfs@loop3);
parallel-reduce(loop1); parallel-reduce(traverse);
simpl!(*); simpl!(*);
predication(*); predication(*);
...@@ -27,13 +27,15 @@ fixpoint { ...@@ -27,13 +27,15 @@ fixpoint {
simpl!(*); simpl!(*);
predication(*); predication(*);
simpl!(*); simpl!(*);
reduce-slf(*);
simpl!(*);
fork-tile[32, 0, false, false](loop1); fixpoint {
let split = fork-split(loop1); forkify(collect);
let out = outline(split.bfs_1.fj1); fork-guard-elim(collect);
unforkify(out); }
inline(bfs@loop1); fork-fusion(collect);
delete-uncalled(*); simpl!(collect);
unforkify(init); unforkify(init, traverse, collect);
gcm(*); 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