From "3.1 Reducing the number of edges" of this paper - Optimization (b)
Task (dependency) nodes have a successors list built upon passed dependency.
Given the following code, B will be added to A's successors list building the graph A -> B
// A
# pragma omp task depend(out: x)
{}
// B
# pragma omp task depend(in: x)
{}In the following code, B is currently added twice to A's successor list
// A
# pragma omp task depend(out: x, y)
{}
// B
# pragma omp task depend(in: x, y)
{}This patch removes such dupplicates by checking lastly inserted task in A successor list.
Here is another schematic example of multiple edges removed
why is the order here swapped?