Computer Programming Software Terms, Glossary and Dictionary
Loop-Invariant Code Motion
Loop-invariant code motion is a compiler optimization technique which performs loop-invariant code movement automatically to improve execution speed. Loop-invariant code in an imperative programming language consists of statements which could be moved to before the loop (if the loop always terminates), or after the loop, without affecting the semantics of the program. As a result, it is executed less often.