From patchwork Tue May 17 16:28:19 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aurelien Jarno X-Patchwork-Id: 95960 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 3AFE9B6EDF for ; Wed, 18 May 2011 02:29:49 +1000 (EST) Received: from localhost ([::1]:34487 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QMN9W-0005Nz-JT for incoming@patchwork.ozlabs.org; Tue, 17 May 2011 12:29:46 -0400 Received: from eggs.gnu.org ([140.186.70.92]:37064) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QMN8H-0003WW-Iw for qemu-devel@nongnu.org; Tue, 17 May 2011 12:28:30 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QMN8E-0004Ye-PP for qemu-devel@nongnu.org; Tue, 17 May 2011 12:28:29 -0400 Received: from hall.aurel32.net ([88.191.126.93]:51066) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QMN8E-0004YO-Hp for qemu-devel@nongnu.org; Tue, 17 May 2011 12:28:26 -0400 Received: from [2001:470:d4ed:0:5e26:aff:fe2b:6f5b] (helo=volta.aurel32.net) by hall.aurel32.net with esmtpsa (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.72) (envelope-from ) id 1QMN8C-0003bx-R8; Tue, 17 May 2011 18:28:24 +0200 Received: from aurel32 by volta.aurel32.net with local (Exim 4.72) (envelope-from ) id 1QMN8B-0002tz-M2; Tue, 17 May 2011 18:28:23 +0200 From: Aurelien Jarno To: qemu-devel@nongnu.org Date: Tue, 17 May 2011 18:28:19 +0200 Message-Id: <1305649700-9078-3-git-send-email-aurelien@aurel32.net> X-Mailer: git-send-email 1.7.2.3 In-Reply-To: <1305649700-9078-1-git-send-email-aurelien@aurel32.net> References: <1305649700-9078-1-git-send-email-aurelien@aurel32.net> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 88.191.126.93 Cc: Aurelien Jarno Subject: [Qemu-devel] [PATCH 2/3] tcg: mark dead output argument in op_dead_args 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 If an op is not removed and has dead output arguments, mark it in op_dead_args similarly to what is done for input arguments. Signed-off-by: Aurelien Jarno --- tcg/tcg.c | 10 ++++++++-- 1 files changed, 8 insertions(+), 2 deletions(-) diff --git a/tcg/tcg.c b/tcg/tcg.c index 9a48cb9..82d3e1d 100644 --- a/tcg/tcg.c +++ b/tcg/tcg.c @@ -1245,8 +1245,12 @@ static void tcg_liveness_analysis(TCGContext *s) do_not_remove_call: /* output args are dead */ + dead_args = 0; for(i = 0; i < nb_oargs; i++) { arg = args[i]; + if (dead_temps[arg]) { + dead_args |= (1 << i); + } dead_temps[arg] = 1; } @@ -1256,7 +1260,6 @@ static void tcg_liveness_analysis(TCGContext *s) } /* input args are live */ - dead_args = 0; for(i = nb_oargs; i < nb_iargs + nb_oargs; i++) { arg = args[i]; if (arg != TCG_CALL_DUMMY_ARG) { @@ -1313,8 +1316,12 @@ static void tcg_liveness_analysis(TCGContext *s) do_not_remove: /* output args are dead */ + dead_args = 0; for(i = 0; i < nb_oargs; i++) { arg = args[i]; + if (dead_temps[arg]) { + dead_args |= (1 << i); + } dead_temps[arg] = 1; } @@ -1327,7 +1334,6 @@ static void tcg_liveness_analysis(TCGContext *s) } /* input args are live */ - dead_args = 0; for(i = nb_oargs; i < nb_oargs + nb_iargs; i++) { arg = args[i]; if (dead_temps[arg]) {