Loop-invariant code motion: Difference between revisions

Content deleted Content added
Tag: nowiki added
Line 40:
In the code fragment below, the expression (x + y) is loop invariant, and the addition can be hoisted out of the loop.
 
<source lang="C">
<nowiki>
void f (int x, int y)
{
Line 50:
}
}
</nowikisource>
Below is the code fragment after the invariant expression has been hoisted out of the loop.
<source lang="C">
<nowiki>
void f (int x, int y)
{
Line 64:
}
}
</nowikisource>
Notes: