qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: qemu_wanghuang  <qemu_wanghuang@126.com>
Cc: qemu-devel <qemu-devel@nongnu.org>
Subject: [Qemu-devel] [PATCH] trivial:Loop invariant eode motion in tcg/optimize.c
Date: Mon, 28 Nov 2011 11:31:49 +0800 (CST)	[thread overview]
Message-ID: <5dc6e67f.f305.133e83a87df.Coremail.qemu_wanghuang@126.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 1099 bytes --]

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

Signed-off-by: Wanghuang <qemu_wanghuang@126.com>

diff --git a/qemu/tcg/optimize.c b/qemu-local/tcg/optimize.c

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;



[-- Attachment #2: Type: text/html, Size: 2186 bytes --]

             reply	other threads:[~2011-11-28  4:02 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-11-28  3:31 qemu_wanghuang [this message]
2011-11-28  8:16 ` [Qemu-devel] [PATCH] trivial:Loop invariant eode motion in tcg/optimize.c Peter Maydell
2011-11-28  8:25 ` qemu_wanghuang

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=5dc6e67f.f305.133e83a87df.Coremail.qemu_wanghuang@126.com \
    --to=qemu_wanghuang@126.com \
    --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).