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
[email protected]                 http://www.aurel32.net

Reply via email to