From patchwork Fri Oct 29 04:32:43 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 516404 Delivered-To: patch@linaro.org Received: by 2002:ad5:5208:0:0:0:0:0 with SMTP id p8csp403223iml; Thu, 28 Oct 2021 21:57:58 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyHl53+UmTTk35ahan7IgQOyQaYrh+lC8gOz3VxEmNlwzO1lDmflng3Thp/JzF41d37Q9JI X-Received: by 2002:a05:6830:1ace:: with SMTP id r14mr6785825otc.232.1635483478192; Thu, 28 Oct 2021 21:57:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1635483478; cv=none; d=google.com; s=arc-20160816; b=AlYACezjXMaVq6ZJfV9KtXVkkzOzCH84Et2GMmV/9Nrm/+VHntA+wB+NsLSVSEQAzc 9t+k4A1Qd5LAAQA+COJzs0aVz0V3IFVwPKzOBBHaFkzpr4zkxs2E535hqDaBUw0Xvfs/ k1Dl9JdeXF/XrsRL/CwFtL6oVdJEoqkggJpQJTsQO2WpqTKfOSk6eppVfem/gbhdrQdW ZHmOKGqBuN3viJGP0tCenx2IJmJtjTjcICms4yTUYEMrNv/DIo41uPhhEciub0ezQS02 nqMkv9ffdyfhzkHn8xaFVO356c2WQRbgA83olTpO5MaMaJUWNnQ+ovKtzRbF0QarkIDw Qqaw== 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=NYLWr1uKuQzUUVrza4V+n6K/acOPuYl97jiAhjg0Z5M=; b=glW1uIWEtwuAuOQxpwO733QNkSRx7T2hoRDBaj0VxCws8mCk4OSobZwqYDMt76NcUz 0Dk75lzCeVF9fdTWTWrlSwsb38N/sxoNlgywvZf2+UcBrB21NXq+rZuwO3X7Dt3YNOsJ eOaMR/aqeZ/QRH+WbqOXhADdQydvZf4YpaKh2wLjPYeLtos6nqidOQ1XFANahxGOrQlJ PtJiLd8NcAq559mkp5ij29x2CqOBiz1HcaoRqCWLSckc2+hGSL9g01/LA8YKrrM59M/4 A/RAcs5NU4kAkFTAQqtVoEmpOQ3aTSqpuXYJUi2QZWNr7NvI1C51vVy7LVQnfdTVx5z/ Mi/A== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=NoLtYvxO; 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 q2si6738747oiv.98.2021.10.28.21.57.58 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 28 Oct 2021 21:57:58 -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=NoLtYvxO; 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]:39592 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mgJxl-0006xO-HZ for patch@linaro.org; Fri, 29 Oct 2021 00:57:57 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:51150) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mgJaL-0003tl-SY for qemu-devel@nongnu.org; Fri, 29 Oct 2021 00:33:45 -0400 Received: from mail-pg1-x52c.google.com ([2607:f8b0:4864:20::52c]:41504) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mgJaK-0007wV-8y for qemu-devel@nongnu.org; Fri, 29 Oct 2021 00:33:45 -0400 Received: by mail-pg1-x52c.google.com with SMTP id 83so8682014pgc.8 for ; Thu, 28 Oct 2021 21:33:43 -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=NYLWr1uKuQzUUVrza4V+n6K/acOPuYl97jiAhjg0Z5M=; b=NoLtYvxOsNQbRV1c6QgIjIU2YAS3+dVhcFYFz+DXEWtXDmcteEqQR9MsWHnv/YijUM Y9d60P9ijksENO7P1eoO1gkThzR8/hepfF22O9vwXfJOiR6/7gkIgQXKqwMWEgXcmd8e FtSCZV+lL9/vYGKol3yVwkoIchNI5+owT5wkzRp/TU1v0mO+C13Vs5nIoJFMGNtGDkdG 10n/2IgX1Yf7Wk0GtSZ+DwL3ZTZUJrUTBg5eM9GhoWVSrBDvHu+iCgxGIwc32Wmixqb4 1bGZSpnP1ju5/CmDJ21NmcUgkZKTuciDHz+XFZhZ27h5moR8V5XKEC+kC+TIjiMPuUBM pivw== 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=NYLWr1uKuQzUUVrza4V+n6K/acOPuYl97jiAhjg0Z5M=; b=H2gJTvNOC4fIisSzx98+RN83scKMzuvXHmEEVUd6DPpoN+YzgjWpiB1XHzQBhw8Z+Z BaFAVySM8e6HVg78T0ZWVaEaC5pWszBD5Tx0Dkx0ET1CAMP3Jl8vRhR8uKx/ixkFo2HH Dh7uRuyawnsEQ4aCgP/8Mbrj0sJumu/iWZpiUUjHR0XE/s7zS4RHFFEZ4psbC0MHWenU RVb91aueXpg1DGvujvTLVydR5C7Qr65sxUemnfvgeqTtoTopn3pAsmBg+otDZgDPh92k k8m7IWBd+A3bAoQI6L3/ZOVBAjs2XZXkHdoIw4sMvlCUOzYSki2Vaq7Bc9c2srod5jFE v70g== X-Gm-Message-State: AOAM533Me6jb5EVEBXhmXlMqJ035/yuV/pmW86p4mRnUeA0S1MrUAe4k Pl5Y7o6A8MQkRN5IbKaWQWJqzYAhuxRmzw== X-Received: by 2002:aa7:8d44:0:b0:47b:ee6c:5ca4 with SMTP id s4-20020aa78d44000000b0047bee6c5ca4mr8588846pfe.49.1635482022939; Thu, 28 Oct 2021 21:33:42 -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.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Oct 2021 21:33:42 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PULL v2 14/60] tcg/optimize: Drop nb_oargs, nb_iargs locals Date: Thu, 28 Oct 2021 21:32:43 -0700 Message-Id: <20211029043329.1518029-15-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::52c; envelope-from=richard.henderson@linaro.org; helo=mail-pg1-x52c.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?= Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Rather than try to keep these up-to-date across folding, re-read nb_oargs at the end, after re-reading the opcode. A couple of asserts need dropping, but that will take care of itself as we split the function further. Reviewed-by: Alex Bennée Reviewed-by: Luis Pires Signed-off-by: Richard Henderson --- tcg/optimize.c | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) -- 2.25.1 diff --git a/tcg/optimize.c b/tcg/optimize.c index 74b9aa025a..77cdffaaef 100644 --- a/tcg/optimize.c +++ b/tcg/optimize.c @@ -675,7 +675,6 @@ void tcg_optimize(TCGContext *s) QTAILQ_FOREACH_SAFE(op, &s->ops, link, op_next) { uint64_t z_mask, partmask, affected, tmp; - int nb_oargs, nb_iargs; TCGOpcode opc = op->opc; const TCGOpDef *def; @@ -686,10 +685,8 @@ void tcg_optimize(TCGContext *s) } def = &tcg_op_defs[opc]; - nb_oargs = def->nb_oargs; - nb_iargs = def->nb_iargs; - init_arguments(&ctx, op, nb_oargs + nb_iargs); - copy_propagate(&ctx, op, nb_oargs, nb_iargs); + init_arguments(&ctx, op, def->nb_oargs + def->nb_iargs); + copy_propagate(&ctx, op, def->nb_oargs, def->nb_iargs); /* For commutative operations make constant second argument */ switch (opc) { @@ -1063,7 +1060,7 @@ void tcg_optimize(TCGContext *s) CASE_OP_32_64(qemu_ld): { - MemOpIdx oi = op->args[nb_oargs + nb_iargs]; + MemOpIdx oi = op->args[def->nb_oargs + def->nb_iargs]; MemOp mop = get_memop(oi); if (!(mop & MO_SIGN)) { z_mask = (2ULL << ((8 << (mop & MO_SIZE)) - 1)) - 1; @@ -1122,12 +1119,10 @@ void tcg_optimize(TCGContext *s) } if (partmask == 0) { - tcg_debug_assert(nb_oargs == 1); tcg_opt_gen_movi(&ctx, op, op->args[0], 0); continue; } if (affected == 0) { - tcg_debug_assert(nb_oargs == 1); tcg_opt_gen_mov(&ctx, op, op->args[0], op->args[1]); continue; } @@ -1202,7 +1197,6 @@ void tcg_optimize(TCGContext *s) } else if (args_are_copies(op->args[1], op->args[2])) { op->opc = INDEX_op_dup_vec; TCGOP_VECE(op) = MO_32; - nb_iargs = 1; } break; @@ -1371,7 +1365,6 @@ void tcg_optimize(TCGContext *s) op->opc = opc = (opc == INDEX_op_movcond_i32 ? INDEX_op_setcond_i32 : INDEX_op_setcond_i64); - nb_iargs = 2; } break; @@ -1579,6 +1572,7 @@ void tcg_optimize(TCGContext *s) if (def->flags & TCG_OPF_BB_END) { memset(&ctx.temps_used, 0, sizeof(ctx.temps_used)); } else { + int nb_oargs = def->nb_oargs; for (i = 0; i < nb_oargs; i++) { reset_temp(op->args[i]); /* Save the corresponding known-zero bits mask for the