From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) by sourceware.org (Postfix) with ESMTPS id BB01A3857C43 for ; Thu, 24 Sep 2020 07:20:56 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org BB01A3857C43 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=suse.cz Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=mliska@suse.cz X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id 7888CAE4B; Thu, 24 Sep 2020 07:21:33 +0000 (UTC) Subject: Re: [PATCH] Fix UBSAN errors in ipa-cp. To: Martin Jambor , Jan Hubicka Cc: gcc-patches@gcc.gnu.org References: <7115ce43-bf35-c6e4-46b6-56b386e5cb34@suse.cz> <20200923123201.GB41023@kam.mff.cuni.cz> <00825d9b-10a0-b393-d044-ccbc9835c6c8@suse.cz> <752e1531-c918-89ee-5807-6c3ccce7bdf5@suse.cz> From: =?UTF-8?Q?Martin_Li=c5=a1ka?= Message-ID: Date: Thu, 24 Sep 2020 09:20:55 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.2.2 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-9.8 required=5.0 tests=BAYES_00, GIT_PATCH_0, KAM_DMARC_STATUS, NICE_REPLY_A, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) 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: Thu, 24 Sep 2020 07:20:58 -0000 On 9/23/20 5:02 PM, Martin Jambor wrote: > Hi, > > On Wed, Sep 23 2020, Martin Liška wrote: >> There's patch that does that. >> >> Patch can bootstrap on x86_64-linux-gnu and survives regression tests. >> >> Ready to be installed? >> Thanks, >> Martin >> From ff5f78110684ed9aedde15d19e856b3acf649971 Mon Sep 17 00:00:00 2001 >> From: Martin Liska >> Date: Wed, 23 Sep 2020 15:10:43 +0200 >> Subject: [PATCH] Port IPA CP time and size to sreal >> >> gcc/ChangeLog: >> >> * ipa-cp.c (ipcp_lattice::print): Print sreal values >> with to_double. >> (incorporate_penalties): Change type to sreal. >> (good_cloning_opportunity_p): Change args to sreal. >> (get_max_overall_size): Work in sreal type. >> (estimate_local_effects): Likewise. >> (safe_add): Remove. >> (value_topo_info::propagate_effects): Work in sreal type. >> (ipcp_propagate_stage): Print sreal numbers. >> (decide_about_value): Work in sreal type. >> --- >> gcc/ipa-cp.c | 128 ++++++++++++++++++++++++--------------------------- >> 1 file changed, 59 insertions(+), 69 deletions(-) >> >> diff --git a/gcc/ipa-cp.c b/gcc/ipa-cp.c >> index b3e7d41ea10..9a79b5862f8 100644 >> @@ -3224,8 +3226,9 @@ incorporate_penalties (cgraph_node *node, ipa_node_params *info, >> potential new clone in FREQUENCIES. */ >> >> static bool >> -good_cloning_opportunity_p (struct cgraph_node *node, int time_benefit, >> - int freq_sum, profile_count count_sum, int size_cost) >> +good_cloning_opportunity_p (struct cgraph_node *node, sreal time_benefit, >> + sreal freq_sum, profile_count count_sum, > > Is the change of type of freq_sum intentional? Even with this patch, > all the callers will keep passing their frequency sums as ints and so > the implicit conversion seems a bit misleading. > > I guess complete transition to sreals would include also switch from > using cgraph_edge::frequency to sreal_frequency in > get_info_about_necessary_edges and users of struct caller_statistics. Hello. All right, I'm leaving that to you Martin ;) You are much more familiar with the code base. Martin > > I planned to work on conversions to sreals right after resolving various > exchange2 issues and I can still do this bit afterwards, but the change > in the parameter type looks like you wanted to but eventually did not? > > Thanks, > > Martin > >