[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [RFC][PATCH v0 4/8] Calculate NEXT_CALL liveness informatio
From: |
Kirill Batuzov |
Subject: |
[Qemu-devel] [RFC][PATCH v0 4/8] Calculate NEXT_CALL liveness information. |
Date: |
Mon, 23 May 2011 18:40:50 +0400 |
Keep track of where is the next call for each TCG operation.
Signed-off-by: Kirill Batuzov <address@hidden>
---
tcg/tcg.c | 11 +++++++++++
tcg/tcg.h | 2 ++
2 files changed, 13 insertions(+), 0 deletions(-)
diff --git a/tcg/tcg.c b/tcg/tcg.c
index 61689e2..799b245 100644
--- a/tcg/tcg.c
+++ b/tcg/tcg.c
@@ -1212,6 +1212,9 @@ static void tcg_liveness_analysis(TCGContext *s)
uint8_t *dead_temps;
int *temp_next_use = NULL;
unsigned int dead_iargs;
+#ifdef USE_ADVANCED_REGALLOC
+ int last_call;
+#endif
gen_opc_ptr++; /* skip end */
@@ -1223,6 +1226,8 @@ static void tcg_liveness_analysis(TCGContext *s)
nb_args = gen_opparam_ptr - gen_opparam_buf;
s->param_next_use = tcg_malloc(nb_args * sizeof(s->param_next_use[0]));
next_use_ptr = s->param_next_use + nb_args;
+ last_call = nb_ops + 1;
+ s->next_call = tcg_malloc(nb_ops * sizeof(s->next_call[0]));
#endif
dead_temps = tcg_malloc(s->nb_temps);
@@ -1237,6 +1242,12 @@ static void tcg_liveness_analysis(TCGContext *s)
while (op_index >= 0) {
op = gen_opc_buf[op_index];
def = &tcg_op_defs[op];
+#ifdef USE_ADVANCED_REGALLOC
+ s->next_call[op_index] = last_call;
+ if (def->flags & TCG_OPF_CALL_CLOBBER) {
+ last_call = op_index;
+ }
+#endif
switch(op) {
case INDEX_op_call:
{
diff --git a/tcg/tcg.h b/tcg/tcg.h
index d8bfa2c..9ff519e 100644
--- a/tcg/tcg.h
+++ b/tcg/tcg.h
@@ -290,6 +290,8 @@ struct TCGContext {
corresponding input argument is dead */
int *param_next_use; /* for each operation argument tells where it's
next used is (USE_ADVANCED_REGALLOC only) */
+ int *next_call; /* for each operation tells where next CALL operation
+ occurs */
/* tells in which temporary a given register is. It does not take
into account fixed registers */
--
1.7.4.1
- [Qemu-devel] [RFC][PATCH v0 0/8] Improve register allocator, Kirill Batuzov, 2011/05/23
- [Qemu-devel] [RFC][PATCH v0 4/8] Calculate NEXT_CALL liveness information.,
Kirill Batuzov <=
- [Qemu-devel] [RFC][PATCH v0 6/8] Spill globals early if their next use is in call., Kirill Batuzov, 2011/05/23
- [Qemu-devel] [RFC][PATCH v0 2/8] Propagate REG_NEXT_USE value through process of register allocation., Kirill Batuzov, 2011/05/23
- [Qemu-devel] [RFC][PATCH v0 5/8] Track call-clobbered uses of registers, Kirill Batuzov, 2011/05/23
- [Qemu-devel] [RFC][PATCH v0 1/8] Compute additional liveness information for register allocator., Kirill Batuzov, 2011/05/23
- [Qemu-devel] [RFC][PATCH v0 8/8] Add spill count profiling., Kirill Batuzov, 2011/05/23
- [Qemu-devel] [RFC][PATCH v0 7/8] Spill globals early if their next use is at the BB end., Kirill Batuzov, 2011/05/23
- [Qemu-devel] [RFC][PATCH v0 3/8] Do better spill choice., Kirill Batuzov, 2011/05/23
- Re: [Qemu-devel] [RFC][PATCH v0 0/8] Improve register allocator, Aurelien Jarno, 2011/05/23