A data dependence is loop independent if dependence is between instances in the same iteration
Consider a loop
do i = 1, N
X( f(i) ) = .....
...... = X( g(i) )
enddo |
S1
S2 |
there is a loop independent dependence from S1 to S2 if there is an integer i such that
| 1 ≤ i ≤ N and f(i) = g(i) |
OR
there is an iteration in which S1 writes into X and S2 reads from the same element of X.
A data dependence is loop dependent if dependence is between different iterations.
there is a loop dependent dependence from S1 to S2 if there exist integers i1 and i2 such that
| 1 ≤ i1 < i2 ≤ N and f(i1) = g(i2) |
OR
S1 writes into X in iteration i1 and S2 reads from the same location in a later iteration i2.
Therefore, to find out data dependence from S1 to S2, one has to solve
f(i1) = g(i2)
such that 1 ≤ i1 ≤ i2 ≤ N holds. |
|