From patchwork Thu Oct 21 21:04:57 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 516077 Delivered-To: patch@linaro.org Received: by 2002:ac0:bf50:0:0:0:0:0 with SMTP id o16csp332624imj; Thu, 21 Oct 2021 14:16:05 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyGJagWVO7vliyWPEaV/YYULwk0SyakkSvEczcoAuW0YuIjgoSS++d1wDuDOqw0xzcfQIKB X-Received: by 2002:aca:5bd6:: with SMTP id p205mr6060257oib.35.1634850965854; Thu, 21 Oct 2021 14:16:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634850965; cv=none; d=google.com; s=arc-20160816; b=pAzbOB+0UBRBk76Fe315YQIaz1NlGqLEv5zd8ctFElscbflIa7DKXjcTU6ZnMICyNm MdGScH/v2B+Hqr86ejoQtemSjdRHAtJRHt+CnUwmcUBRNH0kdHIYz83OzTLyI10TJ9Na tuN8i2MizyObq53C3jPP0kUA5zTgkaY12hWOIq5QlTWFnwO43A7cQEabUyklhOoJ2DEZ a7LyqV/mIldtaeDjqobn98nJiCWs8Kaj/Obo3uKJinBUYl8nULO/BXn/y3xhlZBjJIyP QpcHxE2gASu4mkrJ5kRyUb4kRbamLlgrk2wLDrJwqOGjyigHF9EYgz94uiLSZpZFdVVb yRCQ== 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=WL784dDelb2n11jVqBh0M/kFnuIJJZnBgr5d6GB5NwI=; b=HC/aBilK1IjrilUJldx8R+CHd/OCU0bXo/j7JuzxT0btmWDJskRHg2RKWzyaeeSHk3 40FYttGDxCcYtFxbUPo/YTdyCF4AAu71wgY0KB/DfPLDuTGeTOxh5zVBDT4g2RIO3N45 FPUUo6+kM3208o6Ej43LsUDsxXNOqBYYWrDvQEtFnwNKpmGfLL+W1UumdnUvw3bsl0YC u7rlC3EGYQ5DHH05zM//F8YLHjuOqcsXqbqaQRz2/jWZJXX/Yf0epoKTyWzU10hRkBHq QSeNVzevu6SCmlvI4KHG5W7M0B71jHDR2qr1PnQrDa1vORJZigUlgIwzO+kdyGdowFvG ztCw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=o+4VwUGN; 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 f22si8914599oti.113.2021.10.21.14.16.05 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 21 Oct 2021 14:16:05 -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=o+4VwUGN; 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]:34958 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mdfPw-0002uC-4o for patch@linaro.org; Thu, 21 Oct 2021 17:16:04 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:48198) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mdfG0-0007Lr-V4 for qemu-devel@nongnu.org; Thu, 21 Oct 2021 17:05:50 -0400 Received: from mail-pf1-x430.google.com ([2607:f8b0:4864:20::430]:43683) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mdfFz-0004Ai-CJ for qemu-devel@nongnu.org; Thu, 21 Oct 2021 17:05:48 -0400 Received: by mail-pf1-x430.google.com with SMTP id 187so1740137pfc.10 for ; Thu, 21 Oct 2021 14:05:46 -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=WL784dDelb2n11jVqBh0M/kFnuIJJZnBgr5d6GB5NwI=; b=o+4VwUGNeGhwSx8oa9IEgXhF+l2DIrUA0F3msQm23RheJUISRjECD0DIiqppMSItvX d431NUEvyGitkCifYXBdbofLv7SVAbmi9h7Cb+cvZrzJmkQXoZIhYSn7e6FdLoOYa6PK 4Vvx+pP3wMGJU+D6NI2I3oMGRvg/ba0JbZfgKQ2IPorFm8LKpcZ7OIc/6fDaEYgVW3MR 1pvKqmD7EiZb14a/AU1m3QVheUP8PdjWYk+vqdNg5wCrhIEHwp19NcOoYHWijbnzJQ9B NMCEVbDnfKv5+XFPzCqJgC9OHFgF99m2k0ddyaUo0GeChi2eMFO1pYjDAeuub1vI8ypm 4R0g== 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=WL784dDelb2n11jVqBh0M/kFnuIJJZnBgr5d6GB5NwI=; b=QOVgM4GaFnv9DVB/TDlAaCFRdlNSBQXWKBBYJUzPt29Ik0ODPCtyCVv/pRwrAFiHFw VIyFwFPrC45cjtR/tFr7hrJj9k8vQc6Im2Or65in+yaXQyJuERgQiH/eXC8HBF7J/mBb oNaCPTlAWzUtNFz5parmxyp6eaxZO+AjrHdQAroezoS3BF07SPW6+sguqeC3kP6iB54W fEvsRh5EE8KdRq189bLHiX/ymSwjHA7b9k2m+UGHtNVDQHLIL7G1q/IOBBITRpa2JUoE fLft4Hrw5tDhiIFbDmZ7WL58njt3CSvnDdesww1UvGHIT0bcxfABC+n6qjlDBMLZbjQ2 5+Qg== X-Gm-Message-State: AOAM531d/OoJIaMHFBnDBvN62l6ff7ILWb1ClyVIKIMjaVc/8VHIPxEZ HbNGT1GflXZlxMRLfeA6EoPHopeDJqi19Q== X-Received: by 2002:aa7:9ec6:0:b0:44d:6650:c1ff with SMTP id r6-20020aa79ec6000000b0044d6650c1ffmr8165414pfq.15.1634850345046; Thu, 21 Oct 2021 14:05:45 -0700 (PDT) Received: from localhost.localdomain ([71.212.134.125]) by smtp.gmail.com with ESMTPSA id g7sm5981670pgp.17.2021.10.21.14.05.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Oct 2021 14:05:44 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v3 06/48] tcg/optimize: Split out init_arguments Date: Thu, 21 Oct 2021 14:04:57 -0700 Message-Id: <20211021210539.825582-7-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::430; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x430.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" 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. Reviewed-by: Alex Bennée Reviewed-by: Luis Pires Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- tcg/optimize.c | 25 +++++++++++-------------- 1 file changed, 11 insertions(+), 14 deletions(-) -- 2.25.1 diff --git a/tcg/optimize.c b/tcg/optimize.c index b875d76354..019c5aaf81 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++) {