From patchwork Fri Oct 29 04:32:39 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 516388 Delivered-To: patch@linaro.org Received: by 2002:ad5:5208:0:0:0:0:0 with SMTP id p8csp393149iml; Thu, 28 Oct 2021 21:42:04 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwVm3jwug6RlbIdp5gAgpNcJJfJFTr1bi0OrHz2Xe5D+yWf/648M9Btjady+OrA5E4WunNT X-Received: by 2002:a9d:4114:: with SMTP id o20mr6695729ote.171.1635482524453; Thu, 28 Oct 2021 21:42:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1635482524; cv=none; d=google.com; s=arc-20160816; b=i6otyk4VWvZTGT7meOKmqQINh/S/+izjzS2EpUHNBOC+3u9Cc1XjfISVzOiae/Xj/a uvG/kgreUpFxvd44llMPf+8fnRnWQ10NNHCEBvTDfS18XkjPB8GPHlsGbc2xSDJcSI/l 7cGByS4tYFpow8QLkLIhTIJ5Epd7tNnnQblNarT2N4RRt7uHUvDRrnAPZZT3MdFkl1VF eqYP7KXpPOJvCcdct8W/jgVhPzOMt/VS7weOrIekdUBB058WJvDlcWE0LzsFNBQE/Yrw 1MA1dRwAyDcC/oHmPxTpwsz++mb2WRfIcww8CDB5OTzd/WwMIFM0KGpiGGQ87QAWYkHx Jp2Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc: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:to:from :dkim-signature; bh=FtIqRUcfOkY+GJe8JI9dBf6G7CRUHHnpPIR2B14bLgE=; b=L5HGIVIJGn9IFnVwjqcsCiNBQuz6O1eorSQfxQhZZwhHz2XNRlRIYFwP4fvdhRnfAP EuifhDkXlI6Cv7K5/KV0WjYPJq4yvzBzEnYwKhT1cMuFTmtWqvHx2MdxK71gMm+2d+8T XUP9MsV7HwBhuWAuGd6eGsxg3gPdN3gnR2tOfSUPKYjLf0Km2//Fpm53bAUFsOJZcdfe MQm5tgZhi9mALodp6rJ1VdnmTcX9WnLBmkZadX+o2CG/XefOWm7n3l6Pz4bqCxlTezXg xiq5x37mlMiIg2K6vTFM8UJy6OB9l5CIGXxl0NH6xwi6U0hNONe36ifmZ76ML/HdNQHH FOPg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=xoQaJWAp; 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=fail (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 m20si7925363ooj.0.2021.10.28.21.42.04 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 28 Oct 2021 21:42:04 -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=fail header.i=@linaro.org header.s=google header.b=xoQaJWAp; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:59378 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mgJiN-00076D-QW for patch@linaro.org; Fri, 29 Oct 2021 00:42:03 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:51116) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mgJaJ-0003mf-Hf for qemu-devel@nongnu.org; Fri, 29 Oct 2021 00:33:43 -0400 Received: from mail-pj1-x1031.google.com ([2607:f8b0:4864:20::1031]:55011) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mgJaG-0007uN-UO for qemu-devel@nongnu.org; Fri, 29 Oct 2021 00:33:43 -0400 Received: by mail-pj1-x1031.google.com with SMTP id np13so6326083pjb.4 for ; Thu, 28 Oct 2021 21:33:40 -0700 (PDT) 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 :mime-version:content-transfer-encoding; bh=FtIqRUcfOkY+GJe8JI9dBf6G7CRUHHnpPIR2B14bLgE=; b=xoQaJWApnbeQYO+Waxg/edICV2Pbi3ondw/Jy2deGY/cLCzJwPbPI1uNAYYJzx5HPP qZBd3nSZPsDHc8yV2MHA6bDS1mtGOe2J99i0TJUTwadWJyBvHaAbgeEKggQ43S4FcCqk Bn3NjvvVMWdtDlzj4kzxY0zm/m0PyRsiP1y368Us3kKZQqtDLuwKN3npZ1EzVBbQIHBO h41zMf4cqT5YUT/x8O0pyTEiebd9EG94dGHPwmm5l0mzeJesiJCwcQsQO/enluToudb1 7hfynrsH0d8Bu7jxG4P1IFN//6PB1kkvQlfQpMPfnSgtMa0wK+iWTFtPVoPyUABazc4v jAUQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=FtIqRUcfOkY+GJe8JI9dBf6G7CRUHHnpPIR2B14bLgE=; b=QnLEeUfezjc7GCTh1pYpfQKT+NSl6PT2H8TT5ivx2td3ZRaSTaINSUhwJGQ66ZUUte s25YjceGJdEHE/HKPb0iTSEdySSx0XPT4GXrvNRd/9AdfvsAGkfLbHrPjbvb4/nlj3jD YMBaFXNnLdmrLmf04CElwIpn3GqkOOvOdNSTtN1/Z9iiSuyCeTNvdxiJW79CvdlbAMM6 XT9p3tRH29/bNg3WSA/aEBrEthz9cgTimwZTgEl/FkR8ZTXvNw6/sc751wUUK28dF/YQ A+G0grXO306wFUMas0tw0ENTCKfl+JVeshLJ3sGz4tVlBNo5M1RYgxRETK/+UfKUUWYA V6Sg== X-Gm-Message-State: AOAM5326jatgan01zKn3owdx3MFs2uOm1BrH5TLPkZFakJFMwuOZCIrN mc61zihIwb5FQH0t69aWMDr77Mq4TIRmMg== X-Received: by 2002:a17:903:2301:b0:141:6a7b:f3d with SMTP id d1-20020a170903230100b001416a7b0f3dmr7646440plh.51.1635482019298; Thu, 28 Oct 2021 21:33:39 -0700 (PDT) Received: from localhost.localdomain (174-21-75-75.tukw.qwest.net. [174.21.75.75]) by smtp.gmail.com with ESMTPSA id i11sm4120257pgp.18.2021.10.28.21.33.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Oct 2021 21:33:38 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PULL v2 10/60] tcg/optimize: Move prev_mb into OptContext Date: Thu, 28 Oct 2021 21:32:39 -0700 Message-Id: <20211029043329.1518029-11-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20211029043329.1518029-1-richard.henderson@linaro.org> References: <20211029043329.1518029-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::1031; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x1031.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.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Luis Pires , =?utf-8?q?Alex_Benn=C3=A9e?= , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" This will expose the variable to subroutines that will be broken out of tcg_optimize. Reviewed-by: Alex Bennée Reviewed-by: Luis Pires Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- tcg/optimize.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) -- 2.25.1 diff --git a/tcg/optimize.c b/tcg/optimize.c index 627a5b39f6..b875d76354 100644 --- a/tcg/optimize.c +++ b/tcg/optimize.c @@ -46,6 +46,7 @@ typedef struct TempOptInfo { typedef struct OptContext { TCGContext *tcg; + TCGOp *prev_mb; TCGTempSet temps_used; } OptContext; @@ -609,7 +610,7 @@ static bool swap_commutative2(TCGArg *p1, TCGArg *p2) void tcg_optimize(TCGContext *s) { int nb_temps, nb_globals, i; - TCGOp *op, *op_next, *prev_mb = NULL; + TCGOp *op, *op_next; OptContext ctx = { .tcg = s }; /* Array VALS has an element for each temp. @@ -1566,7 +1567,7 @@ void tcg_optimize(TCGContext *s) } /* Eliminate duplicate and redundant fence instructions. */ - if (prev_mb) { + if (ctx.prev_mb) { switch (opc) { case INDEX_op_mb: /* Merge two barriers of the same type into one, @@ -1580,7 +1581,7 @@ void tcg_optimize(TCGContext *s) * barrier. This is stricter than specified but for * the purposes of TCG is better than not optimizing. */ - prev_mb->args[0] |= op->args[0]; + ctx.prev_mb->args[0] |= op->args[0]; tcg_op_remove(s, op); break; @@ -1597,11 +1598,11 @@ void tcg_optimize(TCGContext *s) case INDEX_op_qemu_st_i64: case INDEX_op_call: /* Opcodes that touch guest memory stop the optimization. */ - prev_mb = NULL; + ctx.prev_mb = NULL; break; } } else if (opc == INDEX_op_mb) { - prev_mb = op; + ctx.prev_mb = op; } } }