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)

    “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)

    “The influx of women into paid work and her increased power raise a woman’s aspirations and hopes for equal treatment at home. Her lower wage and status at work and the threat of divorce reduce what she presses for and actually expects.”
    —Arlie Hochschild (20th century)

    “A funeral is not death, any more than baptism is birth or marriage union. All three are the clumsy devices, coming now too late, now too early, by which Society would register the quick motions of man.”
    —E.M. (Edward Morgan)

    “Destiny is an absolutely definite and inexorable ruler. Physical ability and moral determination count for nothing. It is impossible to perform the simplest act when the gods say “no.” I have no idea how they bring pressure to bear on such occasions; I only know that it is irresistible.”
    —Aleister Crowley (1875–1947)