Next: ...
Up: Nested loops
Previous: Nested loops
Consider the dependence equations:
for I1 = 0 to 3 do
for I2 = 0 to 3 do
S: A[I1,I2] := A[I1 - 1,I2] + A[I1,I2 - 1]
There are two potential dependences arising from the three references to A.
Therefore two systems of dependence equations to solve:
- 1.
- Between A[I11,I21] and A[I12 - 1,I22]:
- 2.
-
Between A[I11,I21] and A[I12,I22 - 1]:
((strictly we should also consider output dependences between A[I11,I21] and A[I12,I22], but this is
obviously absent)).