From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) by sourceware.org (Postfix) with ESMTPS id 84E813857C71 for ; Mon, 22 Feb 2021 10:53:42 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 84E813857C71 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=suse.cz Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=mliska@suse.cz X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id 65BB7AFE1; Mon, 22 Feb 2021 10:53:41 +0000 (UTC) Subject: Re: A working GIMPLE simple IPA case to run? To: Shuai Wang Cc: GCC Development References: <2a0ce3cc-cc50-3418-1c37-f90b941259a7@suse.cz> From: =?UTF-8?Q?Martin_Li=c5=a1ka?= Message-ID: <859dbc1b-5bba-3eb3-033f-7fc6e57c5122@suse.cz> Date: Mon, 22 Feb 2021 11:53:40 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.7.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-5.3 required=5.0 tests=BAYES_00, KAM_DMARC_STATUS, KAM_SHORT, NICE_REPLY_A, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: gcc@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Feb 2021 10:53:43 -0000 On 2/20/21 9:15 AM, Shuai Wang wrote: > Thank you very much! Just a follow-up question regarding IPA. > > Currently I can follow the tree-profile.c sample to perform IPA. However, my analysis is limited to all functions within one .c file. Is it possible for me to do cross- .c file analysis? That is, suppose there is a function foo in source1.c called function bar in source2.c. How can I cross analyze foo then bar? Hello. Then you will need a write a proper IPA pass: https://gcc.gnu.org/onlinedocs/gccint/IPA.html#IPA or for testing purpose you can use -flto -flto-partition=one Martin > > Thank you! > > Best, > Shuai > > > > On Wed, Feb 17, 2021 at 4:04 PM Martin Liška > wrote: > > On 2/17/21 5:21 AM, Shuai Wang via Gcc wrote: > > Could anyone shed some light on this? Thank you very much! > > Hello. > > I would recommend looking at any of the existing passes: > $ git grep SIMPLE_IPA_PASS > ... > > One reasonable example can be gcc/tree-profile.c. > > Cheers, > Martin >