From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 112420 invoked by alias); 6 Dec 2019 23:47:45 -0000 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 Received: (qmail 112407 invoked by uid 89); 6 Dec 2019 23:47:45 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-1.3 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,RCVD_IN_JMF_BL autolearn=no version=3.3.1 spammy=H*M:online, altogether, moot X-HELO: mailout06.t-online.de Received: from mailout06.t-online.de (HELO mailout06.t-online.de) (194.25.134.19) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 06 Dec 2019 23:47:44 +0000 Received: from fwd15.aul.t-online.de (fwd15.aul.t-online.de [172.20.27.63]) by mailout06.t-online.de (Postfix) with SMTP id 7D70F4197C58; Sat, 7 Dec 2019 00:47:41 +0100 (CET) Received: from yam-desktop (SmTSdwZbZh2DTw5ESFYQRVGQwYbNBVUUROLhM6gCxt2PgUnMtdl4DTP0Gc7wuzegd2@[163.58.18.46]) by fwd15.t-online.de with (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384 encrypted) esmtp id 1idNK0-1HuMAC0; Sat, 7 Dec 2019 00:47:40 +0100 Message-ID: Subject: Re: Add a new combine pass From: Oleg Endo To: Segher Boessenkool Cc: gcc-patches@gcc.gnu.org, Nicholas Krause , richard.sandiford@arm.com Date: Fri, 06 Dec 2019 23:47:00 -0000 In-Reply-To: <20191206225130.GS3152@gate.crashing.org> References: <20191123223449.GP9491@gate.crashing.org> <20191125224713.GX9491@gate.crashing.org> <20191203180512.GS24609@gate.crashing.org> <20191206225130.GS3152@gate.crashing.org> Content-Type: text/plain; charset="UTF-8" Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-IsSubscribed: yes X-SW-Source: 2019-12/txt/msg00475.txt.bz2 On Fri, 2019-12-06 at 16:51 -0600, Segher Boessenkool wrote: > On Wed, Dec 04, 2019 at 07:43:30PM +0900, Oleg Endo wrote: > > On Tue, 2019-12-03 at 12:05 -0600, Segher Boessenkool wrote: > > > > Hmm ... the R0 problem ... SH doesn't override class_likely_spilled > > > > explicitly, but it's got a R0_REGS class with only one said reg in it. > > > > So the default impl of class_likely_spilled should do its thing. > > > > > > Yes, good point. So what happened here? > > > > "Something, somewhere, went terribly wrong"... > > > > insn 18 wants to do > > > > mov.l @(r4,r6),r0 > > > > But it can't because the reg+reg address mode has a R0 constraint > > itself. So it needs to be changed to > > > > mov r4,r0 > > mov.l @(r0,r6),r0 > > > > And it can't handle that. Or only sometimes? Don't remember. > > > > > Is it just RA messing things > > > up, unrelated to the new pass? > > > > Yep, I think so. The additional pass seems to create "tougher" code so > > reload passes out earlier than usual. We've had the same issue when > > trying address mode selection optimization. In fact that was one huge > > showstopper. > > So maybe you should have a define_insn_and_split that allows any two > regs and replaces one by r0 if neither is (and a move to r0 before the > load)? Split after reload of course. > > It may be admitting defeat, but it may even result in better code as > well ;-) > AFAIR I've tried that already and it was just like running in circles. Means it didn't help. Perhaps if R0_REGS was hidden from RA altogether it might work. But that sounds like opening a whole other can of worms. Another idea I was entertaining was to do a custom RTL pass to pre-allocate all R0 constraints before the real full RA. But then the whole reload stuff would still have the same issue as above. So all the wallpapering is just moot. Proper fix of the actual problem would be more appropriate. Cheers, Oleg