Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(1)

Issue 5786054: [google] [4.6] fix a bug in capping bb count scaling

Can't Edit
Can't Publish+Mail
Start Review
Created:
12 years, 1 month ago by xur
Modified:
12 years, 1 month ago
Reviewers:
davidxl
CC:
gcc-patches_gcc.gnu.org
Base URL:
svn+ssh://gcc.gnu.org/svn/gcc/branches/google/gcc-4_6/
Visibility:
Public.

Patch Set 1 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+3 lines, -4 lines) Patch
M gcc/tree-inline.c View 2 chunks +3 lines, -4 lines 0 comments Download

Messages

Total messages: 2
xur
Hi, This patch is for google-4_6 branch only. It fixes a bug in r184378 which ...
12 years, 1 month ago (2012-03-08 18:04:21 UTC) #1
davidxl
12 years, 1 month ago (2012-03-08 18:09:42 UTC) #2
ok.

David

On Thu, Mar 8, 2012 at 10:04 AM, Rong Xu <xur@google.com> wrote:
> Hi,
>
> This patch is for google-4_6 branch only.
>
> It fixes a bug in r184378 which makes some capping escape (like
> stale max_bb_count in cgraph node).
>
> Tested with the internal benchmark that exposes this issue.
> Tested with gcc bootstrap.
>
> -Rong
>
> 2012-03-08   Rong Xu  <xur@google.com>
>
>        * gcc/tree-inline.c (copy_cfg_body): fix the bug in r184378.
>          Google ref b/6105259.
>
> Index: gcc/tree-inline.c
> ===================================================================
> --- gcc/tree-inline.c   (revision 185095)
> +++ gcc/tree-inline.c   (working copy)
> @@ -2210,7 +2210,7 @@
>       struct cgraph_node *node = cgraph_node (callee_fndecl);
>       double f_max;
>       gcov_type max_count_scale;
> -      gcov_type max_src_bb_cnt;
> +      gcov_type max_src_bb_cnt = 0;
>       gcov_type max_value = ((gcov_type) 1 << ((sizeof(gcov_type) * 8) - 1));
>       max_value = ~max_value;
>       count_scale = (REG_BR_PROB_BASE * (double)count
> @@ -2220,14 +2220,13 @@
>          This can happen for comdat functions where the counters are split.
>          It's more likely for recursive inlines.  */
>       gcc_assert (node);
> -      max_src_bb_cnt = node->max_bb_count;
>
>       /* Find the maximum count value to that will be copied.  */
>       FOR_EACH_BB_FN (bb, cfun_to_copy)
>         if (!blocks_to_copy || bitmap_bit_p (blocks_to_copy, bb->index))
>           {
> -            if (bb->count > node->max_bb_count)
> -              max_src_bb_cnt = node->max_bb_count;
> +            if (bb->count > max_src_bb_cnt)
> +              max_src_bb_cnt = bb->count;
>           }
>
>       f_max = (double) max_value * REG_BR_PROB_BASE / max_src_bb_cnt - 1;
>
> --
> This patch is available for review at http://codereview.appspot.com/5786054
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b