qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH v1 4/5] tcg/optimize: fold constant test in tcg_


From: Aurelien Jarno
Subject: Re: [Qemu-devel] [PATCH v1 4/5] tcg/optimize: fold constant test in tcg_opt_gen_mov
Date: Thu, 4 Jun 2015 23:44:20 +0200
User-agent: Mutt/1.5.23 (2014-03-12)

On 2015-06-04 14:07, Richard Henderson wrote:
> On 06/04/2015 12:53 PM, Aurelien Jarno wrote:
> > +
> >  static void tcg_opt_gen_mov(TCGContext *s, TCGOp *op, TCGArg *args,
> >                              TCGArg dst, TCGArg src)
> >  {
> > +    if (temps[src].state == TCG_TEMP_CONST) {
> > +        tcg_opt_gen_movi(s, op, args, dst, temps[src].val);
> > +        return;
> > +    }
> > +
> >      if (temps_are_copies(dst, src)) {
> >          tcg_op_remove(s, op);
> >          return;
> 
> I was going to comment re patch 3/5, but here's better, since it actually
> tidies up all the places I would have pointed out.
> 
> I think you should check for copies first, and only then do the TEMP_CONST
> check.  That way we get to remove an op.

If the state of a temp is TCG_TEMP_CONST, it can't be a copy as its
state should be TCG_TEMP_COPY for that. But it's true that the original
code is checking first for copies and then for constants.

-- 
Aurelien Jarno                          GPG: 4096R/1DDD8C9B
address@hidden                 http://www.aurel32.net



reply via email to

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