From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 129369 invoked by alias); 7 Nov 2018 14:27:38 -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 129272 invoked by uid 89); 7 Nov 2018 14:27:37 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-1.7 required=5.0 tests=AWL,BAYES_00,KAM_LAZY_DOMAIN_SECURITY autolearn=no version=3.3.2 spammy=Hx-languages-length:2859 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; Wed, 07 Nov 2018 14:27:36 +0000 Received: by nikam.ms.mff.cuni.cz (Postfix, from userid 16202) id 0561F2804FC; Wed, 7 Nov 2018 15:27:34 +0100 (CET) Date: Wed, 07 Nov 2018 14:27:00 -0000 From: Jan Hubicka To: Martin =?iso-8859-2?Q?Li=B9ka?= Cc: Qing Zhao , Martin Jambor , live-patching@vger.kernel.org, gcc Patches Subject: Re: GCC options for kernel live-patching (Was: Add a new option to control inlining only on static functions) Message-ID: <20181107142733.pjxl6yx2ajndl7ex@kam.mff.cuni.cz> References: <1a023bdc-28a6-eb41-b449-4d096f12064f@suse.cz> <048D9997-B7AF-444A-BF7E-79944DE8F174@oracle.com> <3E37D3A8-2D19-41C2-BA8A-8F0EFA1B4D5C@oracle.com> <10a54034-279b-a406-8466-55558effbf24@suse.cz> <20181003090457.GJ57692@kam.mff.cuni.cz> <54a75932-201b-671c-0a63-d1a5d8d7b562@suse.cz> <90c91045-cb9d-0bd2-fad3-d16426ceede6@suse.cz> <20181105095135.j3mnzox6rkktkoto@kam.mff.cuni.cz> <629b20d2-7b0b-9342-a64a-d12eb6e6a6b7@suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-2 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <629b20d2-7b0b-9342-a64a-d12eb6e6a6b7@suse.cz> User-Agent: NeoMutt/20170113 (1.7.2) X-SW-Source: 2018-11/txt/msg00447.txt.bz2 > On 11/5/18 10:51 AM, Jan Hubicka wrote: > >> @honza: PING > >> > >> On 10/3/18 12:53 PM, Martin Li¹ka wrote: > >>> On 10/3/18 11:04 AM, Jan Hubicka wrote: > >>>>> > >>>>> That was promised to be done by Honza Hubièka. He's very skilled in IPA optimizations and he's aware > >>>>> of optimizations that cause troubles for live-patching. > >>>> > >>>> :) I am not sure how skilful I am, but here is what I arrived to. > >>> > >>> Heh! Thanks for the analysis. > >>> > >>>> > >>>> We have transformations that are modeled as clonning, which are > >>>> - inlining (can't be disabled completely because of always inline, but -fno-inline > >>>> does most of stuff) > >>>> - cloning (disabled via -fno-ipa-cp) > >>>> - ipa-sra (-fno-ipa-sra) > >>>> - splitting (-fno-partial-inlining) > >>>> These should play well with Martin's tracking code > >>> > >>> I hope so! > >>> > >>>> > >>>> We propagate info about side effects of function: > >>>> - function attribute discovery (pure, const, nothrow, malloc) > >>>> Some of this can be disabled by -fno-ipa-pure-const, but not all > >>>> of it. > >>> > >>> Would it be possible to add option for the remaining ones? > > > > Sure, I can prepare patch unless you beat me :) > > Are you sure there's a call to 'analyze_function' where the analysis is done > when one sets -fno-ipa-pure-const? In set_nothrow_function_flags. Probably would be good to grep for places where node->set_XXXX_flag is used. > 2018-11-07 Martin Liska > > * common.opt: Add -fipa-stack-alignment flag. > * doc/invoke.texi: Document it. > * final.c (rest_of_clean_state): Guard stack > shrinking with flag. > > gcc/testsuite/ChangeLog: > > 2018-11-07 Martin Liska > > * gcc.target/i386/ipa-stack-alignment.c: New test. > From 8691490a142228021ed65313a72d176d06966829 Mon Sep 17 00:00:00 2001 > From: marxin > Date: Wed, 7 Nov 2018 13:31:41 +0100 > Subject: [PATCH 1/2] Come up with -fipa-reference-addressable flag. > > gcc/ChangeLog: > > 2018-11-07 Martin Liska > > * cgraph.h (ipa_discover_readonly_nonaddressable_vars): Rename > to ... > (ipa_discover_nonaddressable_vars): ... this. > * common.opt: Come up with new flag -fipa-reference-addressable. > * doc/invoke.texi: Document it. > * ipa-reference.c (propagate): Call the renamed fn. > * ipa-visibility.c (whole_program_function_and_variable_visibility): > Likewise. > * ipa.c (ipa_discover_readonly_nonaddressable_vars): Renamed to > ... > (ipa_discover_nonaddressable_vars): ... this. Discove > non-addressable variables only with the newly added flag. > * opts.c: Enable the newly added flag with -O1 and higher > optimization level. Hmm, the write-only and readonly flags are not handled in here? Honza