R
Roedy Green
If I wrote some code like this:
for ( int i=0; i<n; i++ )
{
if ( x )
{
a( i );
}
else
{
b( i );
}
}
A clever compiler might notice that x in invariant inside the loop,
and note really does not need to test x inside the loop. It can
replace that code with something like this:
if ( x ) for ( int i=0; i<n; i++ )
{
a( i );
}
else for ( int i=0; i<n; i++ )
{
b( i );
}
What is that called?
for ( int i=0; i<n; i++ )
{
if ( x )
{
a( i );
}
else
{
b( i );
}
}
A clever compiler might notice that x in invariant inside the loop,
and note really does not need to test x inside the loop. It can
replace that code with something like this:
if ( x ) for ( int i=0; i<n; i++ )
{
a( i );
}
else for ( int i=0; i<n; i++ )
{
b( i );
}
What is that called?