Loop-invariant code motion: Difference between revisions

Content deleted Content added
Reaching definitions analysis can be used for this
w/o declaring 'i' locally it has post-loop visibility, so the removal of updates to 'i' may be invalid
Line 24:
x = y + z;
t1 = x * x;
for (int i = 0; i < n; ++i) {
a[i] = 6 * i + t1;
}