From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 669 invoked by alias); 2 Nov 2010 00:35:40 -0000 Received: (qmail 32308 invoked by uid 22791); 2 Nov 2010 00:35:36 -0000 X-SWARE-Spam-Status: No, hits=-2.1 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,SPF_HELO_PASS,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from smtp-out.google.com (HELO smtp-out.google.com) (216.239.44.51) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 02 Nov 2010 00:35:31 +0000 Received: from kpbe17.cbf.corp.google.com (kpbe17.cbf.corp.google.com [172.25.105.81]) by smtp-out.google.com with ESMTP id oA20ZTUr021568 for ; Mon, 1 Nov 2010 17:35:29 -0700 Received: from ywa6 (ywa6.prod.google.com [10.192.1.6]) by kpbe17.cbf.corp.google.com with ESMTP id oA20ZRvm017466 for ; Mon, 1 Nov 2010 17:35:28 -0700 Received: by ywa6 with SMTP id 6so5547333ywa.40 for ; Mon, 01 Nov 2010 17:35:27 -0700 (PDT) MIME-Version: 1.0 Received: by 10.229.84.139 with SMTP id j11mr15926436qcl.98.1288658127593; Mon, 01 Nov 2010 17:35:27 -0700 (PDT) Received: by 10.220.186.131 with HTTP; Mon, 1 Nov 2010 17:35:27 -0700 (PDT) In-Reply-To: <4CCF53D9.7070908@purdue.edu> References: <4CCF53D9.7070908@purdue.edu> Date: Tue, 02 Nov 2010 00:35:00 -0000 Message-ID: Subject: Re: ipa on all files together From: Diego Novillo To: Hongtao Cc: gcc@gcc.gnu.org Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-System-Of-Record: true 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: 2010-11/txt/msg00033.txt.bz2 On Mon, Nov 1, 2010 at 19:57, Hongtao wrote: > =C2=A0Hi All, > > While using gcc-4.6 with option -flto, I found that interprocedural > analysis were performed on each source file separately. For example for > the pass pass_ipa_pta, if we compile two files like : > =C2=A0 =C2=A0 =C2=A0 =C2=A0 gcc -O -flto f1.c f2.c > we have the pass run twice, one for each source file. So is there a way > that can perform IPA on all source files together? With -combine you used to be able to do this, but it has been removed in favour of -flto (actually, I'm not quite sure whether it's been removed already, but it's on the chopping block). With -flto, IPA will be performed on all the files together, as well as each file separately. In your example, IPA runs 3 times. Once for each f1.c and f2.c, and a third time with both f1.o and f2.o as a single translation unit. Diego.