From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:40795) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QNUiz-00036z-TV for qemu-devel@nongnu.org; Fri, 20 May 2011 14:47:02 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QNUiy-0004WM-SE for qemu-devel@nongnu.org; Fri, 20 May 2011 14:47:01 -0400 Received: from mail-vw0-f45.google.com ([209.85.212.45]:49230) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QNUiy-0004WD-Ov for qemu-devel@nongnu.org; Fri, 20 May 2011 14:47:00 -0400 Received: by vws17 with SMTP id 17so3298891vws.4 for ; Fri, 20 May 2011 11:46:59 -0700 (PDT) Sender: Paolo Bonzini Message-ID: <4DD6B71D.8090904@redhat.com> Date: Fri, 20 May 2011 20:46:53 +0200 From: Paolo Bonzini MIME-Version: 1.0 References: <4763ae5461ae14adbb6aca5c925fa0fe81f4f214.1305889001.git.batuzovk@ispras.ru> <4DD6B16C.5090500@twiddle.net> In-Reply-To: <4DD6B16C.5090500@twiddle.net> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 2/6] Add copy and constant propagation. List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Richard Henderson Cc: mj.mccormack@samsung.com, qemu-devel@nongnu.org, zhur@ispras.ru, Kirill Batuzov On 05/20/2011 08:22 PM, Richard Henderson wrote: > I think it might be clearer to have these two in a structure, rather > than two separate arrays. That does waste a bit of memory in padding > for 64-bit target, but I think it might clean up the code a bit. You can use the padding to implement a generation count. O(1) clearing of the array might help performance somewhat. At this point making the arrays static makes sense again, because it allows to bump the generation count at the beginning of tcg_constant_folding (if you put it on the stack you have to zero the state). It could also help to add a num_copies flag tracking whether a register is a copy of this one. If not, you can avoid processing the output registers in the default case. That would be something like struct { uint16_t state; uint16_t num_copies; uint32_t gen; tcg_target_ulong val; }; Paolo