Module 16: Data Flow Analysis in Presence of Procedure Calls
  Lecture 31: Data Dependence Analysis
 


Example:

do I = 1, 100
X( 2I+1 ) = ....
...... = X( 2I+4 )
enddo

S1
S2

  • Is there a dependence from S1 to S2 ?
  • Coarse grain analysis: S1 writes into X and S2 reads from X. Therefore,
    S1 → S2 or S1 S2
  • Fine grain analysis:
    Eqn: 2i1 + 1 = 2i2 + 4
    has no integer solution
    Therefore, no dependence from S1 to S2
DO I = 1, 50
X(I) = ....
.... = X(I+50)
ENDDO
  • Fine grain analysis:
    Eqn. i1 = i2 + 50 has integer solution.
  • However, no integer solution in the range
    1 ≤ i1 ≤ i2 ≤ 50
    therefore, no dependence from S1 to S2
  • If are general functions, then the problem is intractable.
  • If are linear functions of loop index, then to test dependence we need to find values of two integers such that


which can be rewritten as


These are called Linear Diophantine Equations.