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(
}
current_visited.insert(iter);
let found_reduce = get_uses(&function.nodes[iter.idx()])
.as_ref()
.into_iter()
.any(|u| {
!current_visited.contains(u)
&& !function.nodes[u.idx()].is_control()
&& isnt_outside_fork_join(*u)
&& reduce_cycle_dfs_helper(
function,
*u,
fork,
reduce,
current_visited,
in_cycle,
fork_join_nest,
)
});
let mut found_reduce = false;
// This doesn't short circuit on purpose.
for u in get_uses(&function.nodes[iter.idx()]).as_ref() {
found_reduce |= !current_visited.contains(u)
&& !function.nodes[u.idx()].is_control()
&& isnt_outside_fork_join(*u)
&& reduce_cycle_dfs_helper(
function,
*u,
fork,
reduce,
current_visited,
in_cycle,
fork_join_nest,
)
}
if found_reduce {
in_cycle.insert(iter);
}
......
......@@ -18,6 +18,9 @@ fixpoint panic after 20 {
fork-guard-elim(*);
fork-coalesce(*);
}
gvn(*);
phi-elim(*);
dce(*);
gvn(*);
phi-elim(*);
......@@ -27,6 +30,12 @@ fixpoint panic after 20 {
infer-schedules(*);
}
fork-split(*);
gvn(*);
phi-elim(*);
dce(*);
unforkify(*);
gvn(*);
phi-elim(*);
dce(*);
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