/**************************************************************************** * * File: PgoExample.c * * Description: Used to demonstrate the basic operation of Profile * Guided Optimization. * * Read incoming data from address 0xFFD00000 and count the * number of even values and odd values. Supplying data files * with varying numbers of odd values vs. even values will * direct the compiler to optimize the conditional statement * with a bias for the branch most likely to be taken. * ****************************************************************************/ unsigned int odds = 0; unsigned int evens = 0; volatile int* data = (volatile int*)0xFFD00000; int main( int argc, char* argv[] ) { int i; for( i=0; i<256; i++ ) { if( (*data & 0xff) % 2 != 0 ) { odds++; } else { evens++; } } return 0; }