overview: optimize a program's execution speed at the expense of code size
The goal of loop unwinding is to increase a program's speed byreducing (or eliminating) <Not necessary eliminate iterations>instructions that control the loop, such as pointer arithmetic and "end of loop" tests on each iteration;reducing branch penalties; as well as "hiding latencies, in particular, the delay in reading data from memory".To eliminate this overhead, loops can be re-written as a repeated sequence of similar independent statements.
----From Wikipedia
My understanding:
reduce branch misprediction
gcc options:
-funroll-loops: unroll loops whose number of iterations can be determined at compile time or upon entry to the loop
-funroll-all-loops