Skip to contentSkip to conversation

trivial:Loop invariant eode motion in tcg/optimize.c

PATCH In review qemu_wanghuang 2 participants 3 messages Nov 28, 2011

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 trivial:Loop invariant eode motion in tcg/optimize.c

We find that the "new_base" doesn't change during in the following loop, so we can outer this judgement from this loop.

qemu-local/tcg/optimize.c renamed from qemu/tcg/optimize.c +0 -0

index 9c65474..27164f0 100644

--- a/qemu/tcg/optimize.c

+++ b/qemu-local/tcg/optimize.c

@@ -67,12 +67,12 @@ static void reset_temp(TCGArg temp, int nb_temps, int nb_globals)

                 break;

             }

         }

- for (i = temps[temp].next_copy; i != temp; i = temps[i].next_copy) {

- if (new_base == (TCGArg)-1) {

+ if (new_base == (TCGArg)-1) {

+ for (i = temps[temp].next_copy; i != temp; i = temps[i].next_copy)

                 temps[i].state = TCG_TEMP_ANY;

- } else {

+ } else {

+ for (i = temps[temp].next_copy; i != temp; i = temps[i].next_copy)

                 temps[i].val = new_base;

- }

         }

         temps[temps[temp].next_copy].prev_copy = temps[temp].prev_copy;

         temps[temps[temp].prev_copy].next_copy = temps[temp].next_copy;
#1 lore raw

2011/11/28 qemu_wanghuang <[email protected]>:

Quoted 7 lines

------=_Part_169458_1849861657.1322451109855
Content-Type: text/plain; charset=GBK
Content-Transfer-Encoding: 7bit
[...]
------=_Part_169458_1849861657.1322451109855
Content-Type: text/html; charset=GBK
Content-Transfer-Encoding: 7bit

Please don't send patch mails as multipart MIME emails -- they won't apply cleanly. Plain text as produced by 'git format-patch' and sent via 'git send-email', please.

-- PMM

#2 lore raw

Thank you very much.It's my fault.

Quoted 14 lines · At 2011-11-28 16:16:57,"Peter Maydell" <[email protected]> wrote:

2011/11/28 qemu_wanghuang <[email protected]>:

Quoted 7 lines

------=_Part_169458_1849861657.1322451109855
Content-Type: text/plain; charset=GBK
Content-Transfer-Encoding: 7bit
[...]
------=_Part_169458_1849861657.1322451109855
Content-Type: text/html; charset=GBK
Content-Transfer-Encoding: 7bit

Please don't send patch mails as multipart MIME emails -- they won't apply cleanly. Plain text as produced by 'git format-patch' and sent via 'git send-email', please.

-- PMM