qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH for-2.5 03/10] tcg/optimize: track const/copy st


From: Aurelien Jarno
Subject: Re: [Qemu-devel] [PATCH for-2.5 03/10] tcg/optimize: track const/copy status separately
Date: Mon, 27 Jul 2015 11:10:16 +0200
User-agent: Mutt/1.5.23 (2014-03-12)

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 <address@hidden>
> > Signed-off-by: Aurelien Jarno <address@hidden>
> > ---
> >  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
address@hidden                 http://www.aurel32.net



reply via email to

[Prev in Thread] Current Thread [Next in Thread]