qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Aurelien Jarno <aurelien@aurel32.net>
To: qemu-devel@nongnu.org
Cc: Aurelien Jarno <aurelien@aurel32.net>
Subject: [Qemu-devel] [PATCH 1/8] tcg: improve profiler
Date: Thu,  6 Sep 2012 17:00:50 +0200	[thread overview]
Message-ID: <1346943657-17256-2-git-send-email-aurelien@aurel32.net> (raw)
In-Reply-To: <1346943657-17256-1-git-send-email-aurelien@aurel32.net>

Now that there are two passes of optimization (optimize.c, liveness)
there is no point of outputing the statistics of the liveness part
only. Update the code to take into account both optimizations.

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
---
 tcg/tcg.c |   18 ++++++++++--------
 tcg/tcg.h |    2 +-
 2 files changed, 11 insertions(+), 9 deletions(-)

diff --git a/tcg/tcg.c b/tcg/tcg.c
index 8386b70..8907b9f 100644
--- a/tcg/tcg.c
+++ b/tcg/tcg.c
@@ -2059,22 +2059,23 @@ static inline int tcg_gen_code_common(TCGContext *s, uint8_t *gen_code_buf,
     }
 #endif
 
+#ifdef CONFIG_PROFILER
+    s->opt_time -= profile_getclock();
+#endif
+
 #ifdef USE_TCG_OPTIMIZATIONS
     gen_opparam_ptr =
         tcg_optimize(s, gen_opc_ptr, gen_opparam_buf, tcg_op_defs);
 #endif
-
-#ifdef CONFIG_PROFILER
-    s->la_time -= profile_getclock();
-#endif
     tcg_liveness_analysis(s);
+
 #ifdef CONFIG_PROFILER
-    s->la_time += profile_getclock();
+    s->opt_time += profile_getclock();
 #endif
 
 #ifdef DEBUG_DISAS
     if (unlikely(qemu_loglevel_mask(CPU_LOG_TB_OP_OPT))) {
-        qemu_log("OP after liveness analysis:\n");
+        qemu_log("OP after optimization:\n");
         tcg_dump_ops(s);
         qemu_log("\n");
     }
@@ -2241,8 +2242,9 @@ void tcg_dump_info(FILE *f, fprintf_function cpu_fprintf)
                 (double)s->interm_time / tot * 100.0);
     cpu_fprintf(f, "  gen_code time     %0.1f%%\n", 
                 (double)s->code_time / tot * 100.0);
-    cpu_fprintf(f, "liveness/code time  %0.1f%%\n", 
-                (double)s->la_time / (s->code_time ? s->code_time : 1) * 100.0);
+    cpu_fprintf(f, "optim./code time    %0.1f%%\n",
+                (double)s->opt_time / (s->code_time ? s->code_time : 1)
+                * 100.0);
     cpu_fprintf(f, "cpu_restore count   %" PRId64 "\n",
                 s->restore_count);
     cpu_fprintf(f, "  avg cycles        %0.1f\n",
diff --git a/tcg/tcg.h b/tcg/tcg.h
index d710694..7d63db5 100644
--- a/tcg/tcg.h
+++ b/tcg/tcg.h
@@ -381,7 +381,7 @@ struct TCGContext {
     int64_t code_out_len;
     int64_t interm_time;
     int64_t code_time;
-    int64_t la_time;
+    int64_t opt_time;
     int64_t restore_count;
     int64_t restore_time;
 #endif
-- 
1.7.10.4

  reply	other threads:[~2012-09-06 15:01 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-09-06 15:00 [Qemu-devel] [PATCH 0/8] Improve TCG optimizer Aurelien Jarno
2012-09-06 15:00 ` Aurelien Jarno [this message]
2012-09-06 15:00 ` [Qemu-devel] [PATCH 2/8] tcg/optimize: split expression simplification Aurelien Jarno
2012-09-06 15:00 ` [Qemu-devel] [PATCH 3/8] tcg/optimize: simplify or/xor r, a, 0 cases Aurelien Jarno
2012-09-06 15:00 ` [Qemu-devel] [PATCH 4/8] tcg/optimize: simplify and " Aurelien Jarno
2012-09-06 15:00 ` [Qemu-devel] [PATCH 5/8] tcg/optimize: simplify shift/rot r, 0, a => movi r, " Aurelien Jarno
2012-09-06 15:00 ` [Qemu-devel] [PATCH 6/8] tcg/optimize: swap brcond/setcond arguments when possible Aurelien Jarno
2012-09-06 15:00 ` [Qemu-devel] [PATCH 7/8] tcg/optimize: add constant folding for setcond Aurelien Jarno
2012-09-06 16:40   ` Richard Henderson
2012-09-07 10:05     ` Aurelien Jarno
2012-09-06 15:00 ` [Qemu-devel] [PATCH 8/8] tcg/optimize: add constant folding for brcond Aurelien Jarno
2012-09-06 16:43 ` [Qemu-devel] [PATCH 0/8] Improve TCG optimizer Richard Henderson
2012-09-07 10:06   ` Aurelien Jarno
2012-09-07 12:34 ` Peter Maydell
2012-09-07 13:00   ` Aurelien Jarno

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=1346943657-17256-2-git-send-email-aurelien@aurel32.net \
    --to=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).