Re: [PATCH]: Add static branch predict heuristic of comparing IV to loop_bound variable

2012-01-09 Thread Dehao Chen
Hello, Attached is the updated version of the patch. Passed the bootstrap and gcc testsuite. Thanks, Dehao Index: gcc/testsuite/gcc.dg/predict-3.c === --- gcc/testsuite/gcc.dg/predict-3.c(revision 0) +++ gcc/testsuite/gcc.dg/pr

[PATCH]: Add static branch predict heuristic of comparing IV to loop_bound variable

2011-12-29 Thread Dehao Chen
Hello, This patch add a static branch predict heuristic for the following cases: for (int i = 0; i < bound; i++) { if (i < bound - 2) computation_1(); else computation_2(); } In this case, we would predict the branch to be taken because it's comparing loop induction variable to loop