Induction Variable - Application To Reduce Register Pressure

Application To Reduce Register Pressure

In some cases, it is possible to reverse this optimization in order to remove an induction variable from the code entirely. For example:

extern int sum; int foo(int n) { int i, j; j = 5; for (i=0; i < n; ++i) { j += 2; sum += j; } return sum; }

This function's loop has two induction variables: i and j. Either one can be rewritten as a linear function of the other; therefore, the compiler may optimize this code as if it had been written

extern int sum; int foo(int n) { int i; for (i=0; i < n; ++i) { sum += (5 + 2*(i+1)); } return sum; }

Read more about this topic:  Induction Variable

Famous quotes containing the words application to, application, reduce, register and/or pressure:

    It would be disingenuous, however, not to point out that some things are considered as morally certain, that is, as having sufficient certainty for application to ordinary life, even though they may be uncertain in relation to the absolute power of God.
    René Descartes (1596–1650)

    There are very few things impossible in themselves; and we do not want means to conquer difficulties so much as application and resolution in the use of means.
    François, Duc De La Rochefoucauld (1613–1680)

    So if hunger provokes wailing and wailing brings the breast; if the breast permits sucking and milk suggests its swallow; if swallowing issues in sleep and stomachy comfort, then need, ache, message, object, act, and satisfaction are soon associated like charms on a chain; shortly our wants begin to envision the things which well reduce them, and the organism is finally said to wish.
    William Gass (b. 1924)

    Genius ... is the capacity to see ten things where the ordinary man sees one, and where the man of talent sees two or three, plus the ability to register that multiple perception in the material of his art.
    Ezra Pound (1885–1972)

    Today’s pressures on middle-class children to grow up fast begin in early childhood. Chief among them is the pressure for early intellectual attainment, deriving from a changed perception of precocity. Several decades ago precocity was looked upon with great suspicion. The child prodigy, it was thought, turned out to be a neurotic adult; thus the phrase “early ripe, early rot!”
    David Elkind (20th century)