From patchwork Mon May 23 14:40:50 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kirill Batuzov X-Patchwork-Id: 96950 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [140.186.70.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 4F6BCB6FB5 for ; Tue, 24 May 2011 00:41:44 +1000 (EST) Received: from localhost ([::1]:47876 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QOWKD-0001N3-PK for incoming@patchwork.ozlabs.org; Mon, 23 May 2011 10:41:41 -0400 Received: from eggs.gnu.org ([140.186.70.92]:46045) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QOWJo-0001Lz-A8 for qemu-devel@nongnu.org; Mon, 23 May 2011 10:41:17 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QOWJn-0001Lh-Cx for qemu-devel@nongnu.org; Mon, 23 May 2011 10:41:16 -0400 Received: from smtp.ispras.ru ([83.149.198.202]:37593) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QOWJn-0001He-6X for qemu-devel@nongnu.org; Mon, 23 May 2011 10:41:15 -0400 Received: from bulbul.intra.ispras.ru (winnie.ispras.ru [83.149.198.236]) by smtp.ispras.ru (Postfix) with ESMTP id 543C95D40C0; Mon, 23 May 2011 18:37:20 +0400 (MSD) From: Kirill Batuzov To: qemu-devel@nongnu.org Date: Mon, 23 May 2011 18:40:50 +0400 Message-Id: <1306161654-4388-5-git-send-email-batuzovk@ispras.ru> X-Mailer: git-send-email 1.7.4.1 In-Reply-To: <1306161654-4388-1-git-send-email-batuzovk@ispras.ru> References: <1306161654-4388-1-git-send-email-batuzovk@ispras.ru> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4) X-Received-From: 83.149.198.202 Cc: zhur@ispras.ru Subject: [Qemu-devel] [RFC][PATCH v0 4/8] Calculate NEXT_CALL liveness information. X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Keep track of where is the next call for each TCG operation. Signed-off-by: Kirill Batuzov --- 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 */