From patchwork Wed Nov 22 11:14:13 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxim Kuvyrkov X-Patchwork-Id: 746016 Delivered-To: patch@linaro.org Received: by 2002:a5d:6706:0:b0:32d:baff:b0ca with SMTP id o6csp239800wru; Wed, 22 Nov 2023 03:16:00 -0800 (PST) X-Google-Smtp-Source: AGHT+IG5yVO1JWwbHW73j+O1WPc4Dd5FC5S+5mfhZjyVN9ilNI7Cvkha/akeaszRXrNs+csZfq0j X-Received: by 2002:a05:6808:124c:b0:3b5:66af:f8d6 with SMTP id o12-20020a056808124c00b003b566aff8d6mr2451814oiv.47.1700651760267; Wed, 22 Nov 2023 03:16:00 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1700651760; cv=pass; d=google.com; s=arc-20160816; b=tUO+xePHdg3JC01c+DjjGMgtuTia/ny3weiy8XH1eQSQ7gsk9l9lDo9OHWJUTq1NRi xpRpd5wIJsl4ddft1D/0nkU5kzjSTfFeGKxoOBhsMzFbbT/ZuPpk0FsFQDCAS/rs4Lk+ 0WeXnng/pjc9EgL6/W503+rJawQUgJo8GcSStSxAnryCus9F+0HObXrsNmCa1hcSvK+e vakGfC1VcOe2/Jb47yLa2wKuDKQZA81rU8GOO5X7Pcz3cVFhHGGSBbpYXbW1oFz7NsUI rV/q7/io+TXoj6vmTyai2wa6lTSRq/vxIKNRoAIjof7YO+efXm4ajPDu2fXSeIkgeVdQ sAug== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=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:cc:to :from:dkim-signature:arc-filter:dmarc-filter:delivered-to; bh=pCSVbEO/BeCpr3HmKemgKgCd7aACwKRmYYL8UJxMo/8=; fh=WFm8hI3He6vfed9bNVx/Tt8MS1NEGxq9c34GiEnOLuU=; b=e0EACiZO7ZaE+VNrj/gdiqwr6cpOkpGNGH/FL2aYgeZzQSbG91893BIJWFqEKY5b3P QG24EHZAOtRcLUWK44UvIuOyBM5hq+bfICxzvO2BjVo3SyTF+qJ0VEEWfDf9+gUO+Scr lmYsSF7xwxc7wEyjJ+dIsdt5TKj4XGRkmUwcAeOqrV91ULDmM+svRX7uDo75FofQiL3I tIObMs0+2LJHD2fxVpAPzkFW5cmvtPFlYupUwLEaZo7RMPHo1A+83FgqtrLQjjyWrIGd jZagCn0FZ1fr0TgIwX12VCxJ7OAWE6yzZdc/bpBM4oRsdWc/40uIGhjkR72PY1NYWS7V PSQw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=b9lY4020; arc=pass (i=1); spf=pass (google.com: domain of gcc-patches-bounces+patch=linaro.org@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="gcc-patches-bounces+patch=linaro.org@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from server2.sourceware.org (server2.sourceware.org. [2620:52:3:1:0:246e:9693:128c]) by mx.google.com with ESMTPS id c19-20020a05620a201300b0077435f2b668si10624226qka.207.2023.11.22.03.16.00 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 22 Nov 2023 03:16:00 -0800 (PST) Received-SPF: pass (google.com: domain of gcc-patches-bounces+patch=linaro.org@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) client-ip=2620:52:3:1:0:246e:9693:128c; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=b9lY4020; arc=pass (i=1); spf=pass (google.com: domain of gcc-patches-bounces+patch=linaro.org@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="gcc-patches-bounces+patch=linaro.org@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 98AC5385AC22 for ; Wed, 22 Nov 2023 11:15:59 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-lf1-x12e.google.com (mail-lf1-x12e.google.com [IPv6:2a00:1450:4864:20::12e]) by sourceware.org (Postfix) with ESMTPS id 59A6038582A2 for ; Wed, 22 Nov 2023 11:15:03 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 59A6038582A2 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=linaro.org ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 59A6038582A2 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2a00:1450:4864:20::12e ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1700651705; cv=none; b=r8X6y8TOcEQ6ZW+dEfw01l0hkXRuflmH71Km6ENOD5CIW7uz24MV3XBH2Pfv953oLY7cpaq51gnyivNLxk/ENZxL09n74dXHTUoL9luO/Jo0LycWmlrvBEEray/ZOJzNjh6C7nHUASt3Vsnjwc/tIdZdc/XRfdp3QESfJw2c37U= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1700651705; c=relaxed/simple; bh=5NP/NsqWSfRZ7KB1p2irswvHSP/cInbQ/1sqrEOvuEc=; h=DKIM-Signature:From:To:Subject:Date:Message-Id:MIME-Version; b=tn8SJR8rPHxbtNeFSVIgK0pn3xg7j3g0FK8vQc0R2A+YPPoezkkRTl23rp6hg065st/p036mUhVHIcTh+NJNtAQt3WRyNrJCNhUt7W6yMH46PW1JojLfHJv6sBTIuh1KjeONDGSL1SUzClL8kpx7rw1NDMVTPu6sOS3K/xVyhP4= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-lf1-x12e.google.com with SMTP id 2adb3069b0e04-507f63fcbf6so1637766e87.1 for ; Wed, 22 Nov 2023 03:15:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1700651701; x=1701256501; darn=gcc.gnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=pCSVbEO/BeCpr3HmKemgKgCd7aACwKRmYYL8UJxMo/8=; b=b9lY4020zflQb4M/m/fvAxqrNtis13svSSQzsWlgdZcx50Gh+SaUlX8+SMZqskj1qj C4MwO65QV/yUlt9AKnADdtpF82GQ4dUWa26EGw5ioLVBlAOt0koRhcD7fWGKUfxNNBey rjAI1xnd8WW2l3nFdHXtt3PohsdDeqlFXAcK1S+8gOx/DfKO9Xxn5FajbmxdjRLJ6PqK K3KxO0/9fVXWdK5TuX+0ngIb5MUj+UdWr3YlNiydhuMUmPcQezmkkrTeFDuB9/jPXL54 PQpjcpXrYMyIGuA/R9yd4DbzxAfC9ouDdf3BLZk7sOgGylkwtMeBmmZ1HQGhuCfBS2M7 yyJA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1700651701; x=1701256501; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=pCSVbEO/BeCpr3HmKemgKgCd7aACwKRmYYL8UJxMo/8=; b=wiw+gjkQRujs1SgNjfvtzpLja/wJpw5l4H5+zh0w3id0Pf4W1TBtI+kluuSn5TeQXA qiikt0lSwC7v3G9PxpnAPjLMcYzahkpA2PlOh142GwsbYvq7+Fokvgaod/c8wh+aSpnT 0joG8yQN9i3bNBrVpqzR2nOezDc0ck0o9hKWg8itPshc/NxIgBTVhn3Z8a7gOUKfgWwJ W2at91ZXIOHX4J2TdSri76Zpdlv8tHkN+7jnMqGNvRFqKhZ/nb632XwWSYbV1fEzJso+ R/hJqBtZ/0ezR/DcEZbU9wObfLCHiUwoXTAmBSiXm7UiYDs9xssR7GQsdkBu911PQ2nC 8oEw== X-Gm-Message-State: AOJu0YyFsRp1Jufje4nvGTsbQgoMjIcovMkbVXMZkWvBRfyBhezR7WOV x7N0L34ySoikqzc1ZiYnSs3c6Htfx3DbzAkFunWCM9I= X-Received: by 2002:a05:6512:485b:b0:50a:7806:d0db with SMTP id ep27-20020a056512485b00b0050a7806d0dbmr1010887lfb.4.1700651701254; Wed, 22 Nov 2023 03:15:01 -0800 (PST) Received: from localhost.localdomain (static.225.72.216.95.clients.your-server.de. [95.216.72.225]) by smtp.gmail.com with ESMTPSA id t13-20020a195f0d000000b0050919538b00sm1848553lfb.79.2023.11.22.03.14.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 22 Nov 2023 03:14:59 -0800 (PST) From: Maxim Kuvyrkov To: gcc-patches@gcc.gnu.org Cc: Maxim Kuvyrkov , Bernd Schmidt , Vladimir Makarov , Jeff Law , Alexander Monakov , Richard Guenther Subject: [PATCH v3 6/8] sched_deps.cc: Simplify initialization of dependency contexts Date: Wed, 22 Nov 2023 11:14:13 +0000 Message-Id: <20231122111415.815147-7-maxim.kuvyrkov@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231120120649.672893-1-maxim.kuvyrkov@linaro.org> References: <20231120120649.672893-1-maxim.kuvyrkov@linaro.org> MIME-Version: 1.0 X-Spam-Status: No, score=-12.0 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces+patch=linaro.org@gcc.gnu.org gcc/ChangeLog: * sched-deps.cc (init_deps, init_deps_reg_last): Simplify. (free_deps): Remove useless code. --- gcc/sched-deps.cc | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/gcc/sched-deps.cc b/gcc/sched-deps.cc index 2a87158ba4b..e0d3c97d935 100644 --- a/gcc/sched-deps.cc +++ b/gcc/sched-deps.cc @@ -3927,10 +3927,9 @@ init_deps (class deps_desc *deps, bool lazy_reg_last) int max_reg = (reload_completed ? FIRST_PSEUDO_REGISTER : max_reg_num ()); deps->max_reg = max_reg; - if (lazy_reg_last) - deps->reg_last = NULL; - else - deps->reg_last = XCNEWVEC (struct deps_reg, max_reg); + deps->reg_last = NULL; + if (!lazy_reg_last) + init_deps_reg_last (deps); INIT_REG_SET (&deps->reg_last_in_use); deps->pending_read_insns = 0; @@ -3961,9 +3960,7 @@ init_deps (class deps_desc *deps, bool lazy_reg_last) void init_deps_reg_last (class deps_desc *deps) { - gcc_assert (deps && deps->max_reg > 0); - gcc_assert (deps->reg_last == NULL); - + gcc_assert (deps && deps->max_reg > 0 && deps->reg_last == NULL); deps->reg_last = XCNEWVEC (struct deps_reg, deps->max_reg); } @@ -4013,8 +4010,6 @@ free_deps (class deps_desc *deps) it at all. */ free (deps->reg_last); deps->reg_last = NULL; - - deps = NULL; } /* Remove INSN from dependence contexts DEPS. */