Skip to content
Snippets Groups Projects

Fix reduce cycles and nodes in fork joins

Merged rarbore2 requested to merge fix-juno_matmul-schedule into main
2 files
+ 14
6
Compare changes
  • Side-by-side
  • Inline
Files
2
@@ -177,7 +177,7 @@ pub fn nodes_in_fork_joins(
let mut set = HashSet::new();
set.insert(*fork);
// Iterate uses of fork.
// Iterate uses of the fork.
while let Some(item) = worklist.pop() {
for u in def_use.get_users(item) {
let terminate = *u == *join
@@ -189,11 +189,15 @@ pub fn nodes_in_fork_joins(
worklist.push(*u);
}
set.insert(*u);
}
}
assert!(set.contains(join));
// Nodes in reduce cycles might not depend on the thread ID.
if terminate && let Some(cycle) = reduce_cycles.get(u) {
set.extend(cycle);
}
// Add all the nodes in the reduce cycle. Some of these nodes may not
// use thread IDs of the fork, so do this explicitly.
for u in def_use.get_users(*join) {
if let Some(cycle) = reduce_cycles.get(u) {
set.extend(cycle);
}
}
Loading