From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from nikam.ms.mff.cuni.cz (nikam.ms.mff.cuni.cz [195.113.20.16]) by sourceware.org (Postfix) with ESMTPS id 642293858C2B for ; Mon, 5 Jun 2023 03:04:08 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 642293858C2B Authentication-Results: sourceware.org; dmarc=fail (p=none dis=none) header.from=ucw.cz Authentication-Results: sourceware.org; spf=none smtp.mailfrom=kam.mff.cuni.cz Received: by nikam.ms.mff.cuni.cz (Postfix, from userid 16202) id D9EE528AEA1; Mon, 5 Jun 2023 05:04:06 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ucw.cz; s=gen1; t=1685934246; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=j2ISXCWErwv7xbLgunJh3tKu7btYS/8J+c7VpNyLXDU=; b=X/EGTELC4H4yzQ8RFGOSyg7Q9aV4gYNeKkP6aa5yI1ZlC3Q6A0W6qZpeQGFpq/Zq4FQjB8 CJFRZQMYNkLgyNyPSrXCAqdj7Dra6q33r5ZmNwx5aC4gC3nogjWIFeIa9ItmOfdFBzk+gb vhHQS7vT9OUhImQ7WM6SeBvbVxyxVL4= Date: Mon, 5 Jun 2023 05:04:06 +0200 From: Jan Hubicka To: Richard Biener Cc: "Andre Vieira (lists)" , "gcc-patches@gcc.gnu.org" , Richard Sandiford , "jakub@redhat.com" Subject: Re: [PATCH] inline: improve internal function costs Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-5.1 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE,TXREP,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: > On Thu, 1 Jun 2023, Andre Vieira (lists) wrote: > > > Hi, > > > > This is a follow-up of the internal function patch to add widening and > > narrowing patterns. This patch improves the inliner cost estimation for > > internal functions. > > I have no idea why calls are special in IPA analyze_function_body > and so I cannot say whether treating all internal fn calls as > non-calls is correct there. Honza? The reason is that normal statements are acconted as part of the function body, while calls have their costs attached to call edges (so it can be adjusted when call is inlined to otherwise optimized). However since internal functions have no cgraph edges, this looks like a bug that we do not test it. (the code was written before internal calls was introduced). I wonder if we don't want to have is_noninternal_gimple_call that could be used by IPA code to test whether cgraph edge should exist for the statement. > > The tree-inline.cc change is OK though (you can push that separately). The rest is OK too. Honza > > Thanks, > Richard. > > > Bootstrapped and regression tested on aarch64-unknown-linux-gnu. > > > > gcc/ChangeLog: > > > > * ipa-fnsummary.cc (analyze_function_body): Correctly handle > > non-zero costed internal functions. > > * tree-inline.cc (estimate_num_insns): Improve costing for internal > > functions. > > > > -- > Richard Biener > SUSE Software Solutions Germany GmbH, Frankenstrasse 146, 90461 Nuernberg, > Germany; GF: Ivo Totev, Andrew Myers, Andrew McDonald, Boudien Moerman; > HRB 36809 (AG Nuernberg)