From patchwork Mon Aug 30 06:24:14 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 504295 Delivered-To: patch@linaro.org Received: by 2002:a02:8629:0:0:0:0:0 with SMTP id e38csp1513263jai; Sun, 29 Aug 2021 23:32:01 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx54kYdlY3uehjpjybNerBEdx5PWRiN+fObaCIAv2sYP5++zQ7xpD6XutqyWomw8zJzSCcp X-Received: by 2002:a25:a546:: with SMTP id h64mr21919777ybi.81.1630305121842; Sun, 29 Aug 2021 23:32:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1630305121; cv=none; d=google.com; s=arc-20160816; b=jpgiYY4dmVZiURJBWS1q1ml/ZZuqihCtpcifwZqnYpnZ8l4uMpsLnPDZ4dd5sOzCUK Ht+zK1mFYZtNIFhu8MccZfEBYFYalUdzlx8l39POiH4xR3woAAwy3tkCpCnNeHci1TZp 7q2k3hWIhZUT58DCPrGfOrVl1dsdHX8aSvVxBxpwGrmRGKHRipV36Tgtywv7WLVslClV 6Dt4XZVo66bPGqkMfiputRvkF9Gy/VGDZ5fPC73lhEi+jXg3zjMmu/qSm7jW1RaxUrvo XnvfaB4kFEbGvSxrOh/TVX+WcWNKm6Wq10PlhoG3hjTTFu2A3m7E81Md7tab6bEaQvu9 4NHQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to: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=/gLxdxuhis4lF5Y8nsFl8eRzcFmtXgy72e0rkfcmU60=; b=HbywXnE0dgXyE8cAz2dBZzS/DMojaDJAK0QNNF/gmPQwOMuezKkon3VFMqUlyd7j0X MQaaD2PXLUApX9zN8k6DW4f+K+0TLKULCYPQV1fQs0hJBTiU50CgUZyu4SEPu5nZLSVb t2n9rUAq3uMgKiuP3/Lb6cO1Ru0wIacSXqLf4oBdN/9c1uxt2HQfCxSGnuW8OELWBJXp VfB+zTLfzgqejBtlBWms0Q3zZCymDk6ymQeB9T1oxVASXcdtdwiKEzOB4FWZhiFfEV9G xxdbN10VJCHSZfIaXzje/K+98dqVT3JjNSKnlGKR8bgJEAur36UIbSVs7Bq07YGxxS97 KXqA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="DXK+/RcN"; 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=pass (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 a7si9884505ybt.310.2021.08.29.23.32.01 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sun, 29 Aug 2021 23:32: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=pass header.i=@linaro.org header.s=google header.b="DXK+/RcN"; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:48404 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mKapt-0007jo-9l for patch@linaro.org; Mon, 30 Aug 2021 02:32:01 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:46242) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mKaj9-0003j9-9z for qemu-devel@nongnu.org; Mon, 30 Aug 2021 02:25:03 -0400 Received: from mail-pg1-x536.google.com ([2607:f8b0:4864:20::536]:41953) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mKaj7-0007T5-Kp for qemu-devel@nongnu.org; Mon, 30 Aug 2021 02:25:03 -0400 Received: by mail-pg1-x536.google.com with SMTP id k24so12406733pgh.8 for ; Sun, 29 Aug 2021 23:25:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=/gLxdxuhis4lF5Y8nsFl8eRzcFmtXgy72e0rkfcmU60=; b=DXK+/RcN+KITCTiOkWKf/BqblOKpDbCtJ+gkIbn6psKLyQAFa1J4PcgX22IJRbdL12 xoA5lANq0gVLIV00JYUDENjznkChNOOzsoQd9DIumEzAo3oivrbPobnQzmQwONwhu4Ow Ci+RuSRHka24lN2uZgIO8okkmGljtKAArHbAhh/W+tT87h8Bw8AT2KQ/4PjXzLAEQE3r EtDnBYQhjdl/tfhVfDKri5Ce1x19BVsxUWSVGGx0ZOHdXyd1dWOKL90mT1wPhO7MwXFf HJf2/k1/EFIRKBDLlLC7lLcnqAs0Mj2nx73hkkBl+oqSAF+AfPEwWR5d315F8Kbp1Oi3 GYZA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=/gLxdxuhis4lF5Y8nsFl8eRzcFmtXgy72e0rkfcmU60=; b=hLavnTQ8dbbBH+0s2PISlK5l8zZZIpCvYvT/e5G2XTeFWGj61+WX2fiIX0Hcw3zZ5y /NVICJqcaPkSG5hsbj8d69hU1WqyAtyY5Th6JeJb8vhi590enGXtBuGvlpiT9xc5hxRN e8gn48GIlxyc/EahZlZ93s6JHaw9lz6ejv8kr/oJ1F4F+v3pvQsNgBRxYbVl3UMNlOoW 0TeNOnJSJFueBoHXBn8EJC3OnRfIG6yxvJUVYR05ZGxvsh6xFRDTfUqKKmsgxhquJdLb xKo279UusrvL7PHJ/qiMAe6HwIL5+9ltcpA+K3EDhPJSfnC7L89aiiZ+eKUHrDUS5zmn 2e+g== X-Gm-Message-State: AOAM530HhZPxn8eqskVEi0Fdaxfeqazlxgc7QhOiDxSBhgo7vmGRtDGI bV8sYtB4LOkEzZvcvUBhaIYuusnFatAgbw== X-Received: by 2002:a63:4e65:: with SMTP id o37mr20221613pgl.202.1630304700324; Sun, 29 Aug 2021 23:25:00 -0700 (PDT) Received: from localhost.localdomain (174-21-72-39.tukw.qwest.net. [174.21.72.39]) by smtp.gmail.com with ESMTPSA id b12sm13942084pff.63.2021.08.29.23.24.59 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 29 Aug 2021 23:25:00 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH 11/48] tcg/optimize: Return true from tcg_opt_gen_{mov, movi} Date: Sun, 29 Aug 2021 23:24:14 -0700 Message-Id: <20210830062451.639572-12-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210830062451.639572-1-richard.henderson@linaro.org> References: <20210830062451.639572-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::536; envelope-from=richard.henderson@linaro.org; helo=mail-pg1-x536.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: , 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. Signed-off-by: Richard Henderson --- tcg/optimize.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) -- 2.25.1 Reviewed-by: Philippe Mathieu-Daudé diff --git a/tcg/optimize.c b/tcg/optimize.c index 39a65d305f..c4559d32be 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)