Iteration - Program Optimization for Multi Core Architectures - Lecture Slides, Slides of Computer Science

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

2012/2013

Uploaded on 03/28/2013

ekanath
ekanath 🇮🇳

3.8

(4)

76 documents

1 / 8

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
Objectives_template
file:///D|/...ary,%20Dr.%20Sanjeev%20K%20Aggrwal%20&%20Dr.%20Rajat%20Moona/Multi-core_Architecture/lecture%2032/32_1.htm[6/14/2012 12:11:16 PM]
Module 16: Data Flow Analysis in Presence of Procedure Calls
Lecture 32: Iteration
The Lecture Contains:
Iteration Space
Iteration Vector
Normalized Iteration Vector
Dependence Distance
Direction Vector
Loop Carried Dependence Relations
Dependence Level
Iteration Vector - Triangular Space
Non Tightly Nested Loops
Code Sinking
Data Dependence With Conditionals
Conditionals in Loops
pf3
pf4
pf5
pf8

Partial preview of the text

Download Iteration - Program Optimization for Multi Core Architectures - Lecture Slides and more Slides Computer Science in PDF only on Docsity!

Module 16: Data Flow Analysis in Presence of Procedure Calls

Lecture 32: Iteration

The Lecture Contains:

Iteration Space

Iteration Vector

Normalized Iteration Vector

Dependence Distance

Direction Vector

Loop Carried Dependence Relations

Dependence Level

Iteration Vector - Triangular Space

Non Tightly Nested Loops

Code Sinking

Data Dependence With Conditionals

Conditionals in Loops

Module 16: Data Flow Analysis in Presence of Procedure Calls

Lecture 32: Iteration

Iteration Space

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

Iteration Vector

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

Module 16: Data Flow Analysis in Presence of Procedure Calls

Lecture 32: Iteration

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

Dependence Level

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

Iteration Vector - Triangular Space

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

Module 16: Data Flow Analysis in Presence of Procedure Calls

Lecture 32: Iteration

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

Module 16: Data Flow Analysis in Presence of Procedure Calls

Lecture 32: Iteration

Code Sinking

Data Dependence With Conditionals

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

Module 16: Data Flow Analysis in Presence of Procedure Calls

Lecture 32: Iteration

1. X = 1

2. Y = 2

  1. if Y < T then
  2. X = 2
  3. else
  4. Y = X
  5. endif
  6. Z = X + Y

Find out data dependence for X.

Definition of X in 1 and 4 Use of X at 6 and 8

Therefore

Conditionals in Loops

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

  1. for i = 2 to 9 do
  2. if a(i) > 0 then
  3. a(i) = b(i-1) + 1
  4. else
  5. b(i) = a(i) * 2
  6. endif
  7. endfor Note: