Google
 
   
Login
Username:

Password:


Lost Password?

Register now!
Search
Main Menu
top books
Polls
What do you think about php-deluxe.net?
Excellent!
Cool
Hmm..not bad
What the hell is this?
encyclopedia
recommendation
compare webbrowser
Freenet DSL
Who's Online
13 user(s) are online (10 user(s) are browsing encyclopedia)

Members: 0
Guests: 13

more...
browser tip
Unix Befehle
manual of unix befehle
recommendation!
Sponsored
partner

Loop dependence analysis

In compiler theory, loop dependence analysis is the task of determining whether statements within a loop body form a dependence analysis, almost always with respect to array access and modification. For a normalized loop:

for i1 from l1 to u1 do for i2 from l2 to u2 do ... for in from ln to un do body od od od

where body may contain:

S1 a[f1(i1, ..., in), ..., fm(i1, ..., in)] := ... ... S2 ... := a[h1(i1, ..., in), ..., hm(i1, ..., in)]

the scope of the problem is to find all possible dependencies between S1 and S2. To be conservative, any dependence which cannot be proven false must be assumed to be true.

In the course of (dis)proving such dependencies, a statement S may be decomposed according to which iteration it comes from. For instance, S[1,3,5] refers to the iteration where i1 = 1, i2 = 3 and i3 = 5. Of course, references to abstract iterations, such as S[d1+1,d2,d3], are both permitted and common.

Independence is shown by demonstrating that no two instances of S1 and S2 access or modify the same spot in array a. When a possible dependence is found, loop dependence analysis usually makes every attempt to characterize the relationship between dependent instances, as some optimizations may still be possible. It may also be possible to loop transformation the loop to remove the dependence.

= Iteration vectors =

A specific iteration through a normalized loop is referenced through an iteration vector, which encodes the state of each iteration variable.

For a loop, an iteration vector is a member of the Cartesian product of the bounds for the loop variables. In the nomalized form given previously, this space is defined to be [l1..u1] Ã? [l2..u2] Ã? ... Ã? [ln..un]. As noted, specific (or general) instances of statements may be parameterized by these iteration vectors, and they are also the domain of the array subscript functions found in the body of the loop. Of particular relevance, these vectors form a lexicographic order which corresponds with the chronological execution order.

= Dependence =

For the normalized form above, a dependence between S1 and S2 exists if and only if:

  • a and b are two iteration vectors.
  • f(a) = h(b).
  • where vector function notation has been used. Without vector notation, the second constraint becomes: f1(a1,a2, ..., an) = h1(b1,b2, ..., bn) and ... and fm(a1,a2, ..., an) = hm(b1,b2, ..., bn).

    If a < b, then this is a dependence analysis. If a > b, then this is an dependence analysis.

    = Devices and techniques =

    Several established devices and techniques exist for tackling the loop dependence problem. For characterizing the nature of a dependence, there are distance vectors, direction vectors and dependence vectors. For determining whether a dependence exists, the GCD test and the Banerjee test are the most general tests in common use, while a variety of techniques exist for simpler cases.

    = Further reading =

    *

  • = See also =

  • Dependence analysis
  • Loop transformation
  • Loop splitting
  • Loop fusion
  • Loop interchange
  • Loop skewing