From patchwork Mon Aug 30 06:24:09 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 504298 Delivered-To: patch@linaro.org Received: by 2002:a02:8629:0:0:0:0:0 with SMTP id e38csp1515002jai; Sun, 29 Aug 2021 23:35:53 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxCjVjis4cL37e14XkBnuX9gJk1mPRzVjHs7dizdU+UEXHfTptUDPiu8aNyroLB1nGEd0mG X-Received: by 2002:a25:850c:: with SMTP id w12mr5381432ybk.203.1630305353874; Sun, 29 Aug 2021 23:35:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1630305353; cv=none; d=google.com; s=arc-20160816; b=ysJ8tVFOeX0JBGpWghGjCZc9nWyzTPo3ZWHXBhJLPWQn5J1/hwj74gFidR71mK3bBO WJEDHcUQ/Cta8dxW7wotOmNNgfbSQsvXa68i42vZSyrcKWd+Ltr93XpHRJNaw9sAaXGr jJQNLjqBAHPPeyPPWccMkO9l2IKggcPThZh2rfP19GrF/ngSnDdaskgbW+uSq4uzuhj7 lEJy0h33DJ/VR/o962wAKwKN0M229RDctMLNDMtAy5HJhkcmiSwh2LyBRUIGmCOB9RJm pfH7dA6m7SpqVBqcHv0o5GLeZb87CZ7fOjU/Usahq/y11kWkCjkmcUiTF2nz6LRbFplc hvCA== 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=2EfP401+oKK/BT8GAuF1m4dvvh+53+sjFVE7rzdniuM=; b=xWF41O1g9PrIstfiJk/0ISdjOaKI+XY/H6vjNZtDeTNP5ZdZU1nlA4YvV5GPJoGbdD AQKhfnLdKBPsvpdix+nQ3Dj6LGSFSLNvSeFi06nXaotHPc8PcutnotknZr7aElbpaWiR iHUxrA3qIV9PitDSFkXYzeVaOYMDJ1/Ar2h2tGNgHN3PstfDXCQsN1IQoIwkmZhQUCPq m8913/YymeJPYyH/4tauO8pZVNrNDztSEavSm5HFVMGEetfTGmAMSQeTT8YFOO3VcANt VA9KYae4iAtz+eq0VOpHO3NS9xjuiCrpJvf25vXgWV/uPfVyKyLNlLPD+ajPAyWEFXSG ZriA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=XdGE+iOf; 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 r1si14758497ybo.54.2021.08.29.23.35.53 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sun, 29 Aug 2021 23:35:53 -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=XdGE+iOf; 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]:56596 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mKatd-0004pZ-AJ for patch@linaro.org; Mon, 30 Aug 2021 02:35:53 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:46182) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mKaj6-0003aq-Cr for qemu-devel@nongnu.org; Mon, 30 Aug 2021 02:25:00 -0400 Received: from mail-pg1-x52e.google.com ([2607:f8b0:4864:20::52e]:33782) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mKaj4-0007Q8-Kr for qemu-devel@nongnu.org; Mon, 30 Aug 2021 02:25:00 -0400 Received: by mail-pg1-x52e.google.com with SMTP id c17so12473066pgc.0 for ; Sun, 29 Aug 2021 23:24:58 -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=2EfP401+oKK/BT8GAuF1m4dvvh+53+sjFVE7rzdniuM=; b=XdGE+iOfoH3j289/MCgqmsHGUcjO9mCiqbwkQyA+i8o+joavIpFJIGJcht4SiWqVUu qw6pRMATTTso++zB69wmLKBLCId7AIdeZTjCOquT8p5sB+Xs26qClSzojULPHSWaJxrN hcNPr9bG184r5i1bXg3RRpwmv3REP/Kz4Sxv2Kjc0Q+2WSj3lS41QokHocFbu+ev0rcr Y4y+1vaF2lHAt0jDS4GDEwRBqLqP9OWbvvwbnSt6huXuaED3mjnox/g6rNjDa/RmSbY0 U8lROgPQ/7xQyz5p0ngFxLz2TvEq5ukFXZi9x5xLru8W+XiV2m1in9niq1tSUwTQiOit QmGQ== 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=2EfP401+oKK/BT8GAuF1m4dvvh+53+sjFVE7rzdniuM=; b=r84lobc3EvtRe6xKZ2c5S4oexw4RIBMK/HIXcS1D6T/wGoYK/nvf1xXXVVwe/FmrWy upu7haXBxTxojeSMdF3P5Ijz4P52mNWPlt4YryolDWG4KuIZRhFumA/fj4vrGsV5Ryr0 2uoeg5lyj137Vx1HTTqcDZWaPL9bheXYWIM3rAQ1d2HP3S4jqS3d5Mw+7/EECLCuTrF2 GLHVn+nW1jQEAQWp29OLCGLmHk9s/zLX/jzg5ivVN/eVhmtZB4Y6b06zoTKXuoqjnfbd K6D7EpHqepLYVbU9WqgEWmleZ0le8oxCWId+ek/OZAgtpxRAcx1gzr+j1WG+y4B8KslS FnMA== X-Gm-Message-State: AOAM531yiy4m/1c20qk1m6Qq1+7o7vfXQcZaw5yEcYmABN7nreX415GL Df218dkgnv5QxBehFxWn91p5R61qjJR/Ww== X-Received: by 2002:a63:1309:: with SMTP id i9mr13245489pgl.192.1630304697271; Sun, 29 Aug 2021 23:24:57 -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.56 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 29 Aug 2021 23:24:57 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH 06/48] tcg/optimize: Split out init_arguments Date: Sun, 29 Aug 2021 23:24:09 -0700 Message-Id: <20210830062451.639572-7-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::52e; envelope-from=richard.henderson@linaro.org; helo=mail-pg1-x52e.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" There was no real reason for calls to have separate code here. Unify init for calls vs non-calls using the call path, which handles TCG_CALL_DUMMY_ARG. Signed-off-by: Richard Henderson --- tcg/optimize.c | 25 +++++++++++-------------- 1 file changed, 11 insertions(+), 14 deletions(-) -- 2.25.1 Reviewed-by: Philippe Mathieu-Daudé diff --git a/tcg/optimize.c b/tcg/optimize.c index 87f33521ad..b1b5096a9d 100644 --- a/tcg/optimize.c +++ b/tcg/optimize.c @@ -128,11 +128,6 @@ static void init_ts_info(OptContext *ctx, TCGTemp *ts) } } -static void init_arg_info(OptContext *ctx, TCGArg arg) -{ - init_ts_info(ctx, arg_temp(arg)); -} - static TCGTemp *find_better_copy(TCGContext *s, TCGTemp *ts) { TCGTemp *i, *g, *l; @@ -606,6 +601,16 @@ static bool swap_commutative2(TCGArg *p1, TCGArg *p2) return false; } +static void init_arguments(OptContext *ctx, TCGOp *op, int nb_args) +{ + for (int i = 0; i < nb_args; i++) { + TCGTemp *ts = arg_temp(op->args[i]); + if (ts) { + init_ts_info(ctx, ts); + } + } +} + /* Propagate constants and copies, fold constant expressions. */ void tcg_optimize(TCGContext *s) { @@ -636,19 +641,11 @@ void tcg_optimize(TCGContext *s) if (opc == INDEX_op_call) { nb_oargs = TCGOP_CALLO(op); nb_iargs = TCGOP_CALLI(op); - for (i = 0; i < nb_oargs + nb_iargs; i++) { - TCGTemp *ts = arg_temp(op->args[i]); - if (ts) { - init_ts_info(&ctx, ts); - } - } } else { nb_oargs = def->nb_oargs; nb_iargs = def->nb_iargs; - for (i = 0; i < nb_oargs + nb_iargs; i++) { - init_arg_info(&ctx, op->args[i]); - } } + init_arguments(&ctx, op, nb_oargs + nb_iargs); /* Do copy propagation */ for (i = nb_oargs; i < nb_oargs + nb_iargs; i++) {