From patchwork Tue Feb 6 12:28:06 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aldy Hernandez X-Patchwork-Id: 197428 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:168b:b0:106:860b:bbdd with SMTP id ma11csp1502266dyb; Tue, 6 Feb 2024 04:29:16 -0800 (PST) X-Google-Smtp-Source: AGHT+IFpYtHwDOMlYGDMN2UR4n74be92wxSON20GkzXUrd4zdy/bi6qlEhON1ejTvsW/IU5Rq3wr X-Received: by 2002:a05:6214:268b:b0:68c:4e10:a713 with SMTP id gm11-20020a056214268b00b0068c4e10a713mr2532131qvb.17.1707222556448; Tue, 06 Feb 2024 04:29:16 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707222556; cv=pass; d=google.com; s=arc-20160816; b=PkDAXKS7G8wOAabUrEw6q4bgXM4evTrDj53g8yW/98Awa1y7bzl6i/0iJbrHAb1NtV s1p7R3ZgP0bwuqPn48UjRdPj+wXdQ6+H7/oOfVJhpYf9/QgKxO6JWzAnH/0e1dF/o2SN Evtyj9OZFLBpL33kVMoJvWQr7rZBN9cU2+3AUlwuc569y0xMNLhwTMes1+491MVNQjUq smbOFzPSXrV3Qh+FvSqZxrI5iMGkL3Kl0LJwnczsCjFvEYjyfehiwKjC1Y6Qkudt34iH ktKAS/VCS8H3s/n/bfeI31TndEaoD4kncCOrHPrO2pb75EYMKsYioqxCzSa2YBt/5yeQ Wl7Q== 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:message-id:date:subject:cc:to:from:dkim-signature :arc-filter:dmarc-filter:delivered-to; bh=pejFAsId39QFwN+UH7rAC3RvX2h5U/XKla6/WEcB+f0=; fh=g9siRIjtb5UTkCdFA7S9dWq1qRjmtMO3zg7o1yH4VxE=; b=chHhAywJv6THApy/N60Vk2bSsi622NfcoYWqyRLxvnuXwkmETvVYmrVzr8LakLeyLt MYHPKpLpNXueqO0XF3uTru4SWpZPVP40bEqqz75hMOce087vjLd2W1H0scrON8xG73Vy qeYA2mvBnC48AiUqtwpjfML1J86e3R/7G3RfMuT1ZynrKTqUoKtmKlcDcyrggQCXmprv SsJF5XxHMuuQbBUIUrARc8hVpt3b4Gk0FRhck+G+3kBIfEjF51Id/lAAk19xGG+zZq3n GGV2oYP/SWFH3oBiW6mp/q1xxaZKPggpWgEsmZsMJoFZSRbEl9lGFh5i/WWyyi/Xcdvg HfAA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=aHg1Z7bz; arc=pass (i=1); spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com X-Forwarded-Encrypted: i=1; AJvYcCWM2RykRPNHFTo+npB9qyrmLZZwhRfxA1rrql6cgiTDxbFH5/hfEURkm+5qg0RxcnX7CZid8Zqs9BwZGSPwA6ccbX6cTQ== Received: from server2.sourceware.org (server2.sourceware.org. [2620:52:3:1:0:246e:9693:128c]) by mx.google.com with ESMTPS id q17-20020a05620a0c9100b00783ebb7fa28si2132809qki.316.2024.02.06.04.29.16 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 06 Feb 2024 04:29:16 -0800 (PST) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@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=@redhat.com header.s=mimecast20190719 header.b=aHg1Z7bz; arc=pass (i=1); spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 29BF93858C42 for ; Tue, 6 Feb 2024 12:29:16 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from us-smtp-delivery-44.mimecast.com (us-smtp-delivery-44.mimecast.com [205.139.111.44]) by sourceware.org (Postfix) with ESMTPS id 3A16F3858D38 for ; Tue, 6 Feb 2024 12:28:35 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 3A16F3858D38 Authentication-Results: sourceware.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=none smtp.mailfrom=localhost.redhat.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 3A16F3858D38 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=205.139.111.44 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1707222517; cv=none; b=pRTttf27/Mf9sjfqFGqgM5djdtJux65QcDOCCSwqsuAYESOUUrhQ+Ux5JGdAOslDutcrBb+Djdj4vUAjOMwrghgd6f0+fAlHVcTRP88TRbAPF4yj8gb/Bp3JqcmprnJQtiCJ6lIEipJ46VZdiBtGZspazflfOGb6sD763oR9f50= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1707222517; c=relaxed/simple; bh=Bs4gydXYmAlysaFGZgAAYT+sBcVyZ4XPE4JR967wX2k=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=kQGK6riG040DJbAOOZ4coQJvGBNnskPss45nDDytbX4+5oXwrCQkV4pfsBzGaL3EUK55ClAce1eQ1M9rWX2rhGkSTVseMv2ibGaZZ/mcGbRRC7vnNQ7P6NRqs2OLmLy/Wa7+TNPLyAhI5dfFuxCg5V3aTGQoLGHFQzHrR72rsYs= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1707222514; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=pejFAsId39QFwN+UH7rAC3RvX2h5U/XKla6/WEcB+f0=; b=aHg1Z7bz4CsAfITpGnPNDMIJaf6s8t0sxcs4FqEmmNv3W5qfjsfg8rmeMDZ4oLvqU9Pec7 tMqMYsfMS6ZDty9YfpJUOBPpV/+h3o0yR5+BTmPDwQPAB+U7RAbd5iWYBjPpD3p5YCkqUH wAPubUeHwqdIO37Sqq9KpFR295k8ECg= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-490-L7TBcDH8O_GpNBPJRRjtfw-1; Tue, 06 Feb 2024 07:28:32 -0500 X-MC-Unique: L7TBcDH8O_GpNBPJRRjtfw-1 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 40EA8185A784 for ; Tue, 6 Feb 2024 12:28:32 +0000 (UTC) Received: from abulafia.quesejoda.com (unknown [10.39.194.216]) by smtp.corp.redhat.com (Postfix) with ESMTPS id EDB7E400D6D2; Tue, 6 Feb 2024 12:28:31 +0000 (UTC) Received: from abulafia.quesejoda.com (localhost [127.0.0.1]) by abulafia.quesejoda.com (8.17.2/8.17.1) with ESMTPS id 416CSTbI223887 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT); Tue, 6 Feb 2024 13:28:29 +0100 Received: (from aldyh@localhost) by abulafia.quesejoda.com (8.17.2/8.17.2/Submit) id 416CSTGd223886; Tue, 6 Feb 2024 13:28:29 +0100 From: Aldy Hernandez To: GCC patches Cc: Jakub Jelinek , Andrew MacLeod , Aldy Hernandez Subject: [PATCH] ranger: Grow BBs in relation oracle as needed [PR113735] Date: Tue, 6 Feb 2024 13:28:06 +0100 Message-ID: <20240206122820.223856-1-aldyh@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.2 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-Spam-Status: No, score=-12.1 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, NO_DNS_FOR_FROM, RCVD_IN_DNSWL_LOW, SPF_HELO_NONE, SPF_NONE, 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+ouuuleilei=gmail.com@gcc.gnu.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1790152599358108204 X-GMAIL-MSGID: 1790152599358108204 The relation oracle grows the internal vector of SSAs as needed, but due to an oversight was not growing the basic block vector. This fixes the oversight. OK for trunk? PR tree-optimization/113735 gcc/testsuite/ChangeLog: * gcc.dg/tree-ssa/pr113735.c: New test. gcc/ChangeLog: * value-relation.cc (equiv_oracle::add_equiv_to_block): Call limit_check(). --- gcc/testsuite/gcc.dg/tree-ssa/pr113735.c | 19 +++++++++++++++++++ gcc/value-relation.cc | 1 + 2 files changed, 20 insertions(+) create mode 100644 gcc/testsuite/gcc.dg/tree-ssa/pr113735.c diff --git a/gcc/testsuite/gcc.dg/tree-ssa/pr113735.c b/gcc/testsuite/gcc.dg/tree-ssa/pr113735.c new file mode 100644 index 00000000000..7b864999277 --- /dev/null +++ b/gcc/testsuite/gcc.dg/tree-ssa/pr113735.c @@ -0,0 +1,19 @@ +// { dg-do compile { target bitint } } +// { dg-options "-O1" } + +char b; +void bar (void); + +#if __BITINT_MAXWIDTH__ >= 6110 +void +foo (_BitInt(6110) j) +{ + for (;;) + { + _BitInt(10) k = b % j; + for (j = 6; j; --j) + if (k) + bar (); + } +} +#endif diff --git a/gcc/value-relation.cc b/gcc/value-relation.cc index 27f9ad61c0e..619ee5f0867 100644 --- a/gcc/value-relation.cc +++ b/gcc/value-relation.cc @@ -718,6 +718,7 @@ equiv_oracle::add_equiv_to_block (basic_block bb, bitmap equiv_set) // Check if this is the first time a block has an equivalence added. // and create a header block. And set the summary for this block. + limit_check (bb); if (!m_equiv[bb->index]) { ptr = (equiv_chain *) obstack_alloc (&m_chain_obstack,