From patchwork Mon May 23 14:40:51 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kirill Batuzov X-Patchwork-Id: 96955 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 ABEE0B6F9A for ; Tue, 24 May 2011 00:43:08 +1000 (EST) Received: from localhost ([::1]:55873 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QOWLZ-0003x7-N7 for incoming@patchwork.ozlabs.org; Mon, 23 May 2011 10:43:05 -0400 Received: from eggs.gnu.org ([140.186.70.92]:46079) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QOWJp-0001M7-D5 for qemu-devel@nongnu.org; Mon, 23 May 2011 10:41:18 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QOWJo-0001MS-BD for qemu-devel@nongnu.org; Mon, 23 May 2011 10:41:17 -0400 Received: from smtp.ispras.ru ([83.149.198.202]:37596) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QOWJo-0001Lv-2K for qemu-devel@nongnu.org; Mon, 23 May 2011 10:41:16 -0400 Received: from bulbul.intra.ispras.ru (winnie.ispras.ru [83.149.198.236]) by smtp.ispras.ru (Postfix) with ESMTP id 573295D40C1; Mon, 23 May 2011 18:37:20 +0400 (MSD) From: Kirill Batuzov To: qemu-devel@nongnu.org Date: Mon, 23 May 2011 18:40:51 +0400 Message-Id: <1306161654-4388-6-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 5/8] Track call-clobbered uses of registers 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 Adjust next use for call-clobbered registers. Signed-off-by: Kirill Batuzov --- 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);