public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Cary Coutant <ccoutant@google.com>
To: Diego Novillo <dnovillo@google.com>
Cc: reply@codereview.appspotmail.com, gcc-patches@gcc.gnu.org
Subject: Re: [google][patch] Track discriminators by instruction instead of by basic block (issue4441075)
Date: Thu, 28 Apr 2011 18:53:00 -0000	[thread overview]
Message-ID: <BANLkTimhAVN_x_+RHub5XeBG=vqq629Nfw@mail.gmail.com> (raw)
In-Reply-To: <BANLkTin48c75BUWTg4XfvLiqm+FOT73g_Q@mail.gmail.com>

>>    Rework discriminator assignment so that it attaches the discriminator
>>    to the source location of each instruction instead of to the basic
>>    block itself.
>
> Any idea on how this affects memory consumption?

Richard had the same question when I first proposed this patch. This
was my answer then:

"Not a lot. We assign discriminators for only a small fraction of the
total number of locations in the program, so the number of unique
location_t values doesn't increase significantly. I didn't add
anything to the line_map structure, nor did I do anything at all in
libcpp, so it's not bloating the source_location/location_t data
structures at all. The extra space needed is linear with the number of
discriminators assigned, which is roughly one per for loop or switch
statement, plus an occasional discriminator for conditional
expressions or macro expansions with control flow. (In the old code
that I'm replacing, the extra space was one int per basic block.)"

>>    It's not ready for trunk yet because it does not yet preserve
>>    the discriminators across LTO, so I'd like to put it in
>>    google/main until I have a chance to get that part working.
>
> But, IIRC this does not introduce LTO regressions, right?

Right. Even though discriminators don't survive the
streaming-out/streaming-in process, the samples obtained from an
initial non-LTO compilation will include discriminator information,
and that information survives long enough into a profile-use
compilation with LTO for the frequency information to get recorded
correctly.

-cary

  reply	other threads:[~2011-04-28 18:25 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-04-28 18:34 Cary Coutant
2011-04-28 18:36 ` Diego Novillo
2011-04-28 18:53   ` Cary Coutant [this message]
2011-04-30  2:10   ` Cary Coutant

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='BANLkTimhAVN_x_+RHub5XeBG=vqq629Nfw@mail.gmail.com' \
    --to=ccoutant@google.com \
    --cc=dnovillo@google.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=reply@codereview.appspotmail.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).