for I1 = 0 to 3 doFor humans the easy way to understand this loop nest is to draw the iteration space showing the iteration-to-iteration dependences:
for I2 = 0 to 3 do
S: A[I1,I2] := A[I1 - 1,I2] + A[I1,I2 - 1]
S00 | 0
|
S01 | 0
|
S02 | 0
|
S03 | ||||||||||||
![]() ![]() |
![]() ![]() |
![]() ![]() |
![]() ![]() |
|||||||||||||||
S10 | 0
|
S11 | 0
|
S12 | 0
|
S13 | ||||||||||||
![]() ![]() |
![]() ![]() |
![]() ![]() |
![]() ![]() |
|||||||||||||||
S20 | 0
|
S21 | 0
|
S22 | 0
|
S23 | ||||||||||||
![]() ![]() |
![]() ![]() |
![]() ![]() |
![]() ![]() |
|||||||||||||||
S30 | 0
|
S31 | 0
|
S32 | 0
|
S33 |
The diagram shows an arrow for each solution of each dependence equation.