From patchwork Wed Oct 4 08:01:56 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Michael Tokarev X-Patchwork-Id: 729248 Delivered-To: patch@linaro.org Received: by 2002:a5d:4a4e:0:b0:31d:da82:a3b4 with SMTP id v14csp220257wrs; Wed, 4 Oct 2023 01:08:39 -0700 (PDT) X-Google-Smtp-Source: AGHT+IF62or3nMIMvqfwUFhvtt93OAmb0XvyiIzKZ5jd2DBuFFF/ued4i2QiXyF7jTkwDXj99Sr7 X-Received: by 2002:ac8:5b8e:0:b0:418:1edd:d2ed with SMTP id a14-20020ac85b8e000000b004181eddd2edmr1810151qta.4.1696406919266; Wed, 04 Oct 2023 01:08:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696406919; cv=none; d=google.com; s=arc-20160816; b=x++xy5Az9A0p+kDGDbiQYIUJG9Hk0WCRPFzsCdp/LtI+F8x73mXu4W8iKDvR9V3+Py 7EgQqSq7wPZjx8dPcfzxwqH70MY2bWWBaBxm80WBaTr64cFkNPutqzHORrFJ1Ue3L+2Q NyC3MD89s/2mU5rMLpKORaw+OtBUU2N57moX5P+Bq00+vyG1PlJ0S+OeBCIrpORW5nCe 8H0BpnjaCyL9+wfiwySwQOWJfG0iBU7eeu84PKKw3yos9sbVsVrbzzthOXljhj+eI7Hh PRiTk9qAhUqQwGMOQ0E5t1ghGMGPEQPH9Y4ErpCMmDNud1Aa6vguynbssC2Xnziv/av8 0+tg== 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; bh=812MlhQtSCw+1HpS4f9x/O30yjwMPNetUL0YHONIgl8=; fh=K4abbxCgZAPvqzOXA+PZ7RIZh+KufMVJze7rXLOwES0=; b=CfbPFecSccVyQn1Y7IrqxrqBFK0sCW5onCpSf+4Nh6rOxeZKJBSMNUtd3gUsdAtG+h qLR/JnQNe599WuSFupoNTRrUR1IAN3CjBJmFxFlmdFUIB5A7gFlAa7NmOXRepeV49AxZ ab6rt7awJuTqv4H81gt2Sy52OKXRKAQpTv5/oFySZiOj/AnXutKyKXIFWdARYg3wPeOX L1vON5MhZXYy2JDfwndA6uEoJ30eMNcdCUtNko0+N9yXy40Ju9efFXLTbRemDA4lP9oT TyMXF6EN+OiUsGa56go8EjUnVE0XHa4VZznHCikQtF79jf1hC6EawQ7vGj0QC5UA1B3y Fnhg== ARC-Authentication-Results: i=1; mx.google.com; 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" Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id o19-20020a05622a045300b00417afb934casi1301687qtx.683.2023.10.04.01.08.39 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 04 Oct 2023 01:08:39 -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; 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" Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qnwu0-00067d-Mc; Wed, 04 Oct 2023 04:06:42 -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 1qnwt7-0005iU-I9; Wed, 04 Oct 2023 04:05:48 -0400 Received: from isrv.corpit.ru ([86.62.121.231]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qnwt3-0002le-38; Wed, 04 Oct 2023 04:05:43 -0400 Received: from tsrv.corpit.ru (tsrv.tls.msk.ru [192.168.177.2]) by isrv.corpit.ru (Postfix) with ESMTP id 01B05275AF; Wed, 4 Oct 2023 11:02:30 +0300 (MSK) Received: from tls.msk.ru (mjt.wg.tls.msk.ru [192.168.177.130]) by tsrv.corpit.ru (Postfix) with SMTP id 5CC972CBE9; Wed, 4 Oct 2023 11:02:29 +0300 (MSK) Received: (nullmailer pid 2702856 invoked by uid 1000); Wed, 04 Oct 2023 08:02:21 -0000 From: Michael Tokarev To: qemu-devel@nongnu.org Cc: qemu-stable@nongnu.org, Richard Henderson , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Michael Tokarev Subject: [Stable-8.1.2 35/45] accel/tcg: Avoid load of icount_decr if unused Date: Wed, 4 Oct 2023 11:01:56 +0300 Message-Id: <20231004080221.2702636-35-mjt@tls.msk.ru> X-Mailer: git-send-email 2.39.2 In-Reply-To: References: MIME-Version: 1.0 Received-SPF: pass client-ip=86.62.121.231; envelope-from=mjt@tls.msk.ru; helo=isrv.corpit.ru X-Spam_score_int: -68 X-Spam_score: -6.9 X-Spam_bar: ------ X-Spam_report: (-6.9 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_HI=-5, 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 From: Richard Henderson With CF_NOIRQ and without !CF_USE_ICOUNT, the load isn't used. Avoid emitting it. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson (cherry picked from commit f47a90dacca8f74210a2675bdde7ab3856872b94) Signed-off-by: Michael Tokarev 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) { /*