From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:39707) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZJeQN-0006xf-Do for qemu-devel@nongnu.org; Mon, 27 Jul 2015 05:10:20 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZJeQM-0007y9-AU for qemu-devel@nongnu.org; Mon, 27 Jul 2015 05:10:19 -0400 Received: from hall.aurel32.net ([2001:bc8:30d7:100::1]:42141) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZJeQM-0007xf-0i for qemu-devel@nongnu.org; Mon, 27 Jul 2015 05:10:18 -0400 Date: Mon, 27 Jul 2015 11:10:16 +0200 From: Aurelien Jarno Message-ID: <20150727091016.GD30591@aurel32.net> References: <1437755447-10537-1-git-send-email-aurelien@aurel32.net> <1437755447-10537-4-git-send-email-aurelien@aurel32.net> <55B5EB14.9080702@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <55B5EB14.9080702@redhat.com> Subject: Re: [Qemu-devel] [PATCH for-2.5 03/10] tcg/optimize: track const/copy status separately List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini Cc: qemu-devel@nongnu.org, Richard Henderson On 2015-07-27 10:25, Paolo Bonzini wrote: > > > On 24/07/2015 18:30, Aurelien Jarno wrote: > > Use two bools to track constants and copies instead of an enum. > > > > Cc: Richard Henderson > > Signed-off-by: Aurelien Jarno > > --- > > tcg/optimize.c | 30 +++++++++++++++--------------- > > 1 file changed, 15 insertions(+), 15 deletions(-) > > > > diff --git a/tcg/optimize.c b/tcg/optimize.c > > index d2b63a4..f16eb1e 100644 > > --- a/tcg/optimize.c > > +++ b/tcg/optimize.c > > @@ -35,14 +35,9 @@ > > glue(glue(case INDEX_op_, x), _i32): \ > > glue(glue(case INDEX_op_, x), _i64) > > > > -typedef enum { > > - TCG_TEMP_UNDEF = 0, > > - TCG_TEMP_CONST, > > - TCG_TEMP_COPY, > > -} tcg_temp_state; > > - > > struct tcg_temp_info { > > - tcg_temp_state state; > > + bool is_const; > > + bool is_copy; > > Could temps[arg].is_copy be replaced by temps[arg].next_copy != arg? > > For example, this: > > if (temps[temp].prev_copy == temps[temp].next_copy) { > temps[temps[temp].next_copy].is_copy = false; > } else { > temps[temps[temp].next_copy].prev_copy = temps[temp].prev_copy; > temps[temps[temp].prev_copy].next_copy = temps[temp].next_copy; > } > > would be replaced simply by > > temps[temps[temp].next_copy].prev_copy = temps[temp].prev_copy; > temps[temps[temp].prev_copy].next_copy = temps[temp].next_copy; > That's an interesting idea, especially I have a patch series in preparation that get rid of is_const. I will try to get something like that for v2. -- Aurelien Jarno GPG: 4096R/1DDD8C9B aurelien@aurel32.net http://www.aurel32.net