qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Aurelien Jarno <aurelien@aurel32.net>
To: Richard Henderson <rth@twiddle.net>
Cc: qemu-devel@nongnu.org
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	[thread overview]
Message-ID: <20150604214420.GA6313@aurel32.net> (raw)
In-Reply-To: <5570BE19.7090000@twiddle.net>

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
aurelien@aurel32.net                 http://www.aurel32.net

  reply	other threads:[~2015-06-04 21:44 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-04 19:53 [Qemu-devel] [PATCH v1 0/5] tcg/optimize: small cleanups Aurelien Jarno
2015-06-04 19:53 ` [Qemu-devel] [PATCH v1 1/5] tcg/optimize: remove opc argument from tcg_opt_gen_movi Aurelien Jarno
2015-06-04 19:53 ` [Qemu-devel] [PATCH v1 2/5] tcg/optimize: remove opc argument from tcg_opt_gen_mov Aurelien Jarno
2015-06-04 19:53 ` [Qemu-devel] [PATCH v1 3/5] tcg/optimize: fold temp copies test in tcg_opt_gen_mov Aurelien Jarno
2015-06-04 19:53 ` [Qemu-devel] [PATCH v1 4/5] tcg/optimize: fold constant " Aurelien Jarno
2015-06-04 21:07   ` Richard Henderson
2015-06-04 21:44     ` Aurelien Jarno [this message]
2015-06-04 22:06       ` Richard Henderson
2015-06-05  9:19         ` [Qemu-devel] [PATCH v2] " Aurelien Jarno
2015-06-04 19:53 ` [Qemu-devel] [PATCH v1 5/5] tcg/optimize: rename tcg_constant_folding Aurelien Jarno
2015-06-04 21:09 ` [Qemu-devel] [PATCH v1 0/5] tcg/optimize: small cleanups Richard Henderson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20150604214420.GA6313@aurel32.net \
    --to=aurelien@aurel32.net \
    --cc=qemu-devel@nongnu.org \
    --cc=rth@twiddle.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).