From nobody Tue Dec 24 13:52:54 2024 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=1734668325; cv=none; d=zohomail.com; s=zohoarc; b=WyT5NIe+P7F4T9AfxapuqCqPSbNzOHwVqTh+UotV5ot65Iw7VBtAqmYlNb1mowbT7ZDynx6fDHQ4LM2wdre8hXVjY7fkAH0H0SbXhJxU06z/cwFO5vB+Gjlxi69mLCH/rQ3+wWl/oUz529FWAy+yv8JxCzR3Y8Ld6Glve4MqZ2c= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1734668325; h=Content-Transfer-Encoding:Cc:Cc: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; bh=dwXMRrF7RgPRPzXWK+0ltvOBnUKyuGgifKCVeP7036w=; b=YZ/tbqEhdvJtuzwwnMVl9Pf6S2MgcOdMaJ3rb2Y3eFd6XK7VJPQ9/quaT7o5R4LZO3nyqiCNpwaA4Y7MMjpokVrPTvFz5UthDEUzolo67UKTbMeEtILqWE0NaBu5LgrbuEnsrZ1GEFHPZVOyOrzP/LParfAap/f1X29lBRtwzHw= 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 1734668325488502.9199454168896; Thu, 19 Dec 2024 20:18:45 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tOUR8-0004M0-ES; Thu, 19 Dec 2024 23:16:26 -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 1tOUPQ-000137-Mk for qemu-devel@nongnu.org; Thu, 19 Dec 2024 23:14:47 -0500 Received: from mail-pl1-x62a.google.com ([2607:f8b0:4864:20::62a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tOUPP-0006q8-9M for qemu-devel@nongnu.org; Thu, 19 Dec 2024 23:14:40 -0500 Received: by mail-pl1-x62a.google.com with SMTP id d9443c01a7336-21670dce0a7so17574775ad.1 for ; Thu, 19 Dec 2024 20:14:38 -0800 (PST) Received: from stoup.. ([71.212.144.252]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-8529e78a55dsm506952a12.80.2024.12.19.20.14.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Dec 2024 20:14:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1734668078; x=1735272878; 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=dwXMRrF7RgPRPzXWK+0ltvOBnUKyuGgifKCVeP7036w=; b=SjNF/u4hN2Bpc9PyzOojzVfB7McXW25v4qWoTlIVp9OUic+EdR+n9verzSXGJHADHR 5dNgj1vOPTdFeV8OV0Zyb2Fag4X0jCo6OT44zR9DoKIBJ6U2L/6TkKuVSjmFp4l442b+ aAaF/BKaSvvFMRZ+1pGNCPe91buL3LThtuIrJd/uwp87I4O1SjNNNmVRPqUXSz0ZMmWn HpS6ujLRxbF2fowSZ76iow9nK//hTmQWOjqozbr0KfmFmKMHkt5ReqDQYLJtS3Y4rCCv zoKDviIAYBAX86O0fBcqg0qzLDjClyO87Ewde1vmR59sPCt4UzneUWsySfTH2LhpLPCx V+xg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734668078; x=1735272878; 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=dwXMRrF7RgPRPzXWK+0ltvOBnUKyuGgifKCVeP7036w=; b=NzFVNMKB6w7HAzVvACsm8EcqC6LZtYCM1XCJbrK7tWNr3FmPZWxaQtoc1QJtKaeIm7 f7hGruL7RAze/wDYiwT6R5btX6CCVhYKcuVrztBRajPxkr4iYcRAgBMt8mCu2Go4eSLG fQ/VtbM0YzGPZqrE3wdh/kLFLvtRwFndkAzBUCb7unyEn4o/wvabL7sX+5qsyNR/aZP+ 7d+2tynu0snnX/nuCerI5JhOHQ/g4hb8u2J3Ozc59MMbvFb4JyKaB9AB/CSjmYjjViSA L6AUdjlLezDt+2CakMHt0dtflalzBGfvvccYOITrMYnpRtEF7/fdm+sAvBiXTPRjElRg igYg== X-Gm-Message-State: AOJu0YxgEkeFMcw2H3EgNvMnhJ9wc/0bkmx4btVP/tTjsceN/BdkPu31 NGinuxShxdfViEpDPeS0XvBCFSCOtQJnYcmJG+4tx/NcGfQ6TAj0iaznGTnXGfNlGCQWM4ulFLN B X-Gm-Gg: ASbGncuT2496zKT3uaD1r6bSTSF7EUriU2ff/7uFtvF0I5ki4qRFQqdhRIQtWtt88zT 3vEH8uRPIJP0w9kEV14TAfQYM4oRPvOPrVwY9qmUfPjJhErS/JfkhTgPPavOEwBODDY9AmZ181S Smik7lYWYFvOOa1eQ4pYMmxaVOSE31l25Yc99riLVkdlbDO8As6qmx34D7/Fgd9vP5kpLU+VD9N qoxlUwr1e3FgAR6lsqT2BlsmY9e2c6kfTEft6NzNz06lCmUxT9iYHIK73Tm9XQ= X-Google-Smtp-Source: AGHT+IFHtz8e0cRRkxetDzAZmnuPVm/CKScSq7gMAk+VWFaY8rCWwUHf1zi2VLUuUzn7JvmsccUiyQ== X-Received: by 2002:a17:903:2c6:b0:216:3c36:69a7 with SMTP id d9443c01a7336-219e6f262admr18225605ad.45.1734668077958; Thu, 19 Dec 2024 20:14:37 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Pierrick Bouvier Subject: [PATCH v2 43/51] tcg/optimize: Use finish_folding in fold_sub, fold_sub_vec Date: Thu, 19 Dec 2024 20:10:55 -0800 Message-ID: <20241220041104.53105-44-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241220041104.53105-1-richard.henderson@linaro.org> References: <20241220041104.53105-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::62a; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x62a.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: 1734668326129116600 Content-Type: text/plain; charset="utf-8" Duplicate fold_sub_vec into fold_sub instead of calling it, now that fold_sub_vec always returns true. Reviewed-by: Pierrick Bouvier Signed-off-by: Richard Henderson --- tcg/optimize.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/tcg/optimize.c b/tcg/optimize.c index 7219415fe2..bfce2dcf60 100644 --- a/tcg/optimize.c +++ b/tcg/optimize.c @@ -2645,12 +2645,15 @@ static bool fold_sub_vec(OptContext *ctx, TCGOp *op) fold_sub_to_neg(ctx, op)) { return true; } - return false; + return finish_folding(ctx, op); } =20 static bool fold_sub(OptContext *ctx, TCGOp *op) { - if (fold_const2(ctx, op) || fold_sub_vec(ctx, op)) { + if (fold_const2(ctx, op) || + fold_xx_to_i(ctx, op, 0) || + fold_xi_to_x(ctx, op, 0) || + fold_sub_to_neg(ctx, op)) { return true; } =20 @@ -2662,7 +2665,7 @@ static bool fold_sub(OptContext *ctx, TCGOp *op) ? INDEX_op_add_i32 : INDEX_op_add_i64); op->args[2] =3D arg_new_constant(ctx, -val); } - return false; + return finish_folding(ctx, op); } =20 static bool fold_sub2(OptContext *ctx, TCGOp *op) --=20 2.43.0