Skip to content
Snippets Groups Projects

Fix issue #21

Merged rarbore2 requested to merge fix_antideps into main
4 files
+ 39
1
Compare changes
  • Side-by-side
  • Inline
Files
4
+ 7
0
@@ -324,6 +324,12 @@ fn basic_blocks(
@@ -324,6 +324,12 @@ fn basic_blocks(
// 3: If the node producing the collection is a reduce node, then any read
// 3: If the node producing the collection is a reduce node, then any read
// users that aren't in the reduce's cycle shouldn't anti-depend user any
// users that aren't in the reduce's cycle shouldn't anti-depend user any
// mutators in the reduce cycle.
// mutators in the reduce cycle.
 
//
 
// Because we do a liveness analysis based spill of collections, anti-
 
// dependencies can be best effort. Thus, when we encounter a read and
 
// mutator where the read doesn't dominate the mutator, but an anti-depdence
 
// edge is derived for the pair, we just don't draw the edge since it would
 
// break the scheduler.
let mut antideps = BTreeSet::new();
let mut antideps = BTreeSet::new();
for id in reverse_postorder.iter() {
for id in reverse_postorder.iter() {
// Find a terminating read node and the collections it reads.
// Find a terminating read node and the collections it reads.
@@ -385,6 +391,7 @@ fn basic_blocks(
@@ -385,6 +391,7 @@ fn basic_blocks(
.get(root)
.get(root)
.map(|cycle| cycle.contains(mutator))
.map(|cycle| cycle.contains(mutator))
.unwrap_or(false))
.unwrap_or(false))
 
&& dom.does_dom(schedule_early[id.idx()].unwrap(), mutator_early)
{
{
antideps.insert((*id, *mutator));
antideps.insert((*id, *mutator));
}
}
Loading