What is Strength reduction?

Replacing expensive operations such as multiplication with cheaper ones such as addition or shifts, for example adding 4 each iteration instead of computing i * 4 every time.

Field: Compilers

Strength reduction in the explanations

Questions that mention Strength reduction (2)

  1. In the loop above, which transformation applies strength reduction to the index computation i * 4?
  2. Which describes applying common subexpression elimination to the code above?

Related terms

Loop unrolling Common subexpression elimination Abstract syntax tree Basic block Constant folding Control-flow graph Function inlining Instruction scheduling Intermediate representation JIT compilation

Back to the glossary