From patchwork Thu Sep 14 17:44:31 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 722573 Delivered-To: patch@linaro.org Received: by 2002:adf:f0d1:0:b0:31d:da82:a3b4 with SMTP id x17csp527480wro; Thu, 14 Sep 2023 10:45:29 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHe/tR134e3S8I3yVm6u6iHdEg3855tHv+MISwenp05TGkyC8rpNFBmA8D13BXAmwiZ9u42 X-Received: by 2002:a05:620a:1987:b0:76c:c601:367f with SMTP id bm7-20020a05620a198700b0076cc601367fmr6868826qkb.36.1694713529212; Thu, 14 Sep 2023 10:45:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1694713529; cv=none; d=google.com; s=arc-20160816; b=UTmbtqxa0W5WiU8bZnkgx69uKT5UBnqgWbmvhabI/aR3psUOZvuFEwOqyv+GY66st1 lGXbkAjnDBSO6iYyNtL0mLuejVf6tKK5I0kXwooGD77MSaWE5N65xSS811RvKcAy1WVZ +XHCK2X/5QaE9GbcRM2Yl1f3vd7bz/+zuTxhCwFcRbOvqZqbCMxRh569eG3i7BaO7f5C zT1wnBtiZIf0kETiefLaNGrfMpBP9BxLatkDUAL9zJcSNSWAwdxaq2HZu5KZxJrLld51 sqBMUR07wsvIgDHB7A4LBlEL9PTXenZiHCst3Sc3yE7iVt5WMhygKhYd7lYgQC+K3PBt Wxdw== 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=cb3D6IYlr6FrNnYuqfFzbMBO24dvl8EEYuTIpJQPqlk=; fh=ycigHkwOPieh2u5PmcA89sNk/qPD1ZkdDlL8Mchfvw8=; b=FsH3xIWDU5IBf7TtyvGGUt26Qgyi6y4AhxGREbMnUpv1nQU0SJCRiCKYYFh0kGILFn lDGzWYIIM9K4WuyV4KjiXgp0nor5EQu4uTe1uTn8vyPU6J2ZaM3Ks1TDcpbyybh0MVZw jzgcJ8z+Y19rDvlNgUUHy7Cnpd561WZNJkqB9YmbO2WI1r8ymjCVC83s8BIVTEDejyXL 4TlnOLi7nKAgFE4FzdlULEzRyMF5h6jW7yLUih9+Sq9jUJHvZsYjVruZNvMvvNKhNi0V hhn2lIkp7D7kdUo8vKgfCK3sXKrUM8e2zzE5DW/vrSt4qFzXcXBUMdLBPV5GUR+Um+ne AjTA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=la3VoVzm; 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 f9-20020ac87f09000000b00413613e4d4dsi1261113qtk.218.2023.09.14.10.45.29 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 14 Sep 2023 10:45:29 -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=la3VoVzm; 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 1qgqOR-0000d0-Un; Thu, 14 Sep 2023 13:44:44 -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 1qgqOQ-0000bj-1P for qemu-devel@nongnu.org; Thu, 14 Sep 2023 13:44:42 -0400 Received: from mail-pf1-x434.google.com ([2607:f8b0:4864:20::434]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qgqOO-0006yf-6b for qemu-devel@nongnu.org; Thu, 14 Sep 2023 13:44:41 -0400 Received: by mail-pf1-x434.google.com with SMTP id d2e1a72fcca58-68fb6fd2836so1106112b3a.0 for ; Thu, 14 Sep 2023 10:44:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1694713478; x=1695318278; 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=cb3D6IYlr6FrNnYuqfFzbMBO24dvl8EEYuTIpJQPqlk=; b=la3VoVzmanelI08fi9wr2QWMmRfqryf0RoUTGFnplj9pmEd8A1ygTjWAIIP/2xxmuJ M51icUZ3jrVN5BWm2aj5TZd8VhDAS9ovq5eF0cvghilTFFfad6eC66aNyVjo410tYmfQ CllDqO0Ow7EUlt+SPzCYSdfOQpR5j3NNislhjmkEQuFaacRPUD+bY+iUc9Ji7BU2fbfB Cxa+eSGzKvPIZY1WfMECUnQLLaOfSaCMtHEhkZB3x98KwjyqfoUIe/ZNxSCRYNpDDjah /8iCis0YinIR9SCZIA5CQS3hqrHtrVVkwsvhgTTVoTbrBqF6p9g/NDPMxv9sLt7k1zko d8/A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1694713478; x=1695318278; 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=cb3D6IYlr6FrNnYuqfFzbMBO24dvl8EEYuTIpJQPqlk=; b=cPxbC2C4fBfck6CRgdN8NkQSR56FfkP2zJUW06p3qw/KimecsYz0ELHTGH/3SpD8cT iROFmAdYSVx5bn6VB62olIp8zO3M7llu8pmBJnpkHGyRoCciB4Ke6jyVz+TCTCeDudUg lnuMt6Sk3HtXhfr1JolwKlwKOxQgKAFEfs9IoYNjPKuPoKDHAQr6msclTMPy/7d1GzqP AtY1DIr2Qi3x0LRLYTHrAPMzUicPsyImk5qMzpFm5w7UR0FWK5sGytPaCcwLbQqlNX7D lOFGtfg3wCa+37PbMKVtJc8Hia8Mk2aL4qZtueaL//YR18MRq0IQUlPftUhQyrS4F13t ixzQ== X-Gm-Message-State: AOJu0YzOkZBd5EScj0bh8RFuRQx3YuI5Jj5qwbpxGeWoSIX8OcFDNv2a 03W0NYpsUVGnnnuBSCkNUeFFhoTmDDXgdx2kQA0= X-Received: by 2002:a05:6a20:8e22:b0:158:7fdf:66df with SMTP id y34-20020a056a208e2200b001587fdf66dfmr6037635pzj.18.1694713478490; Thu, 14 Sep 2023 10:44:38 -0700 (PDT) Received: from stoup.. ([71.212.131.115]) by smtp.gmail.com with ESMTPSA id w17-20020aa78591000000b0068c5bd3c3b4sm1588933pfn.206.2023.09.14.10.44.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 14 Sep 2023 10:44:38 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: philmd@linaro.org Subject: [PATCH 1/6] accel/tcg: Avoid load of icount_decr if unused Date: Thu, 14 Sep 2023 10:44:31 -0700 Message-Id: <20230914174436.1597356-2-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230914174436.1597356-1-richard.henderson@linaro.org> References: <20230914174436.1597356-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::434; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x434.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 With CF_NOIRQ and without !CF_USE_ICOUNT, the load isn't used. Avoid emitting it. Signed-off-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daudé --- accel/tcg/translator.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/accel/tcg/translator.c b/accel/tcg/translator.c index 1a6a5448c8..a3983019a5 100644 --- a/accel/tcg/translator.c +++ b/accel/tcg/translator.c @@ -49,12 +49,15 @@ bool translator_io_start(DisasContextBase *db) static TCGOp *gen_tb_start(uint32_t cflags) { - TCGv_i32 count = tcg_temp_new_i32(); + TCGv_i32 count = NULL; TCGOp *icount_start_insn = NULL; - tcg_gen_ld_i32(count, cpu_env, - offsetof(ArchCPU, neg.icount_decr.u32) - - offsetof(ArchCPU, env)); + if ((cflags & CF_USE_ICOUNT) || !(cflags & CF_NOIRQ)) { + count = tcg_temp_new_i32(); + tcg_gen_ld_i32(count, cpu_env, + offsetof(ArchCPU, neg.icount_decr.u32) - + offsetof(ArchCPU, env)); + } if (cflags & CF_USE_ICOUNT) { /*