@@ -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:
{
@@ -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 */
Keep track of where is the next call for each TCG operation. Signed-off-by: Kirill Batuzov <batuzovk@ispras.ru> --- tcg/tcg.c | 11 +++++++++++ tcg/tcg.h | 2 ++ 2 files changed, 13 insertions(+), 0 deletions(-)