From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by sourceware.org (Postfix) with ESMTPS id CB1513857BA6 for ; Thu, 6 Oct 2022 08:40:26 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org CB1513857BA6 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=suse.cz Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=suse.cz Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id B4BBF219B0; Thu, 6 Oct 2022 08:40:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1665045625; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=V+4R8QbWiMzaacpAWkJw8owXOIOThCLAw4N+BCmVAkg=; b=zz/sWxWDkAp4Vr7qRdCbYvv0FsuQu3PbdHbu+0lB7a0XgQzTybJFuoiJ0fqr/OfM3tChNM xsnymZTs9ioutMTH0sASEl2bfzebfafpaZgzPfWCVf+axFF3OuHsgcnk5FIZC0yrJbcw1N DSSRXivOmJTmdhJHoXegXYNr+oiRuIw= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1665045625; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=V+4R8QbWiMzaacpAWkJw8owXOIOThCLAw4N+BCmVAkg=; b=Evi65MkosYjKp1my0pO8/oG9qjKYQ10DIJ/0zmOSZeynJsy1u9r2SIH5RYTycM9Xr4006u lgWTuLQFPHJ6GvAA== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 92B0F1376E; Thu, 6 Oct 2022 08:40:25 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id L9pLInmUPmNJOwAAMHmgww (envelope-from ); Thu, 06 Oct 2022 08:40:25 +0000 Message-ID: <931252d4-e4d1-312a-a9dc-933f91f0eab9@suse.cz> Date: Thu, 6 Oct 2022 10:40:25 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.3.1 Subject: Re: [PATCH] IPA: support -flto + -flive-patching=inline-clone Content-Language: en-US To: Richard Biener , Qing Zhao Cc: "gcc-patches@gcc.gnu.org" , Jan Hubicka References: <137fde8c-7ade-ecc0-96f2-9ec828b4745e@suse.cz> From: =?UTF-8?Q?Martin_Li=c5=a1ka?= In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-6.7 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,TXREP autolearn=ham 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 10/6/22 10:29, Richard Biener wrote: > On Wed, Oct 5, 2022 at 8:18 PM Qing Zhao via Gcc-patches > wrote: >> >> >> >>> On Oct 5, 2022, at 1:36 PM, Martin Liška wrote: >>> >>> On 10/5/22 16:50, Qing Zhao wrote: >>>> I have two questions on this: >>> >>> Hello. >>> >>>> >>>> 1. What’s the motivation to enable -flive-patching with -flto? Is there any application that will try -flive-patching with -flto now? >>> >>> We're planning supporting GCC LTO Linux kernel support, so that's one motivation. And the second one is a possible >>> use in user-space livepatching. Note majority of modern distros default to -flto (openSUSE, Fedora, Debian, Ubuntu, ...). >> >> Okay, I see. That’s reasonable. >>> >>>> >>>> 2. Why only enable -flive-patching=inline-clone with -flto? >>> >>> Because the inline-only-static level (which you added/requested) would have to properly >>> block inter-procedural inlining that happens in LTO (can_inline_edge_by_limits_p) and >>> I'm not sure it would be properly blocked. So, feel free to extend my patch if you want? >> >> -flive-patching=inline-only-static >> >> Only enable static functions inlining, all the inlining of external visible functions are blocked, So, LTO should be compatible with this naturally without any issue, I think. >> >> i.e, when "-flive-patching=inline-only-static -flto" present together, all the inter-procedural inlining should be automatically blocked by -flive-patching=inline-only-static already. >> >> Do I miss anything here? > > WPA will promote externally visible functions static when all accesses > are from LTO IR, I don't think we preserve > the "original" visibility for IPA inlining heuristics. That said, can we go with my original patch? > > OTOH inline-only-static could disable WPA inlining and do all inlining early ... And this can be extended by Oracle folks if they are interested in -flive-patching=inline-only-static combined with LTO. Martin > > Richard, > >> >> thanks. >> >> Qing >> >>> >>> Martin >>> >>>> >>>> thanks. >>> >>