From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6228 invoked by alias); 10 Oct 2009 12:31:32 -0000 Received: (qmail 6218 invoked by uid 22791); 10 Oct 2009 12:31:31 -0000 X-SWARE-Spam-Status: No, hits=-2.4 required=5.0 tests=AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from atrey.karlin.mff.cuni.cz (HELO atrey.karlin.mff.cuni.cz) (195.113.26.193) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sat, 10 Oct 2009 12:31:28 +0000 Received: by atrey.karlin.mff.cuni.cz (Postfix, from userid 4018) id 92B81F04AC; Sat, 10 Oct 2009 14:31:25 +0200 (CEST) Date: Sat, 10 Oct 2009 13:40:00 -0000 From: Jan Hubicka To: Richard Guenther Cc: Toon Moene , Jan Hubicka , gcc mailing list Subject: Re: LTO and the inlining of functions only called once. Message-ID: <20091010123125.GO9046@atrey.karlin.mff.cuni.cz> References: <4AD0681E.5040200@moene.org> <84fc9c000910100400v5f1f4f35n5cd5c37c38c1420d@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-2 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <84fc9c000910100400v5f1f4f35n5cd5c37c38c1420d@mail.gmail.com> User-Agent: Mutt/1.5.13 (2006-08-11) X-IsSubscribed: yes Mailing-List: contact gcc-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-owner@gcc.gnu.org X-SW-Source: 2009-10/txt/msg00206.txt.bz2 > On Sat, Oct 10, 2009 at 12:55 PM, Toon Moene wrote: > > Gcc's man page says: > > > >       -finline-functions-called-once > >           Consider all "static" functions called once for inlining into > >           their caller even if they are not marked "inline".  If a call > >           to a given function is integrated, then the function is not > >           output as assembler code in its own right. > > > >           Enabled at levels -O1, -O2, -O3 and -Os. > > > > Now, when using -flto -fwhole-program, *all* functions (that the user > > provided) will be "static inline", no ? - so *all* functions only called > > once in that program will be inlined ? > > Well, I think that we should try to not do this across the whole program. > Simply for the reason that a gigantic main function will hit several > non-linear complexity algorithms in GCC. We do inline functions called once until we hit large-function-growth parameter. The parameter is here to avoid hitting nonlinearity of compiler and the fact that some passes simply give up on large functions. I did not experimented much with tunning these limits, it might be interesting if they do make some difference in your testcase. > > -Winline doesn't help here. Scanning the assember output does (obviously!). My solution would be probably to pass -fdump-ipa-inline parameter to lto compilation and read the log. It lists the inlining decisions and if something is not inlined, you get dump of reason why. The dump from lto compilation appears in /tmp for some reason. Honza > > Note that I wouldn't expect such aggressive inlining to have any positive > performance impact - were it not for the fact that we still lack a properly > operating IPA points-to analysis pass (yes, it's on my todo list - but > not for 4.5). > > Richard.