Loop-invariant code motion: Difference between revisions

Content deleted Content added
2nd optimisation
Line 18:
j = j + calcval;
}</pre></code>
 
This can then be further optimized, leading to less overall executed code for larger values of maxval and/or smaller values of calcval.
 
<code><pre>
int calcval = (4+array[k])*pi+5;
int j = j + integer_part(maximum - 1) / calcval) * calcval;
</pre></code>
 
{{compu-stub}}