Induction Variable - Application To Strength Reduction

Application To Strength Reduction

A common compiler optimization is to recognize the existence of induction variables and replace them with simpler computations; for example, the code above could be rewritten by the compiler as follows, on the assumption that the addition of a constant will be cheaper than a multiplication.

j = -17; for (i = 0; i < 10; ++i) { j = j + 17; }

This optimization is a special case of strength reduction.

Read more about this topic:  Induction Variable

Famous quotes containing the words application, strength and/or reduction:

    Great abilites are not requisite for an Historian; for in historical composition, all the greatest powers of the human mind are quiescent. He has facts ready to his hand; so there is no exercise of invention. Imagination is not required in any degree; only about as much as is used in the lowest kinds of poetry. Some penetration, accuracy, and colouring, will fit a man for the task, if he can give the application which is necessary.
    Samuel Johnson (1709–1784)

    Why, therefore, should we do ourselves this wrong,
    Or others—that we are not always strong—
    That we are sometimes overborne with care—
    That we should ever weak or heartless be,
    Anxious or troubled—when with us is prayer,
    And joy and strength and courage are with Thee?
    Richard Chenevix Trench (1807–1886)

    The reduction of nuclear arsenals and the removal of the threat of worldwide nuclear destruction is a measure, in my judgment, of the power and strength of a great nation.
    Jimmy Carter (James Earl Carter, Jr.)