From patchwork Thu Oct 21 21:05:02 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 516089 Delivered-To: patch@linaro.org Received: by 2002:ac0:bf50:0:0:0:0:0 with SMTP id o16csp340272imj; Thu, 21 Oct 2021 14:25:04 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwAQiWD35gBvbV4baJoh/F1KxMwhNegwE3qlOQpMvR4SopYIujvfqybxls2yU9Ex5kiaj5k X-Received: by 2002:a05:6808:1795:: with SMTP id bg21mr6973955oib.150.1634851504112; Thu, 21 Oct 2021 14:25:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634851504; cv=none; d=google.com; s=arc-20160816; b=0CRQoFG91LElubdZMCMyLTW1VX4JbEodCgvcjmTS+KKKIwjRPsKPENXqJoeVnye6xv RHUkzLcw1Cc+Ip0uBSZ2/aFHzDzZ6r93iunM/ZqNxBxITAXoJE7cDdsJYCRN9LBswk9E uDWrAyzd8Cty0D/rRE408SFui6tLiDkOnYcxIg5Dd697Or/nWgaVeZK8PecVmgA/8HKu EYO/y6USFy/aEt5qF7sdLf2lE1xLxACEjopWtMHnAEKJNjSa8cGsp27OUq1WRcX+YzEr SnafnswZ0jfywA9qFZ3HwN73/YH40jBV8dh5wTjhnBoTA+pC73jsSyFmCMaNDHx2QIgF nQ3g== 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=vj6eiTLQTF9Hihcv311hW6R5u8RCFhiOgb4iuNdXdzk=; b=ye+3mInciPHMqgwxMj61ej09P0B4wDMa05O5pCPpdauCydreFnS6DOF+DfBlF+fwcj veuCShAP3Fwj0vbriNBgllpiedQ1U/44zNeTkwbKUfmc++ZOOQ50vpf49pHEIYeP3XUr 8QgoNEX4Y3Z2GsiDnTQUar50vDP3KFVqxLdbMa6de8QpsYTnpBuU+JwMmOvjbQ9CfL5a LuCW+YTO+TpgLQa58WTLIqj87dzfc0roor9dqH2b6QBmcP5sQ9sKUgu+a5i2k6lO9BdJ uQX465nOu5fqIgRnsVqbrOO9c/STOdb/P/1XVPpHtNfI8PszgqLAdHW2vc6pg9JuIo9X fwUg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=D7ItLjIB; 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 r126si6469572oia.298.2021.10.21.14.25.04 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 21 Oct 2021 14:25: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=D7ItLjIB; 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]:60590 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mdfYd-0003nn-D6 for patch@linaro.org; Thu, 21 Oct 2021 17:25:03 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:48296) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mdfG4-0007Nm-Qn for qemu-devel@nongnu.org; Thu, 21 Oct 2021 17:05:53 -0400 Received: from mail-pg1-x531.google.com ([2607:f8b0:4864:20::531]:35702) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mdfG2-0004Em-F2 for qemu-devel@nongnu.org; Thu, 21 Oct 2021 17:05:52 -0400 Received: by mail-pg1-x531.google.com with SMTP id q187so1426251pgq.2 for ; Thu, 21 Oct 2021 14:05:49 -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=vj6eiTLQTF9Hihcv311hW6R5u8RCFhiOgb4iuNdXdzk=; b=D7ItLjIBfAmH4gKxsjNQEs4w3S5Iz0oF71LyxDJB9V+XssggEZb4/l69RhsWbx7Hi5 6YwOdCzRQ5Wfzerc3ZmyFIyZkXQJqXfAGO+ze2+xEXE5du+zMdxXcZlF/Qsf1p27Ini4 I0VssuIw6owIDSIJgT2JKg74SKyoenQWgg6yjpo9tH2/J2sH+tRFEgTTSRjz5IYFUyUw cqbRFqE1HG1EJoMfCRjsA7SGQoylx5mHOHvHoPBjmuvMPW+tVBwyGXux5wwh9nWz4bAo qQT9Mz729trn7+4ux9n5Mbt7JsdRIvUeK+iynSRpFkeYhr8r0YxXWpJfUMBPUnVaQLiQ KAHQ== 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=vj6eiTLQTF9Hihcv311hW6R5u8RCFhiOgb4iuNdXdzk=; b=2ApL+fsfV1uwI8kTWkEfchS26ls2CHjdLl9H96yQFCvLpntWIBepEEj6K6kh8ebWwf u0AZSXuW1TOH7ZOIRTzuzpY2ovsiV/tHJ32DvgM09NSVrlihpAOX/0ORqN1vWZYAIjAk qiJKQLcgVrhXxJvoDPvlsjMMxPgffWNGapePKA0e2BX9t54UFJPxcyZC5Cy3qHZijrAA F40o940gDteCkmhzcsF6YyOu70LTbKmHuYwOi75bXLE2PqR0SVJj8gTbmEQnXVlfuamI ufaoFK/LLKS18n2FXCHjjPXQgieUvG3MhGA1NTyMUReJpuwhTkj60GQY31zLB2bzj3tW aROQ== X-Gm-Message-State: AOAM530CADs2NtgoJJHSVEi3qTIW3Q26XCO7IL6+4ZYdnh9ayTQdymLH PMe6G9dTf1LCbwgjAoBf3/z4/lMtemWR+Q== X-Received: by 2002:a62:7f4a:0:b0:44d:292f:cc24 with SMTP id a71-20020a627f4a000000b0044d292fcc24mr7888270pfd.58.1634850348977; Thu, 21 Oct 2021 14:05:48 -0700 (PDT) Received: from localhost.localdomain ([71.212.134.125]) by smtp.gmail.com with ESMTPSA id g7sm5981670pgp.17.2021.10.21.14.05.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Oct 2021 14:05:48 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v3 11/48] tcg/optimize: Return true from tcg_opt_gen_{mov, movi} Date: Thu, 21 Oct 2021 14:05:02 -0700 Message-Id: <20211021210539.825582-12-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20211021210539.825582-1-richard.henderson@linaro.org> References: <20211021210539.825582-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::531; envelope-from=richard.henderson@linaro.org; helo=mail-pg1-x531.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@eldorado.org.br, alex.bennee@linaro.org, =?utf-8?q?Philippe?= =?utf-8?q?_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: 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 Reviewed-by: Alex Bennée 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)