qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [RFC][PATCH v0 5/8] Track call-clobbered uses of registers


From: Kirill Batuzov
Subject: [Qemu-devel] [RFC][PATCH v0 5/8] Track call-clobbered uses of registers
Date: Mon, 23 May 2011 18:40:51 +0400

Adjust next use for call-clobbered registers.

Signed-off-by: Kirill Batuzov <address@hidden>
---
 tcg/tcg.c |   12 ++++++++++++
 1 files changed, 12 insertions(+), 0 deletions(-)

diff --git a/tcg/tcg.c b/tcg/tcg.c
index 799b245..8ab556d 100644
--- a/tcg/tcg.c
+++ b/tcg/tcg.c
@@ -2125,6 +2125,9 @@ static inline int tcg_gen_code_common(TCGContext *s, 
uint8_t *gen_code_buf,
     int nb_args;
     unsigned int dead_iargs;
     const TCGArg *args;
+#ifdef USE_ADVANCED_REGALLOC
+    int reg;
+#endif
 
 #ifdef DEBUG_DISAS
     if (unlikely(qemu_loglevel_mask(CPU_LOG_TB_OP))) {
@@ -2166,6 +2169,15 @@ static inline int tcg_gen_code_common(TCGContext *s, 
uint8_t *gen_code_buf,
         tcg_table_op_count[opc]++;
 #endif
         def = &tcg_op_defs[opc];
+
+#ifdef USE_ADVANCED_REGALLOC
+        for (reg = 0; reg < TCG_TARGET_NB_REGS; reg++) {
+            if (tcg_regset_test_reg(tcg_target_call_clobber_regs, reg)
+                    && s->reg_next_use[reg] > s->next_call[op_index]) {
+                s->reg_next_use[reg] = s->next_call[op_index];
+            }
+        }
+#endif
 #if 0
         printf("%s: %d %d %d\n", def->name,
                def->nb_oargs, def->nb_iargs, def->nb_cargs);
-- 
1.7.4.1




reply via email to

[Prev in Thread] Current Thread [Next in Thread]