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

fix reduce cycles

parent d67263e6
No related branches found
No related tags found
3 merge requests!157Fork fission bufferize,!144Forkify fixes,!142More fork tests, bug fixes in fork passes and GPU backend
Pipeline #201334 passed
This commit is part of merge request !144. Comments created here will be created in the context of that merge request.
...@@ -140,23 +140,23 @@ fn reduce_cycle_dfs_helper( ...@@ -140,23 +140,23 @@ fn reduce_cycle_dfs_helper(
} }
current_visited.insert(iter); current_visited.insert(iter);
let found_reduce = get_uses(&function.nodes[iter.idx()]) let mut found_reduce = false;
.as_ref()
.into_iter() // This doesn't short circuit on purpose.
.any(|u| { for u in get_uses(&function.nodes[iter.idx()]).as_ref() {
!current_visited.contains(u) found_reduce |= !current_visited.contains(u)
&& !function.nodes[u.idx()].is_control() && !function.nodes[u.idx()].is_control()
&& isnt_outside_fork_join(*u) && isnt_outside_fork_join(*u)
&& reduce_cycle_dfs_helper( && reduce_cycle_dfs_helper(
function, function,
*u, *u,
fork, fork,
reduce, reduce,
current_visited, current_visited,
in_cycle, in_cycle,
fork_join_nest, fork_join_nest,
) )
}); }
if found_reduce { if found_reduce {
in_cycle.insert(iter); in_cycle.insert(iter);
} }
......
...@@ -18,6 +18,9 @@ fixpoint panic after 20 { ...@@ -18,6 +18,9 @@ fixpoint panic after 20 {
fork-guard-elim(*); fork-guard-elim(*);
fork-coalesce(*); fork-coalesce(*);
} }
gvn(*);
phi-elim(*);
dce(*);
gvn(*); gvn(*);
phi-elim(*); phi-elim(*);
...@@ -27,6 +30,12 @@ fixpoint panic after 20 { ...@@ -27,6 +30,12 @@ fixpoint panic after 20 {
infer-schedules(*); infer-schedules(*);
} }
fork-split(*); fork-split(*);
gvn(*);
phi-elim(*);
dce(*);
unforkify(*); unforkify(*);
gvn(*);
phi-elim(*);
dce(*);
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