From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18249 invoked by alias); 7 Dec 2018 16:57:12 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 16977 invoked by uid 89); 7 Dec 2018 16:57:11 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-25.9 required=5.0 tests=BAYES_00,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,KAM_LAZY_DOMAIN_SECURITY autolearn=ham version=3.3.2 spammy=H*F:U*hubicka, binchenglinuxalibabacom, HX-Envelope-From:sk:hubicka, bin.cheng@linux.alibaba.com X-HELO: nikam.ms.mff.cuni.cz Received: from nikam.ms.mff.cuni.cz (HELO nikam.ms.mff.cuni.cz) (195.113.20.16) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 07 Dec 2018 16:57:09 +0000 Received: by nikam.ms.mff.cuni.cz (Postfix, from userid 16202) id CA18D281E57; Fri, 7 Dec 2018 17:57:06 +0100 (CET) Date: Fri, 07 Dec 2018 16:57:00 -0000 From: Jan Hubicka To: "Bin.Cheng" Cc: bin.cheng@linux.alibaba.com, Richard Guenther , gcc-patches List Subject: Re: [PATCH AutoFDO/2]Treat ZERO as common profile probability/count Message-ID: <20181207165706.sfgkycytc4l7rzoh@kam.mff.cuni.cz> References: <7f153787-f390-4661-92aa-06d47cefbbf5.bin.cheng@linux.alibaba.com> <20181105141206.4ncu3s2v2jxv6o54@kam.mff.cuni.cz> <20181128162042.4vlsfxv643alnq57@kam.mff.cuni.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: NeoMutt/20170113 (1.7.2) X-SW-Source: 2018-12/txt/msg00489.txt.bz2 > Hi Honza, > I have committed the typo fix as revision 266885. > Also I followed your suggestion (IIUC) by calling > profile_count::adjust_for_ipa_scaling for zero den in function > update_profiling_info. It works and does make more sense than > changing the global zero check logic. > Patch tested as before, is it ok? Thanks, patch is OK. What is situation with AutoFDO now? It would be very nice to get it fixed for the release :) Honza > > Thanks, > bin > > diff --git a/gcc/ipa-cp.c b/gcc/ipa-cp.c > index 4471bae11c7..5074ef63da1 100644 > --- a/gcc/ipa-cp.c > +++ b/gcc/ipa-cp.c > @@ -3715,9 +3715,11 @@ update_profiling_info (struct cgraph_node *orig_node, > new_sum = orig_node_count.combine_with_ipa_count (new_sum); > orig_node->count = remainder; > > + profile_count::adjust_for_ipa_scaling (&new_sum, &orig_node_count); > for (cs = new_node->callees; cs; cs = cs->next_callee) > cs->count = cs->count.apply_scale (new_sum, orig_node_count); > > + profile_count::adjust_for_ipa_scaling (&remainder, &orig_node_count); > for (cs = orig_node->callees; cs; cs = cs->next_callee) > cs->count = cs->count.apply_scale (remainder, orig_node_count); > > 2018-12-07 Bin Cheng > > * ipa-cp.c (update_profiling_info): Call adjust_for_ipa_scaling for > zero profile count.