Normalized loop

From Wikipedia, the free encyclopedia

In computer science, a normalized loop (sometimes called well-behaved loop), is a loop in which the loop variable starts at 0 (or any constant) and gets incremented by one at every iteration until the exit condition is met. Normalized loops are very important for compiler theory, loop dependence analysis as they simplify the data dependence analysis.[citation needed][1]

A well behaved loop is normally of the form:

for ( i = 0; i < MAX; i++ )
  a[i] = b[i] + 5;

Because the increment is unitary and constant, it's very easy to see that, if both a and b are bigger than MAX, this loop will never access memory outside the allocated range.

Non-normalized loops

See also

References

Related Articles

Wikiwand AI