[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v2 1/9] tcg: improve profiler
From: |
Aurelien Jarno |
Subject: |
[Qemu-devel] [PATCH v2 1/9] tcg: improve profiler |
Date: |
Fri, 7 Sep 2012 15:16:24 +0200 |
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 <address@hidden>
---
tcg/tcg.c | 12 +++++++++++-
tcg/tcg.h | 1 +
2 files changed, 12 insertions(+), 1 deletion(-)
diff --git a/tcg/tcg.c b/tcg/tcg.c
index 8386b70..a4e7f42 100644
--- a/tcg/tcg.c
+++ b/tcg/tcg.c
@@ -2059,22 +2059,29 @@ 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->opt_time += profile_getclock();
s->la_time -= profile_getclock();
#endif
+
tcg_liveness_analysis(s);
+
#ifdef CONFIG_PROFILER
s->la_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 and liveness analysis:\n");
tcg_dump_ops(s);
qemu_log("\n");
}
@@ -2241,6 +2248,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, "optim./code time %0.1f%%\n",
+ (double)s->opt_time / (s->code_time ? s->code_time : 1)
+ * 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, "cpu_restore count %" PRId64 "\n",
diff --git a/tcg/tcg.h b/tcg/tcg.h
index d710694..7a72729 100644
--- a/tcg/tcg.h
+++ b/tcg/tcg.h
@@ -382,6 +382,7 @@ struct TCGContext {
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
- [Qemu-devel] [PATCH v2 0/9] Improve TCG optimizer, Aurelien Jarno, 2012/09/07
- [Qemu-devel] [PATCH v2 2/9] tcg/optimize: split expression simplification, Aurelien Jarno, 2012/09/07
- [Qemu-devel] [PATCH v2 1/9] tcg: improve profiler,
Aurelien Jarno <=
- [Qemu-devel] [PATCH v2 3/9] tcg/optimize: simplify or/xor r, a, 0 cases, Aurelien Jarno, 2012/09/07
- [Qemu-devel] [PATCH v2 4/9] tcg/optimize: simplify and r, a, 0 cases, Aurelien Jarno, 2012/09/07
- [Qemu-devel] [PATCH v2 9/9] tcg/optimize: fix if/else/break coding style, Aurelien Jarno, 2012/09/07
- [Qemu-devel] [PATCH v2 8/9] tcg/optimize: add constant folding for brcond, Aurelien Jarno, 2012/09/07
- [Qemu-devel] [PATCH v2 5/9] tcg/optimize: simplify shift/rot r, 0, a => movi r, 0 cases, Aurelien Jarno, 2012/09/07
- [Qemu-devel] [PATCH v2 7/9] tcg/optimize: add constant folding for setcond, Aurelien Jarno, 2012/09/07
- [Qemu-devel] [PATCH v2 6/9] tcg/optimize: swap brcond/setcond arguments when possible, Aurelien Jarno, 2012/09/07
- Re: [Qemu-devel] [PATCH v2 0/9] Improve TCG optimizer, Blue Swirl, 2012/09/08