[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v2 07/26] tcg: rewrite tcg_reg_alloc_mov()
From: |
Richard Henderson |
Subject: |
Re: [Qemu-devel] [PATCH v2 07/26] tcg: rewrite tcg_reg_alloc_mov() |
Date: |
Wed, 10 Oct 2012 09:27:44 -0700 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:15.0) Gecko/20120911 Thunderbird/15.0.1 |
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 <address@hidden>
Reviewed-by: Richard Henderson <address@hidden>
> + /* 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);
> + }
[Qemu-devel] [PATCH v2 08/26] tcg: always mark dead input arguments as dead, Aurelien Jarno, 2012/10/09
[Qemu-devel] [PATCH v2 26/26] tcg: remove compatiblity call flags, Aurelien Jarno, 2012/10/09
[Qemu-devel] [PATCH v2 07/26] tcg: rewrite tcg_reg_alloc_mov(), Aurelien Jarno, 2012/10/09
- Re: [Qemu-devel] [PATCH v2 07/26] tcg: rewrite tcg_reg_alloc_mov(),
Richard Henderson <=
[Qemu-devel] [PATCH v2 11/26] tcg: fix some op flags, Aurelien Jarno, 2012/10/09
[Qemu-devel] [PATCH v2 24/26] target-sparc: rename helper flags, Aurelien Jarno, 2012/10/09
[Qemu-devel] [PATCH v2 25/26] target-xtensa: rename helper flags, Aurelien Jarno, 2012/10/09
[Qemu-devel] [PATCH v2 10/26] tcg: don't explicitly save globals and temps, Aurelien Jarno, 2012/10/09
[Qemu-devel] [PATCH v2 22/26] target-s390x: rename helper flags, Aurelien Jarno, 2012/10/09
[Qemu-devel] [PATCH v2 21/26] target-ppc: rename helper flags, Aurelien Jarno, 2012/10/09
[Qemu-devel] [PATCH v2 17/26] target-cris: rename helper flags, Aurelien Jarno, 2012/10/09