[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 3/9] tcg/optimizer: rework copy progagation
From: |
Richard Henderson |
Subject: |
Re: [Qemu-devel] [PATCH 3/9] tcg/optimizer: rework copy progagation |
Date: |
Wed, 19 Sep 2012 14:41:44 -0700 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:15.0) Gecko/20120828 Thunderbird/15.0 |
On 09/19/2012 01:00 PM, Aurelien Jarno wrote:
> The copy propagation pass tries to keep track of what is a copy of what
> and what has copy of what, and in addition it keep a circular list of
> of all the copies. Unfortunately this doesn't fully work: a mov from
> a temp which has a state "COPY" changes it into a state "HAS_COPY".
> Later when this temp is used again, it is considered has not having
> copy and thus no propagation is done.
>
> This patch fixes that by removing the hiearchy between copies, and thus
> only keeping a "COPY" state both meaning "is a copy" and "has a copy".
> The decision of which copy to use is deferred to the actual temp
> replacement. At this stage there is not one best choice to do, but only
> better choices than others. For doing the best choice the operation
> would have to be parsed in reversed to know if a temp is going to be
> used later or not. That what is done by the liveness analysis. At this
> stage it is known that globals will always be live, that local temps
> will be dead at the end of the translation block, and that the temps
> will be dead at the end of the basic block. This means that this stage
> should try to replace temps by local temps or globals and local temps
> by globals.
>
> It also brings the advantage of knowing if a temp is a copy of another,
> which can improve the various optimizations.
>
> Signed-off-by: Aurelien Jarno <address@hidden>
Reviewed-by: Richard Henderson <address@hidden>
r~
- Re: [Qemu-devel] [PATCH 9/9] tcg: remove #ifdef #endif around TCGOpcode tests, (continued)
- [Qemu-devel] [PATCH 7/9] tcg/optimize: further optimize brcond/setcond, Aurelien Jarno, 2012/09/19
- [Qemu-devel] [PATCH 8/9] tcg/optimize: prefer the "op a, a, b" form for commutative ops, Aurelien Jarno, 2012/09/19
- [Qemu-devel] [PATCH 3/9] tcg/optimizer: rework copy progagation, Aurelien Jarno, 2012/09/19
- Re: [Qemu-devel] [PATCH 3/9] tcg/optimizer: rework copy progagation,
Richard Henderson <=
- [Qemu-devel] [PATCH 5/9] tcg/optimize: optimize "op r, a, a => mov r, a", Aurelien Jarno, 2012/09/19
- Re: [Qemu-devel] [PATCH 0/9] tcg/optimize: rework copy propagation, Laurent Desnogues, 2012/09/21