Received: from eggs.gnu.org ([140.186.70.92]:56955) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QOcaK-0001Dc-4H for qemu-devel@nongnu.org; Mon, 23 May 2011 17:22:45 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QOcaI-0000BC-PF for qemu-devel@nongnu.org; Mon, 23 May 2011 17:22:44 -0400 Received: from hall.aurel32.net ([88.191.126.93]:41815) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QOcaI-0000B5-KV for qemu-devel@nongnu.org; Mon, 23 May 2011 17:22:42 -0400 Date: Mon, 23 May 2011 23:22:41 +0200 From: Aurelien Jarno Message-ID: <20110523212241.GB5112@hall.aurel32.net> References: <1306161654-4388-1-git-send-email-batuzovk@ispras.ru> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15 Content-Disposition: inline In-Reply-To: <1306161654-4388-1-git-send-email-batuzovk@ispras.ru> Sender: Aurelien Jarno Subject: Re: [Qemu-devel] [RFC][PATCH v0 0/8] Improve register allocator List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Kirill Batuzov Cc: qemu-devel@nongnu.org, zhur@ispras.ru On Mon, May 23, 2011 at 06:40:46PM +0400, Kirill Batuzov wrote: > This series improves register allocator by keeping track of temp's and > register's live ranges, doing better spill choice and spilling early unneeded > globals. > > The patches do need testing and performance evaluation before they will be > ready for final review. I decided to preliminary post them because it seems > other people are working on the same thing and I'd like to avoid unnecessary > work duplication if possible. Thanks for this patch series. Your approach to solve this issue is really different than mine. Instead I added more state to the dead/live states, and use them to mark some input deads even for global, and mark some output arguments to be synced. This informations are then used directly in the tcg_reg_alloc_* functions to make better usage of the available registers. On the other hand my patch series only tries to really lower the number of spills and doesn't try to make better spill choices. I guess it would be a good idea that I continue with this approach (I basically just have to fix a few cases were some regs are wrongly copied back to memory), so that we can more easily compare the two approaches. Your last patch is anyway interesting, having some statistics is always something interesting. In any case I really think we need a better register allocator before we can do any serious optimization passes like constant or copy propagation, otherwise we end up with a lot of register in use for no real reason. > Kirill Batuzov (8): > Compute additional liveness information for register allocator. > Propagate REG_NEXT_USE value through process of register allocation. > Do better spill choice. > Calculate NEXT_CALL liveness information. > Track call-clobbered uses of registers > Spill globals early if their next use is in call. > Spill globals early if their next use is at the BB end. > Add spill count profiling. > > tcg/tcg.c | 245 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-- > tcg/tcg.h | 12 +++ > 2 files changed, 248 insertions(+), 9 deletions(-) > > -- > 1.7.4.1 > > > -- Aurelien Jarno GPG: 1024D/F1BCDB73 aurelien@aurel32.net http://www.aurel32.net