
Homework 3
Page 1
Supercompilers
Homework 3
Due February 9, 2009
30 Points
1. Apply the codegen algorithm to the following code. Make sure you show the complete
dependence graph and show what happens at each recursive call.
DO K = 1, 100
DO J = 1, 100
S
1 B( 1, J, K ) = A( 1, J-1, K )
DO I = 1, 100
S
2 A( I+1, J, K ) = b(I, 100-J, K) + C
ENDDO
ENDDO
ENDDO
2. In each of the following examples, suppose you are testing for dependence of statement S
upon itself. Which subscript positions are separable? Which are coupled? Which
dependence test would be applied to each position by the dependence testing procedure?
a. DO K = 1, 100
DO J = 1, 100
DO I = 1, 100
S A(I+1,J+1,K+1) = A(I,J,1) + C
ENDDO
ENDDO
ENDDO
b. DO K = 1, 100
DO J = 1, 100
DO I = 1, 100
S A(I+1, J+K+1, K+1) = A(I, J, K) + C
ENDDO
ENDDO
ENDDO
c. DO K = 1, 100
DO J = 1, 100
DO I = 1, 100
S A(I+1, J+K+1, I) = A(I, J, 2) + C
ENDDO
ENDDO
ENDDO