From patchwork Fri Oct 29 04:32:45 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 516394 Delivered-To: patch@linaro.org Received: by 2002:ad5:5208:0:0:0:0:0 with SMTP id p8csp398265iml; Thu, 28 Oct 2021 21:50:01 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxpkj80NbBOJZ4+/BUOe96acnp2KPYsq4ohYICNa4ppSr87E2CNJIApjOtp6rJMaobVr5Pi X-Received: by 2002:aca:ac0b:: with SMTP id v11mr11825273oie.155.1635483001349; Thu, 28 Oct 2021 21:50:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1635483001; cv=none; d=google.com; s=arc-20160816; b=Nasy/+3dBYJnw0RHTfDHf3Jc9ZcT5gb0ZSqcDXifWx1fpM/SeW0AUMrA83YMSeH/9D Zb8dJtwYhmVrp+n1aAxk8//muFwdSO44LZFiOm7tUdlQFGTuvxOvOQtS5HFt5+OmRs8l wpZghy0m0JGGz3YbXKM7kPsLcqOME0Sq/b1asOrVgEtqQcZQ7tkLZr8IPO0BQI3LXwaF XaLTQq+WpZKoo1cFteHRLgswovWUDK9cr8hC8J/V/wf0QvDX51HJ6EzKdgmpjPsJFR/R UrbWO4FpMQhocVGi3aOxmBbKTCjyg34KkyfkmjzqRYjIGfFfUxZ57EZg1rf2OuJTzQdO 8b7w== 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=/my2BfUMduF0YwUj5N5teVZc/oRLeZHGt5Sceph4cvk=; b=LS+zGX7AqdIQUFhkpLDVrYvtiXuJ6p1HEXk7Qham0xQX0CxERywvEh2QD2gwj5uy/X YpgC87verCWsEyt7Bx8hgnjfLo3OiwL1cju8kXeVMY4ZtGw0cYulKPRGRLMwo/OnuKWq 6s7NFqvdzasOkbF64AxyI6DxHzltpKZKFZnDwPVBHIZhVVewP8CATlhbVL6BYBXRGLL3 t3lEggl/PFlv3h8youz0v8QyHlxiVeflvWOXvBp1cGnI7/npX82+0+9aeuiU84tZjnQC K3b+VKugGT0Nz8ZVAiESyVsVt0De1HOzJXLteZZ3NKfLGBRK2ZvevuON/92K93cMG+Ir v2Tw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=fTWzUGcq; 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 z89si4738873ota.79.2021.10.28.21.50.01 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 28 Oct 2021 21:50:01 -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=fTWzUGcq; 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]:48156 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mgJq4-0001gF-Kf for patch@linaro.org; Fri, 29 Oct 2021 00:50:00 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:51182) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mgJaN-0003zY-Jd for qemu-devel@nongnu.org; Fri, 29 Oct 2021 00:33:48 -0400 Received: from mail-pg1-x530.google.com ([2607:f8b0:4864:20::530]:35797) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mgJaL-0007wp-Ua for qemu-devel@nongnu.org; Fri, 29 Oct 2021 00:33:47 -0400 Received: by mail-pg1-x530.google.com with SMTP id q187so8739708pgq.2 for ; Thu, 28 Oct 2021 21:33:45 -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=/my2BfUMduF0YwUj5N5teVZc/oRLeZHGt5Sceph4cvk=; b=fTWzUGcqhusY8C0B/jsefioy2i5esrWU2i1TVUXzlgz2ijNjstOv5ggEj7JiqjLaAD cGM8aqZ1Sct5lHVaWg/60lDH9DchhYrDl1/i+PEwSM8JpkBTqjmHK/o+XPJydMfONhHp aj8n4TOWK6hsLHZoJ/Lp0QzkxLFSN8Ni9fgQUa6B7Ed+eRb/3PBvnl3J4uDHZh0+jHu9 Wtqs7jDf2ZOJyAORybOPF5GqQ65cty1uyQFPNAXSaXRd+j2tvswoNmaoneqihIYFvbcg PPMeLE9Nu8X914qPnUv0yNrMhKJJVk8LKPv9i7PmQIb57huPGjt+X5q4WolaShS2qwHY ZVSg== 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=/my2BfUMduF0YwUj5N5teVZc/oRLeZHGt5Sceph4cvk=; b=nKaj7Kuj5/o280Nbm9096I5T8UCp4KgnLN5cgOTy4Bez5L0YOPOmELkREdq9ilYTYu aCBqJm+zLKEjUrFL1QKWoNfay17B7po8y7aeOci+ZyxLBbftrwXwwljPHv00SMRfDgFV LrRDOlMJAYF6NgMIGqgyyzrq++y5Ih60ZJWBTC283MZtvVEGJq1sTmNCpWpENZsUL5qq rep7kUSMwJZGASOfGfItI0X1AEnRgOIy9E9PIVMs/jEMov20iWVkApnS3fHSmwMJrfwx uQnmjcX6D52bJdjawVrqO6HV8QQJBT5up0qVbNmDZVDB5qL4B1/INmJ4VfakmYoUb1mv eJgw== X-Gm-Message-State: AOAM533mJAF+U7mkna4w3LkXGkNEClSysq1fKl9lXUNuUEQVzxYZFpeK Z6w+12mV0d/0yhTMZGgqFofq71WmT4rsfQ== X-Received: by 2002:a05:6a00:812:b0:47e:4c65:2a77 with SMTP id m18-20020a056a00081200b0047e4c652a77mr6937794pfk.51.1635482024605; Thu, 28 Oct 2021 21:33:44 -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.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Oct 2021 21:33:44 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PULL v2 16/60] tcg/optimize: Return true from tcg_opt_gen_{mov, movi} Date: Thu, 28 Oct 2021 21:32:45 -0700 Message-Id: <20211029043329.1518029-17-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::530; envelope-from=richard.henderson@linaro.org; helo=mail-pg1-x530.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 allow callers to tail call to these functions and return true indicating processing complete. Reviewed-by: Alex Bennée Reviewed-by: Luis Pires Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- tcg/optimize.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) -- 2.25.1 diff --git a/tcg/optimize.c b/tcg/optimize.c index 19c01687b4..066e635f73 100644 --- a/tcg/optimize.c +++ b/tcg/optimize.c @@ -180,7 +180,7 @@ static bool args_are_copies(TCGArg arg1, TCGArg arg2) return ts_are_copies(arg_temp(arg1), arg_temp(arg2)); } -static void tcg_opt_gen_mov(OptContext *ctx, TCGOp *op, TCGArg dst, TCGArg src) +static bool tcg_opt_gen_mov(OptContext *ctx, TCGOp *op, TCGArg dst, TCGArg src) { TCGTemp *dst_ts = arg_temp(dst); TCGTemp *src_ts = arg_temp(src); @@ -192,7 +192,7 @@ static void tcg_opt_gen_mov(OptContext *ctx, TCGOp *op, TCGArg dst, TCGArg src) if (ts_are_copies(dst_ts, src_ts)) { tcg_op_remove(ctx->tcg, op); - return; + return true; } reset_ts(dst_ts); @@ -228,9 +228,10 @@ static void tcg_opt_gen_mov(OptContext *ctx, TCGOp *op, TCGArg dst, TCGArg src) di->is_const = si->is_const; di->val = si->val; } + return true; } -static void tcg_opt_gen_movi(OptContext *ctx, TCGOp *op, +static bool tcg_opt_gen_movi(OptContext *ctx, TCGOp *op, TCGArg dst, uint64_t val) { const TCGOpDef *def = &tcg_op_defs[op->opc]; @@ -248,7 +249,7 @@ static void tcg_opt_gen_movi(OptContext *ctx, TCGOp *op, /* Convert movi to mov with constant temp. */ tv = tcg_constant_internal(type, val); init_ts_info(ctx, tv); - tcg_opt_gen_mov(ctx, op, dst, temp_arg(tv)); + return tcg_opt_gen_mov(ctx, op, dst, temp_arg(tv)); } static uint64_t do_constant_folding_2(TCGOpcode op, uint64_t x, uint64_t y)