Content deleted Content added
Really bad example this loop is entirely unnecessary. |
better example; add See also section |
||
Line 13:
<source lang="C">
x = y + z;
}
</source>
The
<source lang="C">
t1 = x*x;
a[i] = 6*i + t1;
}
</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.
==See also==
* [[Loop optimization]]
* [[Compiler optimization]]
[[Category:Compiler optimizations]]
|