From: Cary Coutant <ccoutant@google.com>
To: Wei Mi <wmi@google.com>
Cc: GCC Patches <gcc-patches@gcc.gnu.org>,
David Li <davidxl@google.com>, Dehao Chen <dehao@google.com>
Subject: Re: [GOOGLE, AUTOFDO] Assign different discriminators to calls with the same lineno
Date: Fri, 29 Aug 2014 17:11:00 -0000 [thread overview]
Message-ID: <CAHACq4q-iSnDaiqViYGSrfiokxTRHNoSGsfm06bLquh44G=Tpw@mail.gmail.com> (raw)
In-Reply-To: <CA+4CFy5qHHuXhWhFjTzQUmvDs50QiQCitjsbhTCO5V-cha6Qnw@mail.gmail.com>
> To avoid the unused new discriminator value, I added a map
> "found_call_this_line" to track whether a call is the first call in a
> source line seen when assigning discriminators. For the first call in
> a source line, its discriminator is 0. For the following calls in the
> same source line, a new discriminator will be used everytime. The new
> patch is attached. Internal perf test and regression test are ok. Is
> it ok for google-4_9?
This seems overly complex to me. I'd think all you need to do is add a
bit to locus_discrim_map (stealing a bit from discriminator ought to
be fine) that indicates whether the next call should increment the
discriminator or not. Something like this:
increase_discriminator_for_locus (location_t locus, bool return_next)
{
...
if (return_next || (*slot)->needs_increment)
{
(*slot)->discriminator++;
(*slot)->needs_increment = false;
}
else
(*slot)->needs_increment = true;
return (*slot)->discriminator;
}
-cary
next prev parent reply other threads:[~2014-08-29 17:11 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <CA+4CFy6AUJ6UL_RjYBhjWjQA+GBxoac4yh44=UkKBvJAtAekFA@mail.gmail.com>
2014-08-06 17:23 ` Fwd: " Wei Mi
2014-08-07 19:11 ` Xinliang David Li
2014-08-07 21:20 ` Wei Mi
2014-08-07 21:40 ` Xinliang David Li
2014-08-07 21:49 ` Wei Mi
2014-08-07 19:17 ` Cary Coutant
2014-08-07 21:10 ` Wei Mi
2014-08-25 3:53 ` Wei Mi
2014-08-29 0:11 ` Wei Mi
2014-08-29 17:11 ` Cary Coutant [this message]
2014-08-29 17:36 ` Wei Mi
2014-08-29 20:59 ` Wei Mi
2014-08-29 22:02 ` 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='CAHACq4q-iSnDaiqViYGSrfiokxTRHNoSGsfm06bLquh44G=Tpw@mail.gmail.com' \
--to=ccoutant@google.com \
--cc=davidxl@google.com \
--cc=dehao@google.com \
--cc=gcc-patches@gcc.gnu.org \
--cc=wmi@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).