From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 32409 invoked by alias); 8 Jan 2013 15:08:16 -0000 Received: (qmail 32386 invoked by uid 22791); 8 Jan 2013 15:08:14 -0000 X-SWARE-Spam-Status: No, hits=-1.8 required=5.0 tests=AWL,BAYES_00,KHOP_RCVD_UNTRUST,RCVD_IN_DNSWL_LOW,RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from nikam.ms.mff.cuni.cz (HELO nikam.ms.mff.cuni.cz) (195.113.20.16) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 08 Jan 2013 15:08:09 +0000 Received: by nikam.ms.mff.cuni.cz (Postfix, from userid 16202) id CE4045428A6; Tue, 8 Jan 2013 16:08:07 +0100 (CET) Date: Tue, 08 Jan 2013 15:08:00 -0000 From: Jan Hubicka To: Richard Biener Cc: Jan Hubicka , gcc-patches@gcc.gnu.org Subject: Re: Relax limits of early inliner for the forwarder functions Message-ID: <20130108150807.GA30388@kam.mff.cuni.cz> References: <20121105112336.GC11052@kam.mff.cuni.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.20 (2009-06-14) 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 X-SW-Source: 2013-01/txt/msg00421.txt.bz2 > > So this counts all calls in the function we want to inline (!?). > That's completely > backward to me. In fact for forwarder functions you still only allow half > of the early-inlining-insns growth. Previously for non-leafs we didn't allow > any growth (hm, why?). Well, the idea is that inlining leaf functions is almost always good idea (i.e. you can assume that the function's body will optimize well with surrounding code and eliminating a call is good thing) Inlining functions that have call in it is less cool. I introduced the non-leaf/leaf logic in about 4.6 time after late inlining became more informed about anticipated optimizations, but it really caused quite some trouble on C++ abstraction, so relaxing this logic somewhat seemed like resonable idea. > > Now with relaxing that and allowing functions with calls to be inlined more > frequently we run into PR55797 which shows that we cannot limit recursive > inlining anymore if it is indirect one level. By means of early > inlining iteration > we blow up completely (8 iterations at most?!). Also because we do not > compute overall function growth (because we rely on early inlining only > shrinking code size ...). Well, we compute function growth, but for each iteratio nseparately. > > I believe we at least need to track recursive inlining during early inliner > iteration by means of some ->aux marking or so. Hmm, I guess we want to disable recursive inlining in the early inliner completely. I will take a look. Honza > > Honza - please have a look at the ICE in PR55797 and the issues with > this patch enabling more inlining. > > Thanks, > Richard. > > > { > > if (dump_file) > > fprintf (dump_file, " will not early inline: %s/%i->%s/%i, " > > - "growth %i exceeds --param early-inlining-insns\n", > > + "growth %i exceeds --param early-inlining-insns " > > + "divided by number of calls\n", > > xstrdup (cgraph_node_name (e->caller)), e->caller->uid, > > xstrdup (cgraph_node_name (callee)), callee->uid, > > growth);