From nobody Fri Apr 4 22:48:06 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1739748794; cv=none; d=zohomail.com; s=zohoarc; b=Vrgt7cSXgFJ+wwjlvJjusbwwthxhFhGAQvN6v/0o3zII1yxw2IfdlsRLu9DhTTCoIy3/wRtlTBqD0b+pXLHDhMwVubXQvj45dCLVS7WHNdAv71zVfUQy/2swVitBIWQfTcQu7qDnmDeguwXRnR7OueOpN8XD8WjXu0tYc8GcVDg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1739748794; h=Content-Transfer-Encoding:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To:Cc; bh=3X8zpaBPG0U32VcwjOMGk4yoM6w3WNPdiH/kcAZjDZA=; b=S7NCRBMxQFXdMdzpg650tFxIJYUukGyH7qiKNW3K0msw+XkxEEUSyCPcq+o6BrDXBQ0eVRnVPBSYXgaGXA0sV6pldujqtiyJNOIunKrvPEAXPvlItmdTicR6F6anyJYLBTR9gjscJ3y2jBNKBeA5ic+wQosqbBwSovToY77oeoE= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 173974879438994.87355818246624; Sun, 16 Feb 2025 15:33:14 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tjnuI-000483-94; Sun, 16 Feb 2025 18:18:38 -0500 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 1tjntP-0002xG-Dt for qemu-devel@nongnu.org; Sun, 16 Feb 2025 18:17:43 -0500 Received: from mail-pl1-x629.google.com ([2607:f8b0:4864:20::629]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tjntL-00064f-C2 for qemu-devel@nongnu.org; Sun, 16 Feb 2025 18:17:42 -0500 Received: by mail-pl1-x629.google.com with SMTP id d9443c01a7336-221057b6ac4so19389325ad.2 for ; Sun, 16 Feb 2025 15:17:37 -0800 (PST) Received: from stoup.. (71-212-39-66.tukw.qwest.net. [71.212.39.66]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2213394d6c8sm5449885ad.181.2025.02.16.15.17.36 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 16 Feb 2025 15:17:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1739747857; x=1740352657; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=3X8zpaBPG0U32VcwjOMGk4yoM6w3WNPdiH/kcAZjDZA=; b=A7PC3xxhaeolDUtE1GY7oMVc/9JXuVVIQvkQYyJAFRdg8JsiYlHY0ExdrAUOibByB4 scmxJCORLmQawTK9cAVZmtyR4p1TkmdCCdzRjcCCLxiZMdcb6VcXIWvY+7yjpzY2Ga82 +JZ5wfnSlay0UpzAfZKwdJ2fU5MKukPnwnVlyW/T080U8fb3+8Pk1wCKc1jmC86CBmQ7 HznZVeGx7Fi4k+YTaNBx0LKrm0XkPtlxBTcGPohSUdTBmCRqt+dXfMimKvAjHHrDw9jZ S4kmw49wztxDc41DBtDRD+i3uV4DSW0Wvba5m4Ed2UvNWW0+9mGYI3iDW+fkqus3Weis p6ew== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1739747857; x=1740352657; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=3X8zpaBPG0U32VcwjOMGk4yoM6w3WNPdiH/kcAZjDZA=; b=hGOZe/wFC0ZrIRmOAUREV7ADz8o8QsM5l8Vz9cgtK2dmqrJ2KuPDd7PRVNOEQ2UKNs 8pyO8abEOSaq3qG0bLT+mfF9KY+H7Ylsyvbr8UoVj/yqGOcAJ87heabvEHRsKBr6wN93 RtQAhbKzl7FIaCxex71qnm5xnCBS76ghLTk8K6xqNvsuXiOgDW4EhyoEEbu6ApwD5rms B4ni7JQuX+r4R4gHJzBwb297dCHMaaXHBtb/KHMhfGHCT8gsREswPT3bVXViTCApX4X9 yFBRz/w+Mx4e+FLYx2FxY8xs+BFS9y7p1Axpu86EgxR4v4g7fFPqmYObUnHc9qanmEJI +iRQ== X-Gm-Message-State: AOJu0YzCkEZdSQxCC+sgiudihQp1P2UYlYoRDk/LRrbiHha8OcH7SIZz YFt2bKLF/y5C1tdPguutC2vuCaAS6Bm06pZ6QmQ1+LLnlzOg3SCEgBBWCInNKppukBoMgB2BG+O 1 X-Gm-Gg: ASbGncv1X/1ynkqavfBaPKQ0hS2JwKK88R9zGUQ1FPBN5RVBd/jofnevxAtVoCPDPX9 cnscbSRwtMfl19V/Mt0BjNvhFLj3qDTshAMRZvaF2nd8jKL4q/4pRqGhyWDHss+3Sb7igM5nz4h FvCnRbsTf7ZNsG72lVva29o5ZsB13aSaLEFrC+rVmmfzvRgHWSQlWxW9sZUhxaPBHC4iGTNL5ho OMnLUYKpmYRxYqq4zPbIQ0+gqDSrXcXfNZ8D5LVELJFsXBolLVuGfZ7BhhgWvJiN2suwvSPQn3J 6dcIPqh88/FGcgSqEiZFtA3iAv9hD4/HI3iKdkupI8yUJeA= X-Google-Smtp-Source: AGHT+IHZ8QA+X9do+KWTfUbGWGS7PnAaXOY3lDXMswysRkB7bAIORXKH4C25kUfATPYUd1MVjVjFHQ== X-Received: by 2002:a17:902:e847:b0:220:c066:94eb with SMTP id d9443c01a7336-22104061288mr123479075ad.25.1739747856873; Sun, 16 Feb 2025 15:17:36 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v3 110/162] tcg: Move i into each for loop in liveness_pass_1 Date: Sun, 16 Feb 2025 15:09:19 -0800 Message-ID: <20250216231012.2808572-111-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250216231012.2808572-1-richard.henderson@linaro.org> References: <20250216231012.2808572-1-richard.henderson@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::629; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x629.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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1739748796507019100 Content-Type: text/plain; charset="utf-8" Use per-loop variables instead of one 'i' for the function. Signed-off-by: Richard Henderson --- tcg/tcg.c | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/tcg/tcg.c b/tcg/tcg.c index c54fe90309..74911962a4 100644 --- a/tcg/tcg.c +++ b/tcg/tcg.c @@ -3924,10 +3924,9 @@ liveness_pass_1(TCGContext *s) int nb_temps =3D s->nb_temps; TCGOp *op, *op_prev; TCGRegSet *prefs; - int i; =20 prefs =3D tcg_malloc(sizeof(TCGRegSet) * nb_temps); - for (i =3D 0; i < nb_temps; ++i) { + for (int i =3D 0; i < nb_temps; ++i) { s->temps[i].state_ptr =3D prefs + i; } =20 @@ -3954,7 +3953,7 @@ liveness_pass_1(TCGContext *s) =20 /* pure functions can be removed if their result is unused= */ if (call_flags & TCG_CALL_NO_SIDE_EFFECTS) { - for (i =3D 0; i < nb_oargs; i++) { + for (int i =3D 0; i < nb_oargs; i++) { ts =3D arg_temp(op->args[i]); if (ts->state !=3D TS_DEAD) { goto do_not_remove_call; @@ -3965,7 +3964,7 @@ liveness_pass_1(TCGContext *s) do_not_remove_call: =20 /* Output args are dead. */ - for (i =3D 0; i < nb_oargs; i++) { + for (int i =3D 0; i < nb_oargs; i++) { ts =3D arg_temp(op->args[i]); if (ts->state & TS_DEAD) { arg_life |=3D DEAD_ARG << i; @@ -3988,7 +3987,7 @@ liveness_pass_1(TCGContext *s) } =20 /* Record arguments that die in this helper. */ - for (i =3D nb_oargs; i < nb_iargs + nb_oargs; i++) { + for (int i =3D nb_oargs; i < nb_iargs + nb_oargs; i++) { ts =3D arg_temp(op->args[i]); if (ts->state & TS_DEAD) { arg_life |=3D DEAD_ARG << i; @@ -4008,7 +4007,7 @@ liveness_pass_1(TCGContext *s) * order so that if a temp is used more than once, the sta= ck * reset to max happens before the register reset to 0. */ - for (i =3D nb_iargs - 1; i >=3D 0; i--) { + for (int i =3D nb_iargs - 1; i >=3D 0; i--) { const TCGCallArgumentLoc *loc =3D &info->in[i]; ts =3D arg_temp(op->args[nb_oargs + i]); =20 @@ -4036,7 +4035,7 @@ liveness_pass_1(TCGContext *s) * If a temp is used once, this produces a single set bit; * if a temp is used multiple times, this produces a set. */ - for (i =3D 0; i < nb_iargs; i++) { + for (int i =3D 0; i < nb_iargs; i++) { const TCGCallArgumentLoc *loc =3D &info->in[i]; ts =3D arg_temp(op->args[nb_oargs + i]); =20 @@ -4135,7 +4134,7 @@ liveness_pass_1(TCGContext *s) its outputs are dead. We assume that nb_oargs =3D=3D 0 implies side effects */ if (!(def->flags & TCG_OPF_SIDE_EFFECTS) && nb_oargs !=3D 0) { - for (i =3D 0; i < nb_oargs; i++) { + for (int i =3D 0; i < nb_oargs; i++) { if (arg_temp(op->args[i])->state !=3D TS_DEAD) { goto do_not_remove; } @@ -4149,7 +4148,7 @@ liveness_pass_1(TCGContext *s) break; =20 do_not_remove: - for (i =3D 0; i < nb_oargs; i++) { + for (int i =3D 0; i < nb_oargs; i++) { ts =3D arg_temp(op->args[i]); =20 /* Remember the preference of the uses that followed. */ @@ -4183,7 +4182,7 @@ liveness_pass_1(TCGContext *s) } =20 /* Record arguments that die in this opcode. */ - for (i =3D nb_oargs; i < nb_oargs + nb_iargs; i++) { + for (int i =3D nb_oargs; i < nb_oargs + nb_iargs; i++) { ts =3D arg_temp(op->args[i]); if (ts->state & TS_DEAD) { arg_life |=3D DEAD_ARG << i; @@ -4191,7 +4190,7 @@ liveness_pass_1(TCGContext *s) } =20 /* Input arguments are live for preceding opcodes. */ - for (i =3D nb_oargs; i < nb_oargs + nb_iargs; i++) { + for (int i =3D nb_oargs; i < nb_oargs + nb_iargs; i++) { ts =3D arg_temp(op->args[i]); if (ts->state & TS_DEAD) { /* For operands that were dead, initially allow @@ -4215,7 +4214,7 @@ liveness_pass_1(TCGContext *s) =20 default: args_ct =3D opcode_args_ct(op); - for (i =3D nb_oargs; i < nb_oargs + nb_iargs; i++) { + for (int i =3D nb_oargs; i < nb_oargs + nb_iargs; i++) { const TCGArgConstraint *ct =3D &args_ct[i]; TCGRegSet set, *pset; =20 --=20 2.43.0