Loop-invariant code motion: Difference between revisions

Content deleted Content added
MathsPoetry (talk | contribs)
MathsPoetry (talk | contribs)
if this is really C code, we're likely to want to initialize a[0] :-)
Line 7:
 
<source lang="C">
for (i = 0; i < n; i++i) {
x = y + z;
a[i] = 6 * i + x * x;
Line 18:
x = y + z;
t1 = x * x;
for (int i = 0; i < n; i++i) {
a[i] = 6 * i + t1;
}