




Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
These are the Lecture Slides of Program Optimization for Multi Core Architectures which includes Triangular Lower Limits, Multiple Loop Limits, Dependence System Solvers, Single Equation, Simple Test, Extreme Value Test etc.Key important points are: Iteration, Iteration Vector, Normalized Iteration Vector, Dependence Distance, Direction Vector, Loop Carried Dependence Relations, Dependence Level
Typology: Slides
1 / 8
This page cannot be seen from the preview
Don't miss anything!





Concept associated with the loops Contains one point for each iteration of the loop If a statement in one iteration dependes on a statement in another iteration then dependence is represented by an edge from source to target (called iteration space dependence graph)
for i = 2 to 9 do x[i] =... =... x[i-1]... endfor
Space requirement too large Compiler can not always determine number of iterations
Each iteration is assigned a vector iv = ( I 1 , I 2 ,.. ., In ) Where I (^) k is the value of loop index variable of kth nested loop at that iteration.
for i = 3 to 7 do for j = 6 to 2 step -2 do a[i,j] = a[i,,j+2] + 1 endfor endfor
For statements involving A[i,,j] distance vector (0,0) direction vector (=,=) dependence is loop independent For statements involving B[i,,j] distance vector (0,1) direction vector (=,<) dependence is carried by the inner loop For statements involving C[i,,j] distance vector (1,-1) direction vector (<,>) dependence is carried by the outer loop
Loop nest level that carries the data dependence relation
Therefore, for C[i,,j] level is 1 for B[i,,j] level is 2 for A[i,,j] level is
Advantages of normalized iteration vector:
Later iterations have larger iteration vector Adjacent iterations differ by only one However, neither of these require first iteration to have vector (0,0, · · ·, 0).
Consider following program:
for i = 1 to 7 do for j = i to 7 do A[i+1,,j] = A[i,,j]+ endfor endfor
Dependence distance vector is (1, -1)
A more natural way to depict such a loop is to assign iteration vectors that give triangular space as:
Semi normalized iteration vector: when distance between successive iterations is 1 and the lower limit is not zero
There must be a path from definition to use In case of conditionals, path cannot be determined at compile time Any path may be taken at runtime Data dependence cannot occur between statements in alternate paths
Find out data dependence for X.
Definition of X in 1 and 4 Use of X at 6 and 8
Therefore
Statements that can’t be executed on the same iteration cannot be involved in a loop- independent dependence Conditionals do not affect loop carried dependence