Module 17: Loops
  Lecture 34: Symbolic Analysis
 


Simple Test


Simplest test when a single loop (2 unknowns) and a single dimension with linear subscript expression.

Definition
Use


And assume same coefficient

 
  • This has integer solution if gcd of coefficients divides rhs
  • In this case gcd(a, a) = a
    Therefore, if a divides then there is a dependence

Example

For I = 2 to 10 do


Endfor

Using normalized loop,

Therefore,

   

Therefore,

  • Now determine actual dependence solution
    • Either a flow dependence with distance Therefore,
    • Or, anti-dependence with distance Therefore,
      Therefore, or