What is Loop unrolling?

Replicating a loop body several times to reduce the number of iterations. It cuts branch and counter overhead and gives more freedom to reorder instructions, at the cost of larger code.

Field: Compilers

Loop unrolling in the explanations

Questions that mention Loop unrolling (5)

  1. What is the main effect of loop unrolling?
  2. Which describes a basic block?
  3. Which is an example of constant folding by a compiler?
  4. In the loop above, which transformation applies strength reduction to the index computation i * 4?
  5. What is the main purpose of loop blocking (tiling), used for example in matrix multiplication?

Related terms

Basic block Control-flow graph Constant folding Strength reduction Loop blocking Abstract syntax tree Common subexpression elimination Function inlining Instruction scheduling Intermediate representation

Back to the glossary