Loop-invariant code motion: Difference between revisions

Content deleted Content added
m Explain why 6 * i is not necessary as a temporary
m Example: typo
Line 29:
</source>
 
This code can be optimized further. For example, [[strength reduction]] could remove the two multiplications inside the loop (<code>6*i</code> and <code>a[i]</code>), and [[induction variable]] elimination could then elide <code>i</code> completely. Since <code>6 * i</code> must needs be in lock step with <code>i</code> itself, there is no need to have both.
 
==See also==