From patchwork Mon Mar 4 01:50:30 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: JunMa X-Patchwork-Id: 1050973 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=gcc.gnu.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=gcc-patches-return-497286-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=linux.alibaba.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="K4lyzl4+"; dkim-atps=neutral Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 44CNK906FYz9sBr for ; Mon, 4 Mar 2019 12:50:46 +1100 (AEDT) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:date :from:to:cc:reply-to:message-id:subject:mime-version:references :in-reply-to:content-type:content-transfer-encoding; q=dns; s= default; b=dGlQMhSmvOpyFcHCs5NKQOR4jR5JJYqOwZmGGJiqOEnznsTrgTIkJ Q4K8JB5cP7b4cZf2dWoX8v/sjKcOlg7JK4dbgBkqilPrqEdQPXDUkKaWcH7bTXZw GSrW+7vOFhA4rvNHQlJXNKa59nGEq/4zHcmcidPp+UyBuqqgOMcygA= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:date :from:to:cc:reply-to:message-id:subject:mime-version:references :in-reply-to:content-type:content-transfer-encoding; s=default; bh=SZxj6BYnsZVwBu5rk6J6WLB0ld0=; b=K4lyzl4++dgumXHJkiE0bOLK9Sl/ /P3mR2HMGEDWxnqhd0IcEunlACTYGEn0gpD1f4JNgwobfe5q7CAwBrnq7jJV34fd C18CHIaTCeVMTIgQoE4+bCYWUJVbFiFsZPTXbRVExWGqOla/pbx1AeflQHchdlEB cJ2BmU3VPVXGPlg= Received: (qmail 117936 invoked by alias); 4 Mar 2019 01:50:38 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 117903 invoked by uid 89); 4 Mar 2019 01:50:38 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-22.9 required=5.0 tests=BAYES_00, BODY_8BITS, ENV_AND_HDR_SPF_MATCH, GARBLED_BODY, GARBLED_FROM, GARBLED_SUBJECT, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, MIME_BASE64_BLANKS, RCVD_IN_DNSWL_NONE, SPF_PASS, UNPARSEABLE_RELAY, USER_IN_DEF_SPF_WL autolearn=ham version=3.3.2 spammy=UD:So, Hx-languages-length:2518 X-HELO: out30-45.freemail.mail.aliyun.com Received: from out30-45.freemail.mail.aliyun.com (HELO out30-45.freemail.mail.aliyun.com) (115.124.30.45) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 04 Mar 2019 01:50:35 +0000 X-Alimail-AntiSpam: AC=PASS; BC=-1|-1; BR=01201311R161e4; CH=green; DM=||false|; FP=0|-1|-1|-1|0|-1|-1|-1; HT=e01e01424; MF=junma@linux.alibaba.com; NM=1; PH=DW; RN=2; SR=0; TI=W4_5478978_DEFAULT_0AC264AE_1551664105939_o7001c186h; Received: from WS-web (JunMa@linux.alibaba.com[W4_5478978_DEFAULT_0AC264AE_1551664105939_o7001c186h]) by e01e01353.eu6 at Mon, 04 Mar 2019 09:50:30 +0800 Date: Mon, 04 Mar 2019 09:50:30 +0800 From: "JunMa" To: "segher" Cc: "gcc-patches" Reply-To: "JunMa" Message-ID: <5b088625-bcea-4bf3-8a2e-2dec4743492b.JunMa@linux.alibaba.com> Subject: =?utf-8?b?5Zue5aSN77yaW1BBVENIIEdDQzEwXSBpcGEtaW5saW5lLmM6IFRy?= =?utf-8?q?ivial_fix_on_function_not_declared_inline_check_in_want?= =?utf-8?q?=5Finline=5Fsmall=5Ffunction=5Fp?= MIME-Version: 1.0 References: <02c52b39-8812-4b0c-bc6b-681eb65b0127.JunMa@linux.alibaba.com>, <20190301141753.GC3969@gate.crashing.org> x-aliyun-mail-creator: W4_5478978_DEFAULT_NTMTW96aWxsYS81LjAgKE1hY2ludG9zaDsgSW50ZWwgTWFjIE9TIFggMTBfMTNfNikgQXBwbGVXZWJLaXQvNTM3LjM2IChLSFRNTCwgbGlrZSBHZWNrbykgQ2hyb21lLzcxLjAuMzU3OC45OCBTYWZhcmkvNTM3LjM2XQ In-Reply-To: <20190301141753.GC3969@gate.crashing.org> X-IsSubscribed: yes ------------------------------------------------------------------ 发件人:Segher Boessenkool 发送时间:2019年3月1日(星期五) 22:18 收件人:JunMa 抄 送:gcc-patches 主 题:Re: [PATCH GCC10] ipa-inline.c: Trivial fix on function not declared inline check in want_inline_small_function_p Hi! On Fri, Mar 01, 2019 at 04:39:38PM +0800, JunMa wrote: > Since MAX_INLINE_INSNS_AUTO should be below or equal to > MAX_INLINE_INSNS_SINGLE (see params.def), there is no need > to do second inlining limit check on growth when function not > declared inline, this patch removes it. > Bootstrapped and tested on x86_64-unknown-linux-gnu, is it ok for trunk? Your mail subject says this is for GCC 10, but you are asking for GCC 9 now; which is it? Sorry. Since we are in GCC9 stage4 now, also it's not for regression fix.So, it's for GCC 10. > 2019-03-01 Jun Ma > > *ipa-inline.c(want_inline_small_function_p): Remove > redundant growth check when function not declared > inline Some spaces were lost in the first line. Trailing space. Sentences should end with a full stop (or similar). Don't send patches (or pretty much anything else) as application/octet-stream attachments. Segher Sorry again for this. Here is the full change. JunMa 2019-03-01 Jun Ma * ipa-inline.c(want_inline_small_function_p): Remove redundant growth check when function not declared inline. diff --git a/gcc/ipa-inline.c b/gcc/ipa-inline.c index 360c3de..ff9bc9e 100644 --- a/gcc/ipa-inline.c +++ b/gcc/ipa-inline.c @@ -837,15 +837,11 @@ want_inline_small_function_p (struct cgraph_edge *e, bool report) ? MAX (MAX_INLINE_INSNS_AUTO, MAX_INLINE_INSNS_SINGLE) : MAX_INLINE_INSNS_AUTO) - && !(big_speedup == -1 ? big_speedup_p (e) : big_speedup)) + && !(big_speedup == -1 ? big_speedup_p (e) : big_speedup) + && growth_likely_positive (callee, growth)) { - /* growth_likely_positive is expensive, always test it last. */ - if (growth >= MAX_INLINE_INSNS_SINGLE - || growth_likely_positive (callee, growth)) - { - e->inline_failed = CIF_MAX_INLINE_INSNS_AUTO_LIMIT; - want_inline = false; - } + e->inline_failed = CIF_MAX_INLINE_INSNS_AUTO_LIMIT; + want_inline = false; } /* If call is cold, do not inline when function body would grow. */ else if (!e->maybe_hot_p ()