From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 127220 invoked by alias); 18 Nov 2016 12:50:54 -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 127206 invoked by uid 89); 18 Nov 2016 12:50:53 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-4.6 required=5.0 tests=AWL,BAYES_00,RP_MATCHES_RCVD autolearn=ham version=3.3.2 spammy=Hx-languages-length:1620, H*r:8.13.8, wrapping X-HELO: gate.crashing.org Received: from gate.crashing.org (HELO gate.crashing.org) (63.228.1.57) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 18 Nov 2016 12:50:51 +0000 Received: from gate.crashing.org (localhost.localdomain [127.0.0.1]) by gate.crashing.org (8.14.1/8.13.8) with ESMTP id uAICohKG028467; Fri, 18 Nov 2016 06:50:43 -0600 Received: (from segher@localhost) by gate.crashing.org (8.14.1/8.14.1/Submit) id uAICogNk028466; Fri, 18 Nov 2016 06:50:42 -0600 Date: Fri, 18 Nov 2016 12:50:00 -0000 From: Segher Boessenkool To: Kyrill Tkachov Cc: Andrew Pinski , GCC Patches , Marcus Shawcroft , Richard Earnshaw , James Greenhalgh Subject: Re: [PATCH][AArch64] Separate shrink wrapping hooks implementation Message-ID: <20161118125042.GK3732@gate.crashing.org> References: <20161110233943.GC17570@gate.crashing.org> <58259AD6.4040203@foss.arm.com> <5825E454.6070302@foss.arm.com> <5829C958.2010601@foss.arm.com> <582DBD10.8010200@foss.arm.com> <20161117144424.GA3732@gate.crashing.org> <582DC4D8.9060701@foss.arm.com> <582DDFE6.50200@foss.arm.com> <20161117174550.GC3732@gate.crashing.org> <582EC9E9.8050303@foss.arm.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <582EC9E9.8050303@foss.arm.com> User-Agent: Mutt/1.4.2.3i X-IsSubscribed: yes X-SW-Source: 2016-11/txt/msg01924.txt.bz2 On Fri, Nov 18, 2016 at 09:29:13AM +0000, Kyrill Tkachov wrote: > >So your COMPONENTS_FOR_BB returns both components in a pair whenever one > >of those is needed? That should work afaics. > > I mean I still want to have one component per register and since > emit_{prologue,epilogue}_components knows how to form pairs from the > components passed down to it I just need to restrict the number of > components in any particular basic block to an even number. > So say a function can wrap 5 registers: x22,x23,x24,x25,x26. > I want get_separate_components to return 5 components since in that hook > we don't know how these registers are distributed across each basic block. > components_for_bb has that information. > In components_for_bb I want to restrict the components for a basic block to > an even number, so if normally all 5 registers would be valid for wrapping > in that bb I'd only choose 4 so I could form 2 pairs. But selecting only 4 > of the 5 registers, say only x22,x23,x24,x25 leads to x26 not being saved > or restored at all, even during the normal prologue and epilogue because > x26 was marked as a component in components_for_bb and therefore omitted > from > the prologue and epilogue. > So I'm thinking x26 should be removed from the wrappable components of > a basic block by disqualify_components. I'm trying that approach now. My suggestion was, in components_for_bb, whenever you mark x22 as needed you also mark x23 as needed, and whenever you mark x23 as needed you also mark x22. I think this is a lot simpler? Segher