From patchwork Tue Dec 25 20:55:25 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 154496 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp5220465ljp; Tue, 25 Dec 2018 13:15:53 -0800 (PST) X-Google-Smtp-Source: ALg8bN6/gpQLmgzXkqyYg7USvjZdzZ84Skgifhl59o9K7NwEB6+BoiZV5DQ/X9bZi+zKqYWSxIx1 X-Received: by 2002:a37:b046:: with SMTP id z67mr15454932qke.350.1545772553398; Tue, 25 Dec 2018 13:15:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1545772553; cv=none; d=google.com; s=arc-20160816; b=LubmhZ5bGfYb9Y9MBuyDdSUELT1KzelEeT8dBxSxU2QN3olsOL9lPRjhH0oOlfxQGH 9lzgTJWTOoenmVtPQqXz8nkOOOp7lhID9aItzPOgON1HTd3ONzq8ckxyRAlqvXfVbh+r X5olPesYsrHUMI42Muf0QXy/Z68uqH7Se9YAuV+t0YsH4B+CEWqBVeF3M1eKfpxijNSQ N6R/BZLH3YlGN+hg/ABzZhNUfswJFn5gYKxltjEsLGOpprYhycIXbvSVoj0RIZq4KORi VvYMDuwUdsiwc34OFCZHoFBjslIMVNlCG909kvVQhf9F0+IqqwWY1EYut9KZOJVi0t16 +Zzw== 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:subject:references:in-reply-to :message-id:date:to:from:dkim-signature; bh=f1eNLoLfzIylj7d+DzCt9Q14jk93QTgafI861tAZf3Q=; b=onK8BWcF2NqzwaKvprrVy7h8Uc6qTnrh8eY+yI1IdzaXcQ/ylZJPcOV6v4Qj/UY4i7 7KuuK/i1pt8K14jGRO+plm9/eGrt6vHQPbCqP2Z04xRV0ev5wRCtIMtHduC80lNKBR3O HtdT4LJCDWlD8i4peCdnX8gN5NcUxiUeyXQHij1FyzutM1t/h2+LuVmedax7iICx1g+j yOBuSQ13mOnfM3tifRgkgpYP8P0B7jpjPrA95BSW5Tz+YwmoAEXqckbkXs8umKv5TNY0 cQhRIVwNWcEU/RVXUuhwBTDfgLYhHkytz0TkAK8boI5soRnLq79QYbrmfKCODZrl/K6I sK4g== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=Zi4N+J6e; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 208.118.235.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. [208.118.235.17]) by mx.google.com with ESMTPS id o57si7331013qtf.75.2018.12.25.13.15.53 for (version=TLS1 cipher=AES128-SHA bits=128/128); Tue, 25 Dec 2018 13:15:53 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=Zi4N+J6e; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 208.118.235.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 ([127.0.0.1]:43192 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gbu3M-00047A-LW for patch@linaro.org; Tue, 25 Dec 2018 16:15:52 -0500 Received: from eggs.gnu.org ([208.118.235.92]:50874) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gbto0-0008RC-2Y for qemu-devel@nongnu.org; Tue, 25 Dec 2018 16:00:03 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gbtnz-0001td-65 for qemu-devel@nongnu.org; Tue, 25 Dec 2018 16:00:00 -0500 Received: from mail-pl1-x635.google.com ([2607:f8b0:4864:20::635]:46011) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gbtnz-0001st-00 for qemu-devel@nongnu.org; Tue, 25 Dec 2018 15:59:59 -0500 Received: by mail-pl1-x635.google.com with SMTP id a14so6793488plm.12 for ; Tue, 25 Dec 2018 12:59:58 -0800 (PST) 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; bh=f1eNLoLfzIylj7d+DzCt9Q14jk93QTgafI861tAZf3Q=; b=Zi4N+J6eW4m0FvLFoAgF2xBHiYwlnnsvdDK8i9N50cVwo1MA7D1X6husHkKITWxoE2 nNSVyD/CNrbWTowjFBPEjvzRo8BdWl4RcROhZjsYOHcMDx9MPnLCXH7Rub4TCWYXYweo dvc6+fKEIr99L7KNLAag3aP5DKf372DQUSOn0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=f1eNLoLfzIylj7d+DzCt9Q14jk93QTgafI861tAZf3Q=; b=Jts1TPXO0L2vxdpKE+bcn5DY3fXReTU/ZDKpMJAxzPdiCAyAWt1zxZiFrLW55dMMCI xfvlv9yEumZJq7eQAuIwxG93vujJTD73jDVhT70/trEaSBnastX5rNrh1Ins/IlKa124 y31fjiw47mKmY27WwR+M0sqiJXILaecYBpWtTiKQv0EcOjXR9oocTzWzYN51oD47T398 BUQ9QTK4q5M/hRuTqOapP+xRsvlf6HdirEOVv+MuQnXFfaLX/9ZXsFkHuTYx9p3/IE9a ezYh0dUZ2K81F/RW7msoK0r5bb/Na1sgGQxHbrJGc4gHFMzt74zq1r6V1/b06VJpbZtM /LeA== X-Gm-Message-State: AJcUukd41sSjY5FMyOBDA/CrQsTrR9vUAQvqHX8XKsD5ATq0tmaGIOT7 A98fVMA8AcS5KhjdQrbvbeCtdrfBWds= X-Received: by 2002:a17:902:2dc3:: with SMTP id p61mr17181889plb.166.1545771597755; Tue, 25 Dec 2018 12:59:57 -0800 (PST) Received: from cloudburst.home (c211-28-135-144.sunsh3.vic.optusnet.com.au. [211.28.135.144]) by smtp.gmail.com with ESMTPSA id t21sm48501628pgg.24.2018.12.25.12.59.53 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 25 Dec 2018 12:59:57 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Date: Wed, 26 Dec 2018 07:55:25 +1100 Message-Id: <20181225205529.10874-39-richard.henderson@linaro.org> X-Mailer: git-send-email 2.17.2 In-Reply-To: <20181225205529.10874-1-richard.henderson@linaro.org> References: <20181225205529.10874-1-richard.henderson@linaro.org> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::635 Subject: [Qemu-devel] [PULL 38/42] tcg: Rename and adjust liveness_pass_1 helpers X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: peter.maydell@linaro.org Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" No need for a "tcg_" prefix for a static function; we already have another "la_" prefix for indicating liveness analysis. Pass in nb_globals and nb_temps, as we will already have them in registers for other loops within the parent function. Reviewed-by: Emilio G. Cota Signed-off-by: Richard Henderson --- tcg/tcg.c | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) -- 2.17.2 diff --git a/tcg/tcg.c b/tcg/tcg.c index 696a45f7f8..0afc6ba1e6 100644 --- a/tcg/tcg.c +++ b/tcg/tcg.c @@ -2367,10 +2367,8 @@ static void reachable_code_pass(TCGContext *s) /* liveness analysis: end of function: all temps are dead, and globals should be in memory. */ -static void tcg_la_func_end(TCGContext *s) +static void la_func_end(TCGContext *s, int ng, int nt) { - int ng = s->nb_globals; - int nt = s->nb_temps; int i; for (i = 0; i < ng; ++i) { @@ -2383,10 +2381,8 @@ static void tcg_la_func_end(TCGContext *s) /* liveness analysis: end of basic block: all temps are dead, globals and local temps should be in memory. */ -static void tcg_la_bb_end(TCGContext *s) +static void la_bb_end(TCGContext *s, int ng, int nt) { - int ng = s->nb_globals; - int nt = s->nb_temps; int i; for (i = 0; i < ng; ++i) { @@ -2405,9 +2401,10 @@ static void tcg_la_bb_end(TCGContext *s) static void liveness_pass_1(TCGContext *s) { int nb_globals = s->nb_globals; + int nb_temps = s->nb_temps; TCGOp *op, *op_prev; - tcg_la_func_end(s); + la_func_end(s, nb_globals, nb_temps); QTAILQ_FOREACH_REVERSE_SAFE(op, &s->ops, TCGOpHead, link, op_prev) { int i, nb_iargs, nb_oargs; @@ -2602,7 +2599,7 @@ static void liveness_pass_1(TCGContext *s) /* if end of basic block, update */ if (def->flags & TCG_OPF_BB_END) { - tcg_la_bb_end(s); + la_bb_end(s, nb_globals, nb_temps); } else if (def->flags & TCG_OPF_SIDE_EFFECTS) { /* globals should be synced to memory */ for (i = 0; i < nb_globals; i++) {