From nobody Fri Dec 19 20:11:30 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 (208.118.235.17 [208.118.235.17]) by mx.zohomail.com with SMTPS id 1543384198935350.12203746807495; Tue, 27 Nov 2018 21:49:58 -0800 (PST) Received: from localhost ([::1]:46080 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gRsjH-0005sU-JK for importer@patchew.org; Wed, 28 Nov 2018 00:49:43 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47981) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gRsYl-000413-R7 for qemu-devel@nongnu.org; Wed, 28 Nov 2018 00:38:53 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gRsYk-0004OW-6J for qemu-devel@nongnu.org; Wed, 28 Nov 2018 00:38:51 -0500 Received: from mail-pl1-x642.google.com ([2607:f8b0:4864:20::642]:36434) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gRsYj-0004NP-V1 for qemu-devel@nongnu.org; Wed, 28 Nov 2018 00:38:50 -0500 Received: by mail-pl1-x642.google.com with SMTP id g9so4345340plo.3 for ; Tue, 27 Nov 2018 21:38:49 -0800 (PST) Received: from cloudburst.twiddle.net (97-113-170-180.tukw.qwest.net. [97.113.170.180]) by smtp.gmail.com with ESMTPSA id 19sm8569336pfs.108.2018.11.27.21.38.47 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 27 Nov 2018 21:38:48 -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=RayPqtg1GIUBRZB3Wq/kgllr6OtflLAyLXeqe+v2dG4=; b=eWKc5nDPv0WFDIGnFs8CHIhI0TBx8nkNsZuRE3Z0V2/rFKBDJd/RcZnUBw/Y8xm0wX N/vATD/mGaON9kpe3Qm1xNAf/pO4wm7zYo9C3xnnj2lgj84YCo14VbGU1wLByovAghhc PT+LDn89IJcTtsqlEnkcc0F/NX+2YZMOE1eQ8= 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=RayPqtg1GIUBRZB3Wq/kgllr6OtflLAyLXeqe+v2dG4=; b=N52ATB3IS6X5CtmM4wTouTdgX72k+Lkuac5+th0L6i4P62DxHrtFepBtCJntjO0p2C WnoSJsGOGJ/TKMYcuDNiaB5B04LN8/c02xvs4JFQEzAafH/Ceq/yAJjSMVaG9TlNtVR1 KpjQLMpk32ULj2tCpcUgnD56sZnLE0TnF7GXGETiG1L3nAM0IhvyPz2Q74jooWogofC6 JZfkYH6PzGOdIdKdwoyd5iukqjYfA/X/ebxzHndm8+G9rQiEy5DCSBYU3SBzqofqet6B cIYzgxPgMf4MXTuI1/13aqBs2dVRLJfSRqCFJQTpg/qR5DevBwV6xuqnCplVOQIlv31J PKoA== X-Gm-Message-State: AA+aEWbj7X9KXoZeCjNmhHwpB6P/r+lBxnYMhPBYcL+ty5LsCjC8HvJE HkeVnxxgTFDZkgWbVVPMECWaIgCOHWk= X-Google-Smtp-Source: AFSGD/UQBKYTHxCHpmldxXGVUV+zXxb4VR8amUn4+TGPIY3h5zMdDRlHLC4Blvh4ewehRlu9jZZy0Q== X-Received: by 2002:a17:902:714c:: with SMTP id u12mr35141985plm.234.1543383528635; Tue, 27 Nov 2018 21:38:48 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Date: Tue, 27 Nov 2018 21:38:32 -0800 Message-Id: <20181128053834.10861-11-richard.henderson@linaro.org> X-Mailer: git-send-email 2.17.2 In-Reply-To: <20181128053834.10861-1-richard.henderson@linaro.org> References: <20181128053834.10861-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::642 Subject: [Qemu-devel] [PATCH 10/12] 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: cota@braap.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" 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 27814df882..21668831a1 100644 --- a/tcg/tcg.c +++ b/tcg/tcg.c @@ -2417,6 +2417,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. */ @@ -2472,15 +2492,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 */ @@ -2623,10 +2637,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