From nobody Fri Dec 19 20:11:56 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 1543384306723857.5312023281391; Tue, 27 Nov 2018 21:51:46 -0800 (PST) Received: from localhost ([::1]:46090 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gRslF-00074T-Q6 for importer@patchew.org; Wed, 28 Nov 2018 00:51:45 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47987) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gRsYl-000417-Rk 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 1gRsYi-0004MV-Ho for qemu-devel@nongnu.org; Wed, 28 Nov 2018 00:38:51 -0500 Received: from mail-pf1-x436.google.com ([2607:f8b0:4864:20::436]:44339) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gRsYg-0004Ku-GE for qemu-devel@nongnu.org; Wed, 28 Nov 2018 00:38:48 -0500 Received: by mail-pf1-x436.google.com with SMTP id u6so9604940pfh.11 for ; Tue, 27 Nov 2018 21:38:46 -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.43 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 27 Nov 2018 21:38:44 -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=9Nkiz5fyuMiuIUbBYyWxbD6vyp9rjrtKS8bXxw2aqDU=; b=aWkLvOE9ff6PqWicV/DFhaEzMfuwCsFWojA7kPo0Um63j4ki7snNW8ybEPrTE1DnTA ycas+f/eviIJfMXTdy2DnHZF8JHozbseQhdIDljzNKpSrAZZIc4Jmg+UiWjiKLW8hybo 0WrC0mkRiTxQEmpNIuwnThJgwSRSsLPT4r/SI= 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=9Nkiz5fyuMiuIUbBYyWxbD6vyp9rjrtKS8bXxw2aqDU=; b=q24WOsJFomFn/qqkXh/SkEBtqPg9E01LBbD2Bt2djqNgiPYCeGR8Xx99PGZbbROP7a fMLujQ1XqEqRpa0xIwCceht1ZXS76oBH8LZ/iwkShh+etJ1XnAYl+0p5gfR2qPxG7uOn d9xiO+K9r9BmpoZmLiqF2EIIsGiAifEPAQv70FBG59liYJ/ca/R8OfE3K+n/lfXRi561 HtWNH6xa30b4O46170Nf2zs0BzZ6mivV8SELYoca7YG4DzVhLAwxFXrgOfCSCI+udyPd dYXnq5ggXSrtcTHHc6EcFzOrwl/HPime1xSufP1PWTVeuHU7uQ0bF++qqh7reM58bhAK CEYQ== X-Gm-Message-State: AA+aEWaHa/Esr2XiylHGyJ4ElDOFBQW0uKSEwMBE2tp+bOTZovH/O2xX OJqBJP8xKuLVyCg4n7lGRxvDh9prKNM= X-Google-Smtp-Source: AJdET5cb8X+OfgzsJTyxP2no8d7KO8wrzM25iHsmQvQFclIkcFVV8oSNLEjeDy6SChQkxmPlrS95Uw== X-Received: by 2002:a63:f141:: with SMTP id o1mr32379516pgk.134.1543383524930; Tue, 27 Nov 2018 21:38:44 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Date: Tue, 27 Nov 2018 21:38:29 -0800 Message-Id: <20181128053834.10861-8-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::436 Subject: [Qemu-devel] [PATCH 07/12] tcg: Dump register preference info with liveness 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.h | 3 --- tcg/tcg.c | 44 +++++++++++++++++++++++++++++++++++++------- 2 files changed, 37 insertions(+), 10 deletions(-) diff --git a/tcg/tcg.h b/tcg/tcg.h index b2e274b7af..ac5d01c223 100644 --- a/tcg/tcg.h +++ b/tcg/tcg.h @@ -1089,9 +1089,6 @@ TCGOp *tcg_op_insert_after(TCGContext *s, TCGOp *op, = TCGOpcode opc, int narg); =20 void tcg_optimize(TCGContext *s); =20 -/* only used for debugging purposes */ -void tcg_dump_ops(TCGContext *s); - TCGv_i32 tcg_const_i32(int32_t val); TCGv_i64 tcg_const_i64(int64_t val); TCGv_i32 tcg_const_local_i32(int32_t val); diff --git a/tcg/tcg.c b/tcg/tcg.c index adf6570c36..27d081e11a 100644 --- a/tcg/tcg.c +++ b/tcg/tcg.c @@ -1921,7 +1921,7 @@ static inline TCGReg tcg_regset_first(TCGRegSet d) } } =20 -void tcg_dump_ops(TCGContext *s) +static void tcg_dump_ops(TCGContext *s, bool have_prefs) { char buf[128]; TCGOp *op; @@ -2056,12 +2056,15 @@ void tcg_dump_ops(TCGContext *s) col +=3D qemu_log("%s$0x%" TCG_PRIlx, k ? "," : "", op->ar= gs[k]); } } - if (op->life) { - unsigned life =3D op->life; =20 - for (; col < 48; ++col) { + if (have_prefs || op->life) { + for (; col < 40; ++col) { putc(' ', qemu_logfile); } + } + + if (op->life) { + unsigned life =3D op->life; =20 if (life & (SYNC_ARG * 3)) { qemu_log(" sync:"); @@ -2081,6 +2084,33 @@ void tcg_dump_ops(TCGContext *s) } } } + + if (have_prefs) { + for (i =3D 0; i < nb_oargs; ++i) { + TCGRegSet set =3D op->output_pref[i]; + + if (i =3D=3D 0) { + qemu_log(" pref=3D"); + } else { + qemu_log(","); + } + if (set =3D=3D 0) { + qemu_log("none"); + } else if (set =3D=3D MAKE_64BIT_MASK(0, TCG_TARGET_NB_REG= S)) { + qemu_log("all"); +#ifdef CONFIG_DEBUG_TCG + } else if (tcg_regset_single(set)) { + TCGReg reg =3D tcg_regset_first(set); + qemu_log("%s", tcg_target_reg_names[reg]); +#endif + } else if (TCG_TARGET_NB_REGS <=3D 32) { + qemu_log("%#x", (uint32_t)set); + } else { + qemu_log("%#" PRIx64, (uint64_t)set); + } + } + } + qemu_log("\n"); } } @@ -3669,7 +3699,7 @@ int tcg_gen_code(TCGContext *s, TranslationBlock *tb) && qemu_log_in_addr_range(tb->pc))) { qemu_log_lock(); qemu_log("OP:\n"); - tcg_dump_ops(s); + tcg_dump_ops(s, false); qemu_log("\n"); qemu_log_unlock(); } @@ -3697,7 +3727,7 @@ int tcg_gen_code(TCGContext *s, TranslationBlock *tb) && qemu_log_in_addr_range(tb->pc))) { qemu_log_lock(); qemu_log("OP before indirect lowering:\n"); - tcg_dump_ops(s); + tcg_dump_ops(s, false); qemu_log("\n"); qemu_log_unlock(); } @@ -3718,7 +3748,7 @@ int tcg_gen_code(TCGContext *s, TranslationBlock *tb) && qemu_log_in_addr_range(tb->pc))) { qemu_log_lock(); qemu_log("OP after optimization and liveness analysis:\n"); - tcg_dump_ops(s); + tcg_dump_ops(s, true); qemu_log("\n"); qemu_log_unlock(); } --=20 2.17.2