qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Richard Henderson <rth@twiddle.net>
To: Aurelien Jarno <aurelien@aurel32.net>
Cc: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH v2 07/26] tcg: rewrite tcg_reg_alloc_mov()
Date: Wed, 10 Oct 2012 09:27:44 -0700	[thread overview]
Message-ID: <5075A200.7070708@twiddle.net> (raw)
In-Reply-To: <1349812584-19551-8-git-send-email-aurelien@aurel32.net>

On 10/09/2012 12:56 PM, Aurelien Jarno wrote:
> Now that the liveness analysis provides more information, rewrite
> tcg_reg_alloc_mov(). This changes the behaviour about propagating
> constants and memory accesses. We now take the assumption that once
> a value is loaded into a register (from memory or from a constant),
> it's better to keep it there than to reload it later. This assumption
> is now always almost correct given that we are now sure the
> corresponding temp is going to be used later (otherwise it would have
> been synchronized and marked as dead already). The assumption is wrong
> if one of the op after clobbers some registers including the one
> of the holding the temp (this can be avoided by allocating clobbered
> registers last, which is what most TCG target do), or in case of lack
> of available register.
> 
> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>

Reviewed-by: Richard Henderson <rth@twiddle.net>

> +        /* The code in the first if block should have moved the
> +           temp to a register. */
> +        assert(ts->val_type == TEMP_VAL_REG);
> +        if (IS_DEAD_ARG(1) && !ts->fixed_reg && !ots->fixed_reg) {
> +                /* the mov can be suppressed */
> +                if (ots->val_type == TEMP_VAL_REG) {
> +                    s->reg_to_temp[ots->reg] = -1;
> +                }
> +                ots->reg = ts->reg;
> +                temp_dead(s, args[1]);

Incorrect indentation?

>          } else {
> +            if (ots->val_type != TEMP_VAL_REG) {
> +                /* When allocating a new register, make sure to not spill the
> +                   input one. */
> +                tcg_regset_set_reg(allocated_regs, ts->reg);
> +                ots->reg = tcg_reg_alloc(s, oarg_ct->u.regs, allocated_regs);
>              }
> +            tcg_out_mov(s, ots->type, ots->reg, ts->reg);
> +        }

  reply	other threads:[~2012-10-10 16:28 UTC|newest]

Thread overview: 54+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-09 19:55 [Qemu-devel] [PATCH v2 00/26] tcg: rework liveness analysis and register allocator Aurelien Jarno
2012-10-09 19:55 ` [Qemu-devel] [PATCH v2 01/26] tcg: add temp_dead() Aurelien Jarno
2012-10-09 19:56 ` [Qemu-devel] [PATCH v2 02/26] tcg: add tcg_reg_sync() Aurelien Jarno
2012-10-09 19:56 ` [Qemu-devel] [PATCH v2 03/26] tcg: add temp_sync() Aurelien Jarno
2012-10-09 19:56 ` [Qemu-devel] [PATCH v2 04/26] tcg: sync output arguments on liveness request Aurelien Jarno
2012-10-10 16:22   ` Richard Henderson
2012-10-09 19:56 ` [Qemu-devel] [PATCH v2 05/26] tcg: rework liveness analysis Aurelien Jarno
2012-10-09 19:56 ` [Qemu-devel] [PATCH v2 06/26] tcg: improve tcg_reg_alloc_movi() Aurelien Jarno
2012-10-09 19:56 ` [Qemu-devel] [PATCH v2 07/26] tcg: rewrite tcg_reg_alloc_mov() Aurelien Jarno
2012-10-10 16:27   ` Richard Henderson [this message]
2012-10-09 19:56 ` [Qemu-devel] [PATCH v2 08/26] tcg: always mark dead input arguments as dead Aurelien Jarno
2012-10-09 19:56 ` [Qemu-devel] [PATCH v2 09/26] tcg: start with local temps in TEMP_VAL_MEM state Aurelien Jarno
2012-10-09 19:56 ` [Qemu-devel] [PATCH v2 10/26] tcg: don't explicitly save globals and temps Aurelien Jarno
2012-10-10 16:55   ` Richard Henderson
2012-10-09 19:56 ` [Qemu-devel] [PATCH v2 11/26] tcg: fix some op flags Aurelien Jarno
2012-10-10 16:56   ` Richard Henderson
2012-10-09 19:56 ` [Qemu-devel] [PATCH v2 12/26] tcg: forbid ld/st function to modify globals Aurelien Jarno
2012-10-10 16:57   ` Richard Henderson
2012-10-09 19:56 ` [Qemu-devel] [PATCH v2 13/26] tcg: synchronize globals for ops with side effects Aurelien Jarno
2012-10-10 17:01   ` Richard Henderson
2012-10-09 19:56 ` [Qemu-devel] [PATCH v2 14/26] tcg: rework TCG helper flags Aurelien Jarno
2012-10-09 20:04   ` Peter Maydell
2012-10-09 20:24     ` Aurelien Jarno
2012-10-10 17:12       ` Richard Henderson
2012-10-10 17:14         ` Richard Henderson
2012-10-10 17:11   ` Richard Henderson
2012-10-19 20:24     ` Aurelien Jarno
2012-10-19 22:25       ` Richard Henderson
2012-10-09 19:56 ` [Qemu-devel] [PATCH v2 15/26] target-alpha: rename " Aurelien Jarno
2012-10-10 17:14   ` Richard Henderson
2012-10-09 19:56 ` [Qemu-devel] [PATCH v2 16/26] target-arm: " Aurelien Jarno
2012-10-09 19:56 ` [Qemu-devel] [PATCH v2 17/26] target-cris: " Aurelien Jarno
2012-10-10 10:02   ` Edgar E. Iglesias
2012-10-10 10:05   ` Edgar E. Iglesias
2012-10-10 12:09     ` Aurelien Jarno
2012-10-09 19:56 ` [Qemu-devel] [PATCH v2 18/26] target-i386: " Aurelien Jarno
2012-10-10 17:15   ` Richard Henderson
2012-10-09 19:56 ` [Qemu-devel] [PATCH v2 19/26] target-microblaze: " Aurelien Jarno
2012-10-10 10:03   ` Edgar E. Iglesias
2012-10-09 19:56 ` [Qemu-devel] [PATCH v2 20/26] target-mips: " Aurelien Jarno
2012-10-09 19:56 ` [Qemu-devel] [PATCH v2 21/26] target-ppc: " Aurelien Jarno
2012-10-09 19:56 ` [Qemu-devel] [PATCH v2 22/26] target-s390x: " Aurelien Jarno
2012-10-09 19:56 ` [Qemu-devel] [PATCH v2 23/26] target-sh4: " Aurelien Jarno
2012-10-09 19:56 ` [Qemu-devel] [PATCH v2 24/26] target-sparc: " Aurelien Jarno
2012-10-13  8:57   ` Blue Swirl
2012-10-09 19:56 ` [Qemu-devel] [PATCH v2 25/26] target-xtensa: " Aurelien Jarno
2012-10-09 19:56 ` [Qemu-devel] [PATCH v2 26/26] tcg: remove compatiblity call flags Aurelien Jarno
2012-10-10 17:16   ` Richard Henderson
2012-10-10  6:59 ` [Qemu-devel] [PATCH v2 00/26] tcg: rework liveness analysis and register allocator Paolo Bonzini
2012-10-10  7:42   ` Aurelien Jarno
2012-10-10  7:49     ` Paolo Bonzini
2012-10-10  8:24       ` Aurelien Jarno
2012-10-10 17:04     ` Richard Henderson
2012-10-10 17:24 ` 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=5075A200.7070708@twiddle.net \
    --to=rth@twiddle.net \
    --cc=aurelien@aurel32.net \
    --cc=qemu-devel@nongnu.org \
    /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).