Loop-invariant Code Motion

Loop-invariant Code Motion

In computer programming, loop-invariant code consists of statements or expressions (in an imperative programming language) which can be moved outside the body of a loop without affecting the semantics of the program. Loop-invariant code motion (also called hoisting or scalar promotion) is a compiler optimization which performs this movement automatically.

Read more about Loop-invariant Code Motion:  Example, Invariant Code Detection, Benefits, Further Reading

Famous quotes containing the words code and/or motion:

    “Motion or change, and identity or rest, are the first and second secrets of nature: Motion and Rest. The whole code of her laws may be written on the thumbnail, or the signet of a ring.”
    —Ralph Waldo Emerson (1803–1882)

    “Two children, all alone and no one by,
    Holding their tattered frocks, thro’an airy maze
    Of motion lightly threaded with nimble feet
    Dance sedately; face to face they gaze,
    Their eyes shining, grave with a perfect pleasure.”
    —Laurence Binyon (1869–1943)