Information Technology Reference
In-Depth Information
The loop is said to have been unrolled twice, and the unrolled loop should run faster
because of reduction in loop overhead. Loop unrolling initially was developed for
reducing loop overhead and for exposing instruction-level parallelism for machines
with multiple functional units.
17.7.9
Loop Jamming
Loop jamming is a technique in which two loops essentially can be combined into
a single loop. The advantages of loop jamming are that loop overhead is reduced,
which results in a speed-up in execution as well as a reduction in code space. The
following is an example of loop jamming:
LOOP I = 1 to 100
A(I) := 0
ENDLOOP
LOOP I := 1 to 100
B(I) = X(I) + Y
ENDLOOP
These two loops can be combined together to produce a single loop 39 :
LOOP I = 1 to 100
A(I) = 0
B(I) = X(I) + Y
ENDLOOP
The conditions for performing this optimization are that the loop indices be the same,
and the computations in one loop cannot depend on the computations in the other
loop.
17.7.10
Other Techniques
There are other optimization techniques available as well, which will be discussed
briefly.
39 http://web.cs.wpi.edu/
kal/PLT/PLT10.2.5.html
Search WWH ::




Custom Search