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: Richard Henderson
Subject: Re: [Qemu-devel] [PATCH v1 4/5] tcg/optimize: fold constant test in tcg_opt_gen_mov
Date: Thu, 04 Jun 2015 14:07:37 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.7.0

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.


r~




reply via email to

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