From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail.ispras.ru (mail.ispras.ru [83.149.199.84]) by sourceware.org (Postfix) with ESMTPS id C416B384E78C for ; Fri, 23 Dec 2022 15:03:24 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org C416B384E78C Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=ispras.ru Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=ispras.ru Received: from [10.10.3.121] (unknown [10.10.3.121]) by mail.ispras.ru (Postfix) with ESMTPS id BE99740737B8; Fri, 23 Dec 2022 15:03:20 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 mail.ispras.ru BE99740737B8 Date: Fri, 23 Dec 2022 18:03:20 +0300 (MSK) From: Alexander Monakov To: Qing Zhao cc: Jose Marchesi , "gcc-patches@gcc.gnu.org" Subject: Re: [PATCH V2] Disable sched1 in functions that call setjmp In-Reply-To: Message-ID: References: <20221222173208.13317-1-jose.marchesi@oracle.com> <53b93d7e-a157-9116-d07a-4d51cd43d205@ispras.ru> <35CA4F79-CA10-4560-8920-CDA65810E308@oracle.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="8323328-1805924819-1671807800=:1848" X-Spam-Status: No, score=-3.1 required=5.0 tests=BAYES_00,KAM_DMARC_STATUS,SPF_HELO_NONE,SPF_PASS,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. --8323328-1805924819-1671807800=:1848 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8BIT On Fri, 23 Dec 2022, Qing Zhao wrote: > >> I am a little confused, you mean pre-RA scheduler does not look at the data flow > >> information at all when scheduling insns across calls currently? > > > > I think it does not inspect liveness info, and may extend lifetime of a pseudo > > across a call, transforming > > > > call foo > > reg = 1 > > ... > > use reg > > > > to > > > > reg = 1 > > call foo > > ... > > use reg > > > > but this is undesirable, because now register allocation cannot select a > > call-clobbered register for 'reg’. > Okay, thanks for the explanation. > > Then, why not just check the liveness info instead of inhibiting all scheduling across calls? Because there's almost nothing to gain from pre-RA scheduling across calls in the first place. Remember that the call transfers control flow elsewhere and therefore the scheduler has no idea about the pipeline state after the call and after the return, so modeling-wise it's a gamble. For instructions that lie on a critical path such scheduling can be useful when it substantially reduces the difference between the priority of the call and nearby instructions of the critical path. But we don't track which instructions are on critical path(s) and which are not. (scheduling across calls in sched2 is somewhat dubious as well, but it doesn't risk register pressure issues, and on VLIW CPUs it at least can result in better VLIW packing) Alexander --8323328-1805924819-1671807800=:1848--