Loop unrolling
The loop body is copied several times per iteration, so the counter, comparison and branch run less often.
A loop summing an array does an add, an increment, a compare and a jump per element — three quarters bookkeeping. Unroll it four times and you get four adds per iteration, plus a small tail for the leftovers. More important today is that the unrolled operations become independent of one another, so the CPU can run them in parallel or the compiler can fuse them into SIMD instructions.
Tom Duff at Lucasfilm wrote his famous 1983 version, in which a switch jumps straight into the middle of an unrolled do loop. Modern compilers do the job better on their own, and too much unrolling floods the instruction cache — which is why GCC doesn't enable -funroll-loops even at -O2.