English: Loop-invariant code motion is a common optimization performed by almost all optimizing compilers. This optimization moves code which is not reliant on the loop itself outside (or "above") the loop. This is to avoid accidentally performing the same operation redundantly.
Many operations do not qualify for loop invariant code motion, such as operations which may write to memory (such as a function call), but this varies greatly from compiler to compiler.
The person who associated a work with this deed has dedicated the work to the public domain by waiving all of their rights to the work worldwide under copyright law, including all related and neighboring rights, to the extent allowed by law. You can copy, modify, distribute and perform the work, even for commercial purposes, all without asking permission.
http://creativecommons.org/publicdomain/zero/1.0/deed.enCC0Creative Commons Zero, Public Domain Dedicationfalsefalse
Captions
A diagram depicting loop-invariant code motion over an execution graph.