From nobody Thu Oct 2 10:14:01 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1545772803683672.1374103367112; Tue, 25 Dec 2018 13:20:03 -0800 (PST) Received: from localhost ([127.0.0.1]:43237 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gbu7K-0000mq-Rc for importer@patchew.org; Tue, 25 Dec 2018 16:19:58 -0500 Received: from eggs.gnu.org ([208.118.235.92]:50922) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gbto7-0000Bk-KQ for qemu-devel@nongnu.org; Tue, 25 Dec 2018 16:00:08 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gbto4-00020T-G3 for qemu-devel@nongnu.org; Tue, 25 Dec 2018 16:00:07 -0500 Received: from mail-pl1-x635.google.com ([2607:f8b0:4864:20::635]:40559) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gbto4-0001ze-AH for qemu-devel@nongnu.org; Tue, 25 Dec 2018 16:00:04 -0500 Received: by mail-pl1-x635.google.com with SMTP id u18so6803614plq.7 for ; Tue, 25 Dec 2018 13:00:04 -0800 (PST) Received: from cloudburst.home (c211-28-135-144.sunsh3.vic.optusnet.com.au. [211.28.135.144]) by smtp.gmail.com with ESMTPSA id t21sm48501628pgg.24.2018.12.25.12.59.58 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 25 Dec 2018 13:00:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=+PnTvLpWSGULHJfofTJ2nNNXUW59+5rdyU2Q/snqAIo=; b=hfYGRdM7dl3T/vXHwmoWjBKaHI+fQj5r9ZqOqaf5OECtfewmWocrtj6DcwVXq1XKia EHjYoek0VZuStXLbgsN7H/vjKmUAmnWzjxgqccqciN9EV9NjGVnxn//ffTCO88T4cpRO bpHOolTFrTaY3u2bdzalrhu+QUfq5urytXV2I= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=+PnTvLpWSGULHJfofTJ2nNNXUW59+5rdyU2Q/snqAIo=; b=X6+xHrzxSsEUdh1/NxnfcHv5LqRELch4pBohTutY2vz5zSe57rbapHHpiQ2bFkyKlk ArRRyVP/+dLctBfMlPLmYTyzi3JIIUs2+v0wdLhsE2c8XCZz0ZSvgDwwauQ98on9I/R3 xhwvi8KhQH7OHlfjf7wX4jwyfF+yj+f1451CpUuSAxQgBH2+wnoUMtVVNfXPgDaNWMTQ 6honJlNAPyVTthq7o0Afa/LKTU0vf4Dxn9QC6xYHE9R0V+yH/uDLbvRsFlGsXRtZ9yyX 3hl6ig1gq3Pgq4xRodKBUQB+1Us8bsCvUhu5s1XkAcwrj+0kYAC4jx/nu94tEMQ/f2Dj joCw== X-Gm-Message-State: AJcUukc7Gqrm/INV1NdwM2Ioux3GpJmbdgpFo4EkEJF5VR69vFZQerMk Ewk8SrgVTXk6P9O7CEp4jpEmZ6z+Hdc= X-Google-Smtp-Source: ALg8bN7TgaYS5HKnFiJMu1NF7h6k/izBEgqDsoijxqDCch4iuK+2YXsZ78vmppyf1GzcWzW20fPoFw== X-Received: by 2002:a17:902:d68c:: with SMTP id v12mr17289484ply.4.1545771602818; Tue, 25 Dec 2018 13:00:02 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Date: Wed, 26 Dec 2018 07:55:26 +1100 Message-Id: <20181225205529.10874-40-richard.henderson@linaro.org> X-Mailer: git-send-email 2.17.2 In-Reply-To: <20181225205529.10874-1-richard.henderson@linaro.org> References: <20181225205529.10874-1-richard.henderson@linaro.org> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::635 Subject: [Qemu-devel] [PULL 39/42] tcg: Split out more subroutines from liveness_pass_1 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: peter.maydell@linaro.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Reviewed-by: Emilio G. Cota Signed-off-by: Richard Henderson --- tcg/tcg.c | 35 +++++++++++++++++++++++------------ 1 file changed, 23 insertions(+), 12 deletions(-) diff --git a/tcg/tcg.c b/tcg/tcg.c index 0afc6ba1e6..4f0acf8863 100644 --- a/tcg/tcg.c +++ b/tcg/tcg.c @@ -2395,6 +2395,26 @@ static void la_bb_end(TCGContext *s, int ng, int nt) } } =20 +/* liveness analysis: sync globals back to memory. */ +static void la_global_sync(TCGContext *s, int ng) +{ + int i; + + for (i =3D 0; i < ng; ++i) { + s->temps[i].state |=3D TS_MEM; + } +} + +/* liveness analysis: sync globals back to memory and kill. */ +static void la_global_kill(TCGContext *s, int ng) +{ + int i; + + for (i =3D 0; i < ng; i++) { + s->temps[i].state =3D TS_DEAD | TS_MEM; + } +} + /* Liveness analysis : update the opc_arg_life array to tell if a given input arguments is dead. Instructions updating dead temporaries are removed. */ @@ -2450,15 +2470,9 @@ static void liveness_pass_1(TCGContext *s) =20 if (!(call_flags & (TCG_CALL_NO_WRITE_GLOBALS | TCG_CALL_NO_READ_GLOBALS))) { - /* globals should go back to memory */ - for (i =3D 0; i < nb_globals; i++) { - s->temps[i].state =3D TS_DEAD | TS_MEM; - } + la_global_kill(s, nb_globals); } else if (!(call_flags & TCG_CALL_NO_READ_GLOBALS)) { - /* globals should be synced to memory */ - for (i =3D 0; i < nb_globals; i++) { - s->temps[i].state |=3D TS_MEM; - } + la_global_sync(s, nb_globals); } =20 /* record arguments that die in this helper */ @@ -2601,10 +2615,7 @@ static void liveness_pass_1(TCGContext *s) if (def->flags & TCG_OPF_BB_END) { la_bb_end(s, nb_globals, nb_temps); } else if (def->flags & TCG_OPF_SIDE_EFFECTS) { - /* globals should be synced to memory */ - for (i =3D 0; i < nb_globals; i++) { - s->temps[i].state |=3D TS_MEM; - } + la_global_sync(s, nb_globals); } =20 /* record arguments that die in this opcode */ --=20 2.17.2