[google gcc-4_8] increase builtin_expect probability in loop exit test

2013-10-11 Thread Rong Xu
The trunk version of this patch is submitted for review. David: can we have this patch for google/gcc-4_8 branch first? It tested with regression and google internal benchmarks. Thanks, -Rong 2013-10-11 Rong Xu x...@google.com * predict.c (tree_predict_by_opcode): Bump the

Re: [google gcc-4_8] increase builtin_expect probability in loop exit test

2013-10-11 Thread Xinliang David Li
Why this 'percent += 4' instead of taking the max? David On Fri, Oct 11, 2013 at 2:10 PM, Rong Xu x...@google.com wrote: The trunk version of this patch is submitted for review. David: can we have this patch for google/gcc-4_8 branch first? It tested with regression and google internal

Re: [google gcc-4_8] increase builtin_expect probability in loop exit test

2013-10-11 Thread Rong Xu
I want to differentiate the cases w/o and w/ builtin. If I take the max, they will be the same (91%). -Rong On Fri, Oct 11, 2013 at 2:26 PM, Xinliang David Li davi...@google.com wrote: Why this 'percent += 4' instead of taking the max? David On Fri, Oct 11, 2013 at 2:10 PM, Rong Xu

Re: [google gcc-4_8] increase builtin_expect probability in loop exit test

2013-10-11 Thread Xinliang David Li
Should it be max + some_delta then? David On Fri, Oct 11, 2013 at 2:32 PM, Rong Xu x...@google.com wrote: I want to differentiate the cases w/o and w/ builtin. If I take the max, they will be the same (91%). -Rong On Fri, Oct 11, 2013 at 2:26 PM, Xinliang David Li davi...@google.com wrote:

Re: [google gcc-4_8] increase builtin_expect probability in loop exit test

2013-10-11 Thread Rong Xu
ok. that makes sense. On Fri, Oct 11, 2013 at 2:41 PM, Xinliang David Li davi...@google.com wrote: Should it be max + some_delta then? David On Fri, Oct 11, 2013 at 2:32 PM, Rong Xu x...@google.com wrote: I want to differentiate the cases w/o and w/ builtin. If I take the max, they will

Re: [google gcc-4_8] increase builtin_expect probability in loop exit test

2013-10-11 Thread Rong Xu
here is the new patch. Note that the hitrate won't change by this patch for the case of while (__builtin_expect (exp, 0)) Index: predict.c === --- predict.c (revision 203462) +++ predict.c (working copy) @@ -1951,11 +1951,42 @@

Re: [google gcc-4_8] increase builtin_expect probability in loop exit test

2013-10-11 Thread Xinliang David Li
ok for google branch. David On Fri, Oct 11, 2013 at 3:17 PM, Rong Xu x...@google.com wrote: here is the new patch. Note that the hitrate won't change by this patch for the case of while (__builtin_expect (exp, 0)) Index: predict.c