public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Jason Merrill <jason@redhat.com>
To: Eugene Rozenfeld <Eugene.Rozenfeld@microsoft.com>,
	"gcc-patches@gcc.gnu.org" <gcc-patches@gcc.gnu.org>
Cc: Andi Kleen <ak@linux.intel.com>, Jan Hubicka <hubicka@ucw.cz>
Subject: Re: [PING][PATCH] Add instruction level discriminator support.
Date: Thu, 18 Aug 2022 21:55:11 -0400	[thread overview]
Message-ID: <5d9b2795-8a75-e4ea-07b1-856e448064dc@redhat.com> (raw)
In-Reply-To: <MW2PR2101MB1770D383827C3C1EF831128E919F9@MW2PR2101MB1770.namprd21.prod.outlook.com>

On 8/3/22 17:25, Eugene Rozenfeld wrote:
> One more ping for this patch https://gcc.gnu.org/pipermail/gcc-patches/2022-June/596065.html
> 
> CC Jason since this changes discriminators emitted in dwarf.
> 
> Thanks,
> 
> Eugene
> 
> -----Original Message-----
> From: Eugene Rozenfeld
> Sent: Monday, June 27, 2022 12:45 PM
> To: gcc-patches@gcc.gnu.org; Andi Kleen <ak@linux.intel.com>; Jan Hubicka <hubicka@ucw.cz>
> Subject: RE: [PING][PATCH] Add instruction level discriminator support.
> 
> Another ping for https://gcc.gnu.org/pipermail/gcc-patches/2022-June/596065.html .
> 
> I got a review from Andi (https://gcc.gnu.org/pipermail/gcc-patches/2022-June/596549.html) but I also need a review from someone who can approve the changes.
> 
> Thanks,
> 
> Eugene
> 
> -----Original Message-----
> From: Eugene Rozenfeld
> Sent: Friday, June 10, 2022 12:03 PM
> To: gcc-patches@gcc.gnu.org; Andi Kleen <ak@linux.intel.com>; Jan Hubicka <hubicka@ucw.cz>
> Subject: [PING][PATCH] Add instruction level discriminator support.
> 
> Hello,
> 
> I'd like to ping this patch: https://gcc.gnu.org/pipermail/gcc-patches/2022-June/596065.html
> 
> Thanks,
> 
> Eugene
> 
> -----Original Message-----
> From: Gcc-patches <gcc-patches-bounces+erozen=microsoft.com@gcc.gnu.org> On Behalf Of Eugene Rozenfeld via Gcc-patches
> Sent: Thursday, June 02, 2022 12:22 AM
> To: gcc-patches@gcc.gnu.org; Andi Kleen <ak@linux.intel.com>; Jan Hubicka <hubicka@ucw.cz>
> Subject: [EXTERNAL] [PATCH] Add instruction level discriminator support.
> 
> This is the first in a series of patches to enable discriminator support in AutoFDO.
> 
> This patch switches to tracking discriminators per statement/instruction instead of per basic block. Tracking per basic block was problematic since not all statements in a basic block needed a discriminator and, also, later optimizations could move statements between basic blocks making correlation during AutoFDO compilation unreliable. Tracking per statement also allows us to assign different discriminators to multiple function calls in the same basic block. A subsequent patch will add that support.
> 
> The idea of this patch is based on commit 4c311d95cf6d9519c3c20f641cc77af7df491fdf
> by Dehao Chen in vendors/google/heads/gcc-4_8 but uses a slightly different approach. In Dehao's work special (normally unused) location ids and side tables were used to keep track of locations with discriminators. Things have changed since then and I don't think we have unused location ids anymore. Instead, I made discriminators a part of ad-hoc locations.
> 
> The difference from Dehao's work also includes support for discriminator reading/writing in lto streaming and in modules.
> 
> Tested on x86_64-pc-linux-gnu.

> @@ -1190,12 +1217,12 @@ assign_discriminators (void)
>  	      || (last && same_line_p (locus, &locus_e,
>  				       gimple_location (last))))
>  	    {
> -	      if (e->dest->discriminator != 0 && bb->discriminator == 0)
> -		bb->discriminator
> -		  = next_discriminator_for_locus (locus_e.line);
> +	      if (((first && has_discriminator (gimple_location (first)))
> +		   || (last && has_discriminator (gimple_location (last))))

I think you want to check has_discriminator only for the one of first or 
last that we find to have the same line as locus above?

Incidentally, I wonder why we ignore column number here, but that's not 
an issue for this patch.

Jason


  reply	other threads:[~2022-08-19  1:55 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-10 19:03 Eugene Rozenfeld
2022-06-27 19:45 ` Eugene Rozenfeld
2022-08-04  0:25   ` Eugene Rozenfeld
2022-08-19  1:55     ` Jason Merrill [this message]
2022-09-01 20:48       ` [EXTERNAL] " Eugene Rozenfeld
2022-09-01 22:22         ` Eugene Rozenfeld
2022-09-08 17:25           ` Jason Merrill
2022-09-09  0:45             ` Eugene Rozenfeld
2022-09-19 22:13               ` Eugene Rozenfeld
2022-09-26 21:22               ` Jason Merrill

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=5d9b2795-8a75-e4ea-07b1-856e448064dc@redhat.com \
    --to=jason@redhat.com \
    --cc=Eugene.Rozenfeld@microsoft.com \
    --cc=ak@linux.intel.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=hubicka@ucw.cz \
    /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).