From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by sourceware.org (Postfix) with ESMTPS id A216C3858D28 for ; Fri, 19 Aug 2022 01:55:15 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org A216C3858D28 Received: from mail-qk1-f200.google.com (mail-qk1-f200.google.com [209.85.222.200]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-97-q0BODEFKOhCSjoUT48Sgqw-1; Thu, 18 Aug 2022 21:55:14 -0400 X-MC-Unique: q0BODEFKOhCSjoUT48Sgqw-1 Received: by mail-qk1-f200.google.com with SMTP id bi22-20020a05620a319600b006b92f4b2ebbso2892720qkb.22 for ; Thu, 18 Aug 2022 18:55:14 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc; bh=PWWfdcxiYOvefNU1uJJsQ4jW3kbBvlDJvk4bhcQ/ZvE=; b=mJLti0QOWw3Y5hx9rCFKieDD2Wm0XDIQbZk1CnjUBxj38RiR3hJELcPhOrFL6oSQon POUdyL3F6ajyQRVgChfxKS7KT80krJrBGieS8pDkWHAnTlKQUCZxZ1VmKPZVg7BeAfdk gOvBoUuJmFB2UuyeWClflv7aKJurvPYRJSPgareyY6ET/mGMDM10/hfNRQTQZuXIMA65 DcOqK19ZtGfQELs+YB0VrW2yjUxcfqe1hj4VuuLjrA4YL90awmBnK54uP8wfeZstqFGm 74kYj1AQN3sGrg/b6tL9kskYqGfVgEYEmg15IKz2FKZPGYJURHIf0R1HrmHksxPVhDyJ 8CdQ== X-Gm-Message-State: ACgBeo1l5fIUAFzjlXtDuqF3azmK1vEpPT4Z2kXLzrhE0IUpYdYwTynY UmMHiiJ772j1vfEHry4e1hXBt8OP48mhttdJkEh0JF/oC9mLnC+MGR2s/N1IgF9ocykimFgkPR3 v0uFrkHmShRbBf7Bu1g== X-Received: by 2002:a05:6214:76a:b0:496:c298:d165 with SMTP id f10-20020a056214076a00b00496c298d165mr2321994qvz.100.1660874113633; Thu, 18 Aug 2022 18:55:13 -0700 (PDT) X-Google-Smtp-Source: AA6agR6joqh3j2mzFZRo3Ysn12G6XHbfUDg0YUoDuRawLQ77PcMJEmLUI5TjRerkv620UETCA7/Bwg== X-Received: by 2002:a05:6214:76a:b0:496:c298:d165 with SMTP id f10-20020a056214076a00b00496c298d165mr2321985qvz.100.1660874113399; Thu, 18 Aug 2022 18:55:13 -0700 (PDT) Received: from [192.168.1.101] (130-44-159-43.s15913.c3-0.arl-cbr1.sbo-arl.ma.cable.rcncustomer.com. [130.44.159.43]) by smtp.gmail.com with ESMTPSA id q8-20020a05620a2a4800b006bb756ce754sm2967911qkp.55.2022.08.18.18.55.11 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 18 Aug 2022 18:55:12 -0700 (PDT) Message-ID: <5d9b2795-8a75-e4ea-07b1-856e448064dc@redhat.com> Date: Thu, 18 Aug 2022 21:55:11 -0400 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.12.0 Subject: Re: [PING][PATCH] Add instruction level discriminator support. To: Eugene Rozenfeld , "gcc-patches@gcc.gnu.org" Cc: Andi Kleen , Jan Hubicka References: From: Jason Merrill In-Reply-To: X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Language: en-US Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-7.0 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, KAM_SHORT, NICE_REPLY_A, RCVD_IN_DNSWL_LOW, SPF_HELO_NONE, SPF_NONE, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Aug 2022 01:55:17 -0000 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 ; Jan Hubicka > 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 ; Jan Hubicka > 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 On Behalf Of Eugene Rozenfeld via Gcc-patches > Sent: Thursday, June 02, 2022 12:22 AM > To: gcc-patches@gcc.gnu.org; Andi Kleen ; Jan Hubicka > 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