Loop-invariant code motion: Difference between revisions

Content deleted Content added
m Further Reading: Removed unnecessary capital letter
No edit summary
Line 13:
</source>
 
The calculationscalculation <code>x = y + z</code> and <code>x * x</code> can be moved outside the loop since within they are [[loop invariant]]&mdash; they do not change over the iterations of the loop&mdash; so the optimized code will be something like this:
 
<source lang="C">