From patchwork Tue Oct 3 18:30:45 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 728811 Delivered-To: patch@linaro.org Received: by 2002:a5d:60c8:0:b0:31d:da82:a3b4 with SMTP id x8csp2285808wrt; Tue, 3 Oct 2023 11:33:16 -0700 (PDT) X-Google-Smtp-Source: AGHT+IH+7iCeQ2dF4fg4EOyEChzx0Kq8TnCrIjXi3+AUiPprAr9ltdieOuzkggCtCblNGXnbkGQI X-Received: by 2002:a0c:b250:0:b0:658:a108:574c with SMTP id k16-20020a0cb250000000b00658a108574cmr179767qve.3.1696357996341; Tue, 03 Oct 2023 11:33:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696357996; cv=none; d=google.com; s=arc-20160816; b=SOdct70Sk0OUzPOsoxjFanziSkEanmcYme6R+w5atBQHcXjluqW9OMpY45Dtf/rhlL kOg7ZCyt1cRGNtzBAk8YeZZEwJ7ll3OP37cfgrmd9rGeHriRuiwt4UVI5B6UAGgaTXWJ eYCCE3dlN9M/QmF43YRuc2y6LK96yGzyJj/Bvas5T6B57uHI8dJMjEP5WtE09h0Eq2ae LqvYg0yPViIJhefmbPJMuYXeAUIcucxHLoe34h0xQrsQyoQOxMnsyBq4WCPKY3zFGGCs kJkPtwpp4rQuM9JIOcs5nuJXW91lCzwoyMGGCax7oVFxZGLHs5UN38k+8xsm3QggEO2H ekZg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=6qLsUwKkMfH3SdTbz6XhvzJrYIqkyqmV5ZdXlf3DNHM=; fh=JxWBtSZstwhZxj1nqbhkYnE1e7Ds6gYyoAtro8tkvc0=; b=YnGP1f4vIdrWvveAT19Psjrxs72wqG/dPvyo9GSIz096L6Iczbn/LbB7PVOSoybmwU Bh2X0oJyHyyJqo76HBIaifToQHEzm0uXYiB2a2L7PqwA7llqICPZZ9JqtGHSAgOX40uQ fYPaEA5NKrwGOhNpk4cAabOdOpLRmNZGFQ2uwlpnyxPScOqaIPil3QdFNrYs41Evp+nx hkKaYVJk5WEUwJgY/orezkoP9R0i03hAmxx0gZby8oKtQod7YnnQU2ZUPH0HlQ45wYul +vilpE7xarnsgACbObliJSgTHhp/yxtTbNdn2h6JSTXu6MON0YQRYCg9tQ4wvEQJs7in TbsQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=VTkaiEeO; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id u21-20020a0cb415000000b0064f3f53bca5si758085qve.119.2023.10.03.11.33.16 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 03 Oct 2023 11:33:16 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=VTkaiEeO; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qnkAq-00083m-M2; Tue, 03 Oct 2023 14:31:12 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qnkAm-0007xX-G9 for qemu-devel@nongnu.org; Tue, 03 Oct 2023 14:31:08 -0400 Received: from mail-pl1-x631.google.com ([2607:f8b0:4864:20::631]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qnkAi-0001eL-PX for qemu-devel@nongnu.org; Tue, 03 Oct 2023 14:31:08 -0400 Received: by mail-pl1-x631.google.com with SMTP id d9443c01a7336-1c3f97f2239so10079505ad.0 for ; Tue, 03 Oct 2023 11:31:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1696357862; x=1696962662; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=6qLsUwKkMfH3SdTbz6XhvzJrYIqkyqmV5ZdXlf3DNHM=; b=VTkaiEeOe+GiTMMXkxsJdljGfWgqtaUnipVYLl/jvQZrwTZKJ0fPQumwwcg5//XTT/ XUvXcvXfZHfYlU6mSPV+xEolDX28j1OAHFo+IcIkUxAjs8t3o3OBQpJZQOq6Hl4FSbpA MS2Q88yTGBWhseh7xyxHklydDYtmEJdV6W+kO2aXD8wanzJBdMbgHyt5Rtym4IT4DxXJ ZayaY3ikOqbJcLCBXsla5itW5ZytYf3hIclWFsDorA0qtpZH2n6KS6SaIUKGo95Vmv7w OgX9Gd28Gk3LkXxcZ77jwyR8CO69vmPj2t/gx/MEkK3lDDO6wmFF26P/roGt36NGbJGi 2aKg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696357862; x=1696962662; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=6qLsUwKkMfH3SdTbz6XhvzJrYIqkyqmV5ZdXlf3DNHM=; b=L43IZGOd8mDODBPfb5MG1vNyWU/wSnbU/RgBXS63nVFdPRnxSnhLX/svOcy1XoeqWi mpfxPmXZDsOad1n/iWIseELPuOWpxmrLadouj7sGIdoLw7GKn+2+ZXUI7OM6Qwk7ZMtx 3Xw+6fuxEMxiQ/FuNSX2neJIb+z9+krfU34lEl5N8APQh7Fu2h/xjXABo4cZrI4ET+2y Q6wGE6F6qDqTwjVBjpkG4x5nM/k+htvhT9NU2wqCU/OMe4POohVeYsyvpy5vvewOd+Sk 9OrADfImTHCTGBGfzpA7cMKIFofTG68az74O+vI5+18lfZ3Ku2cgZleAdSA29RLeUxwb xHlw== X-Gm-Message-State: AOJu0YyDwnnLvWHqiXXa8HV4L295P6bVPrUcKuZjgHY5zKrLKU/MtPPf k4aBFOUG5coCzC63/jscw1jZyxNO+wtUvKuPB4M= X-Received: by 2002:a17:902:cec4:b0:1bb:ce4a:5893 with SMTP id d4-20020a170902cec400b001bbce4a5893mr433536plg.30.1696357862370; Tue, 03 Oct 2023 11:31:02 -0700 (PDT) Received: from stoup.. ([71.212.149.95]) by smtp.gmail.com with ESMTPSA id g7-20020a170902934700b001b7cbc5871csm1920432plp.53.2023.10.03.11.31.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 03 Oct 2023 11:31:01 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: fei2.wu@intel.com Subject: [PATCH v17 03/16] tcg: Record nb_deleted_ops in TCGContext Date: Tue, 3 Oct 2023 11:30:45 -0700 Message-Id: <20231003183058.1639121-4-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231003183058.1639121-1-richard.henderson@linaro.org> References: <20231003183058.1639121-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::631; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x631.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org Record the number of ops that are removed during optimization. To be copied into TBStatistics when desired. Signed-off-by: Richard Henderson Reviewed-by: Alex Bennée --- include/tcg/tcg.h | 1 + tcg/tcg.c | 2 ++ 2 files changed, 3 insertions(+) diff --git a/include/tcg/tcg.h b/include/tcg/tcg.h index e49574b7c7..d60349878f 100644 --- a/include/tcg/tcg.h +++ b/include/tcg/tcg.h @@ -566,6 +566,7 @@ struct TCGContext { /* Used by TBStatistics */ int orig_nb_ops; + int nb_deleted_ops; /* Exit to translator on overflow. */ sigjmp_buf jmp_trans; diff --git a/tcg/tcg.c b/tcg/tcg.c index e90b0a0c69..60be2f429c 100644 --- a/tcg/tcg.c +++ b/tcg/tcg.c @@ -1494,6 +1494,7 @@ void tcg_func_start(TCGContext *s) s->nb_ops = 0; s->nb_labels = 0; + s->nb_deleted_ops = 0; s->current_frame_offset = s->frame_start; #ifdef CONFIG_DEBUG_TCG @@ -3049,6 +3050,7 @@ void tcg_op_remove(TCGContext *s, TCGOp *op) QTAILQ_REMOVE(&s->ops, op, link); QTAILQ_INSERT_TAIL(&s->free_ops, op, link); s->nb_ops--; + s->nb_deleted_ops++; } void tcg_remove_ops_after(TCGOp *op)