From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28581 invoked by alias); 11 Nov 2008 23:53:05 -0000 Received: (qmail 28436 invoked by uid 22791); 11 Nov 2008 23:53:04 -0000 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.31) with ESMTP; Tue, 11 Nov 2008 23:52:28 +0000 Received: by atrey.karlin.mff.cuni.cz (Postfix, from userid 4018) id 88BE6F015B; Wed, 12 Nov 2008 00:52:25 +0100 (CET) Date: Tue, 11 Nov 2008 23:59:00 -0000 From: Jan Hubicka To: Rafael Espindola Cc: Jan Hubicka , Diego Novillo , gcc-patches Subject: Re: [lto][patch] Move the call to execute_all_ipa_transforms to cgraphunit.c Message-ID: <20081111235225.GI27401@atrey.karlin.mff.cuni.cz> References: <38a0d8450811110921t4c619461u2f934ddcdc3df5e@mail.gmail.com> <20081111193733.GD27401@atrey.karlin.mff.cuni.cz> <20081111231240.GH27401@atrey.karlin.mff.cuni.cz> <38a0d8450811111531u6e2731c0y7b7d6d75b758ef79@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <38a0d8450811111531u6e2731c0y7b7d6d75b758ef79@mail.gmail.com> User-Agent: Mutt/1.5.13 (2006-08-11) X-IsSubscribed: yes 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: 2008-11/txt/msg00499.txt.bz2 > > How you reorganize the IPA passes? It seems that in current > > organization of compiler we realy should stay with one block of early > > local passes followed by all the IPA/LTO followed by one block of late > > passes + RTL. In this scheme we should never need more than one > > fixup_cfg on the beggining of last block. > > I am trying to run the inliner in lgen to remove the extern inline > functions before writing IL to disk. This should be realitvely easy to do if you schedule one IPA_INLINE pass followed by local passes queue containing only fixup_cfg (fixup_cfg is cleaning up after inlining too) before you cgraph output. The local passes will make passsmanager to apply inliner's transformations and you should end up with consistent cfgs. In general I am not opposed of doing IPA passes at compilation time to optimize what we get into lto object files. Problem of early inlining is that it does not have idea of the whole program size and thus can't do too informed decisions compared to the IPA inliner. Often when A calls B and B calls C it is not clear whether A->B should be inlined or B->C or both. If B and C lie in different unit then A we could prevent the more useful inliing. We already have early inliner handling the code size reducing (and thus safe) cases. It seems that most correct approach would be to turn extern inline functions into static functions before LTO and have pass that will redirect the calls of noninlined bodies to the non-extern inline body (or external call) after inlining. This way we don't lose optimization/information. Honza > > Cheers, > -- > Rafael Avila de Espindola > > Google | Gordon House | Barrow Street | Dublin 4 | Ireland > Registered in Dublin, Ireland | Registration Number: 368047