S1 a = ..
S2 .. = a
Denoted S2 δ S1
S1 .. = a
S2 a = ..
Denoted S2 δ-1 S1
S1 a = ..
S2 a = ..
Denoted S2 δ0 S1
Iteration vector I of iteration is the vector of integers containing numbers for loops in order of nesting level.
If dependence distances all same, then say loop has that dependence distance. But, loop may have many different dependence distances.
Direction vector summarises directions. If first non = element is < then indicates flow dependence.
For example, given distances:
Direction is:
You can also check the Compiler Optimization course slides on the Iteration Space topic here.
Rather than looking at the problem in terms of iterations, we can consider statements individually: on what other statements they depend and specify the type and the level of loop carried dependence. We can visualize the dependence in this delta graph regardless of the number of loop levels as we are not limited at 2. Here the nodes are the statements and the edges are the delta-notation of the dependencies.
Level of loop carried dependence
Level of loop carried dependence is the index of the left-most non = in direction vector. Written as subscript, e.g.
Consider the following example:
Loop-carried:
Loop-independent:
The resulting dependence graph is this:
You can also check the Compiler Optimization course slides on the Dependence Graph topic here.