public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Jeff Law <law@redhat.com>
To: Teresa Johnson <tejohnson@google.com>,
	       Christophe Lyon <christophe.lyon@linaro.org>
Cc: Sebastian Pop <sebpop@gmail.com>,
	       "gcc-patches@gcc.gnu.org" <gcc-patches@gcc.gnu.org>,
	       Jan Hubicka <hubicka@ucw.cz>,
	David Li <davidxl@google.com>
Subject: Re: [PATCH] Redesign jump threading profile updates
Date: Thu, 02 Oct 2014 18:34:00 -0000	[thread overview]
Message-ID: <542D9ABA.8040203@redhat.com> (raw)
In-Reply-To: <CAAe5K+XWZEJPkhnM_2TFmh0VN9u_qXpVGfddUZ71YZkD8kMfXg@mail.gmail.com>

On 10/01/14 14:04, Teresa Johnson wrote:
> The block frequencies are very small in this case leading to rounding
> errors when computing the edge frequency. The rounding error was then
> propagated into the recomputed probabilities, leading to insanities in
> the outgoing edge probabilities on the jump threading path. Eventually
> during rtl expansion these insanities somehow caused an ICE.
>
> (Before this patch the probabilities weren't even being updated,
> leading to insanities in other cases where they needed to be updated.)
>
> Specifically, in this case we had a block with frequency = 1. It had
> two outgoing edges each with probability 50%. Because the
> EDGE_FREQUENCY computation uses a rounding divide, the outgoing edge
> frequencies were both computed as 1. Later use of these block and edge
> frequencies to recompute the probability lead to both outgoing edges
> getting 100%.
>
> To address this, in the routine freqs_to_counts_path can simply scale
> up the frequencies when recording them in the count field. I added a
> scale by REG_BR_PROB_BASE. The largest count possible would therefore
> be REG_BR_PROB_BASE * BB_FREQ_MAX which is 10000 * 10000 = 100mil
> which safely fits in gcov_type.
>
> Here is the patch I am testing. Confirmed it fixes the reported issue.
> Currently bootstrapping and testing on x86_64-unknown-linux-gnu. Ok
> for trunk if it passes?
>
> (The whitespace is getting messed up when I copy the patch in here -
> the indentations do line up in the patch.)
>
> Thanks,
> Teresa
>
> 2014-10-01  Teresa Johnson  <tejohnson@google.com>
>
>          * tree-ssa-threadupdate.c (freqs_to_counts_path): Scale frequencies
>          up when synthesizing counts to avoid rounding errors.
OK.
jeff

  parent reply	other threads:[~2014-10-02 18:34 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-03-26 23:57 Teresa Johnson
2014-04-17  5:58 ` Jeff Law
2014-04-17 13:46   ` Teresa Johnson
2014-05-27 14:11     ` Teresa Johnson
2014-07-07 21:22       ` Teresa Johnson
2014-07-07 21:24         ` Jeff Law
2014-07-23 13:47 ` Jeff Law
2014-07-23 21:52   ` Teresa Johnson
2014-08-02  5:10     ` Teresa Johnson
2014-08-02  5:16       ` Andrew Pinski
2014-09-29 14:20       ` Teresa Johnson
2014-09-30  4:33         ` Jeff Law
2014-09-30 18:20           ` Teresa Johnson
2014-10-01  7:03             ` Christophe Lyon
2014-10-01 13:21               ` Teresa Johnson
2014-10-01 14:05                 ` Teresa Johnson
2014-10-01 15:23               ` Sebastian Pop
2014-10-01 15:25                 ` Christophe Lyon
2014-10-01 15:29                   ` Teresa Johnson
2014-10-01 16:20                     ` H.J. Lu
2014-10-01 16:23                       ` Teresa Johnson
2014-10-01 20:05                     ` Teresa Johnson
2014-10-01 22:46                       ` Steve Ellcey
2014-10-02  5:02                         ` Teresa Johnson
2014-10-02 15:44                           ` Teresa Johnson
2014-10-02 15:45                           ` Steve Ellcey
2014-10-02 16:01                             ` Teresa Johnson
2014-10-01 23:09                       ` Jan Hubicka
2014-10-02  5:07                         ` Teresa Johnson
2014-10-02 18:34                       ` Jeff Law [this message]
2014-10-28 16:01                       ` Renlin Li
2014-10-01 15:36                   ` Sebastian Pop

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=542D9ABA.8040203@redhat.com \
    --to=law@redhat.com \
    --cc=christophe.lyon@linaro.org \
    --cc=davidxl@google.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=hubicka@ucw.cz \
    --cc=sebpop@gmail.com \
    --cc=tejohnson@google.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).