From nobody Thu Oct 2 10:17:55 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 154577300166591.63341250190194; Tue, 25 Dec 2018 13:23:21 -0800 (PST) Received: from localhost ([127.0.0.1]:43266 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gbuAU-00058k-80 for importer@patchew.org; Tue, 25 Dec 2018 16:23:14 -0500 Received: from eggs.gnu.org ([208.118.235.92]:50952) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gbtoD-0000Oj-Ux for qemu-devel@nongnu.org; Tue, 25 Dec 2018 16:00:17 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gbtoB-00029x-Sw for qemu-devel@nongnu.org; Tue, 25 Dec 2018 16:00:13 -0500 Received: from mail-pg1-x536.google.com ([2607:f8b0:4864:20::536]:36700) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gbto9-00023z-Sv for qemu-devel@nongnu.org; Tue, 25 Dec 2018 16:00:10 -0500 Received: by mail-pg1-x536.google.com with SMTP id n2so6828510pgm.3 for ; Tue, 25 Dec 2018 13:00:08 -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.13.00.03 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 25 Dec 2018 13:00:06 -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=W3MJU8k1INx2eAZ6THgZjlhnFYT7Ou+CT2Ez8PjoyT4=; b=afqlab+qp4RvAkdhFMqbqS8KdTYXqgwENsGRFGO4efD4x3Sl8KwJL0MnyIxcbjpMT5 m+MDFojsa2E0tHgZtJfNzAnXf7rU5yq4Hr+w1li7i+EhPGqMChPZXmCEVptPznyd2yDb W3UWONhnD7+edDn6vLYO4b/HijiHZaRnVp4ME= 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=W3MJU8k1INx2eAZ6THgZjlhnFYT7Ou+CT2Ez8PjoyT4=; b=fLAkelIoC9f6G3EK/JfHIzwHTOG270h/g2tVLHHoFgsKlt2SvTRAoSI7csjJErnbwy 2ULanDIJVZ6jNn1+fP6ABFEfZlGhxhdA1QhL6B+tzLmVmtVJRNuI6RYizjInsYUz3OMl um4fuwn9HjbLUOuMZf+G+HMm/cuttKJ0mmpwobg1alXsWnZLvKFKdhwFX3NeLzvtvovO RkaQeq2CWeEzcdZscK+AF0l868U7TBMNBP6gg3HJBJSOOBLsOg4dN9gZWekMV//C15lR cA+kqsHpanlGFpu8ZEFI4p4ohFVoSRN/O/c89QILMQRNrhEJSGv/j2qf70H0mAnrnln2 bA2w== X-Gm-Message-State: AJcUuket8hobMmYJ4BRy8rFil/u6Mlc6R0RnUQ5BoF3sBI7N7NacqA1I TvkuZNf3Pi+3zhwpDbZX9BY6NSif2Yk= X-Google-Smtp-Source: ALg8bN79yugMDfFbvbNPRB2MDa6fjqUulYdQolU44toe5gSHk/i2LwpUHIm8p3Jc3slVgsYajW6d7w== X-Received: by 2002:a63:dd15:: with SMTP id t21mr16085271pgg.347.1545771607648; Tue, 25 Dec 2018 13:00:07 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Date: Wed, 26 Dec 2018 07:55:27 +1100 Message-Id: <20181225205529.10874-41-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::536 Subject: [Qemu-devel] [PULL 40/42] tcg: Add TCG_OPF_BB_EXIT 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" Use this to notice the opcodes that exit the TB, which implies that local temps are really dead and need not be synced. Previously we so marked the true end of the TB, but that was immediately overwritten by the la_bb_end invoked by any TCG_OPF_BB_END opcode, like exit_tb. Reviewed-by: Emilio G. Cota Signed-off-by: Richard Henderson --- tcg/tcg-opc.h | 7 ++++--- tcg/tcg.h | 14 ++++++++------ tcg/tcg.c | 5 ++++- 3 files changed, 16 insertions(+), 10 deletions(-) diff --git a/tcg/tcg-opc.h b/tcg/tcg-opc.h index e3a43aabb6..7a8a3edb5b 100644 --- a/tcg/tcg-opc.h +++ b/tcg/tcg-opc.h @@ -191,9 +191,10 @@ DEF(mulsh_i64, 1, 2, 0, IMPL64 | IMPL(TCG_TARGET_HAS_m= ulsh_i64)) /* QEMU specific */ DEF(insn_start, 0, 0, TLADDR_ARGS * TARGET_INSN_START_WORDS, TCG_OPF_NOT_PRESENT) -DEF(exit_tb, 0, 0, 1, TCG_OPF_BB_END) -DEF(goto_tb, 0, 0, 1, TCG_OPF_BB_END) -DEF(goto_ptr, 0, 1, 0, TCG_OPF_BB_END | IMPL(TCG_TARGET_HAS_goto_ptr)) +DEF(exit_tb, 0, 0, 1, TCG_OPF_BB_EXIT | TCG_OPF_BB_END) +DEF(goto_tb, 0, 0, 1, TCG_OPF_BB_EXIT | TCG_OPF_BB_END) +DEF(goto_ptr, 0, 1, 0, + TCG_OPF_BB_EXIT | TCG_OPF_BB_END | IMPL(TCG_TARGET_HAS_goto_ptr)) =20 DEF(qemu_ld_i32, 1, TLADDR_ARGS, 1, TCG_OPF_CALL_CLOBBER | TCG_OPF_SIDE_EFFECTS) diff --git a/tcg/tcg.h b/tcg/tcg.h index 5e5cf686a3..3a629991ca 100644 --- a/tcg/tcg.h +++ b/tcg/tcg.h @@ -1030,20 +1030,22 @@ typedef struct TCGArgConstraint { =20 /* Bits for TCGOpDef->flags, 8 bits available. */ enum { + /* Instruction exits the translation block. */ + TCG_OPF_BB_EXIT =3D 0x01, /* Instruction defines the end of a basic block. */ - TCG_OPF_BB_END =3D 0x01, + TCG_OPF_BB_END =3D 0x02, /* Instruction clobbers call registers and potentially update globals.= */ - TCG_OPF_CALL_CLOBBER =3D 0x02, + TCG_OPF_CALL_CLOBBER =3D 0x04, /* Instruction has side effects: it cannot be removed if its outputs are not used, and might trigger exceptions. */ - TCG_OPF_SIDE_EFFECTS =3D 0x04, + TCG_OPF_SIDE_EFFECTS =3D 0x08, /* Instruction operands are 64-bits (otherwise 32-bits). */ - TCG_OPF_64BIT =3D 0x08, + TCG_OPF_64BIT =3D 0x10, /* Instruction is optional and not implemented by the host, or insn is generic and should not be implemened by the host. */ - TCG_OPF_NOT_PRESENT =3D 0x10, + TCG_OPF_NOT_PRESENT =3D 0x20, /* Instruction operands are vectors. */ - TCG_OPF_VECTOR =3D 0x20, + TCG_OPF_VECTOR =3D 0x40, }; =20 typedef struct TCGOpDef { diff --git a/tcg/tcg.c b/tcg/tcg.c index 4f0acf8863..d40edb4f57 100644 --- a/tcg/tcg.c +++ b/tcg/tcg.c @@ -2424,6 +2424,7 @@ static void liveness_pass_1(TCGContext *s) int nb_temps =3D s->nb_temps; TCGOp *op, *op_prev; =20 + /* ??? Should be redundant with the exit_tb that ends the TB. */ la_func_end(s, nb_globals, nb_temps); =20 QTAILQ_FOREACH_REVERSE_SAFE(op, &s->ops, TCGOpHead, link, op_prev) { @@ -2612,7 +2613,9 @@ static void liveness_pass_1(TCGContext *s) } =20 /* if end of basic block, update */ - if (def->flags & TCG_OPF_BB_END) { + if (def->flags & TCG_OPF_BB_EXIT) { + la_func_end(s, nb_globals, nb_temps); + } else if (def->flags & TCG_OPF_BB_END) { la_bb_end(s, nb_globals, nb_temps); } else if (def->flags & TCG_OPF_SIDE_EFFECTS) { la_global_sync(s, nb_globals); --=20 2.17.2