From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by sourceware.org (Postfix) with ESMTP id A8E0A385842E for ; Tue, 21 Sep 2021 16:54:12 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org A8E0A385842E Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-564-N6x_K18WOZWBCUs8uFPp8Q-1; Tue, 21 Sep 2021 12:54:10 -0400 X-MC-Unique: N6x_K18WOZWBCUs8uFPp8Q-1 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id E9CFF84A5E1; Tue, 21 Sep 2021 16:54:09 +0000 (UTC) Received: from abulafia.quesejoda.com (unknown [10.39.192.248]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 695B360C5F; Tue, 21 Sep 2021 16:54:03 +0000 (UTC) Received: from abulafia.quesejoda.com (localhost [127.0.0.1]) by abulafia.quesejoda.com (8.16.1/8.15.2) with ESMTPS id 18LGs1SG414663 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT); Tue, 21 Sep 2021 18:54:01 +0200 Received: (from aldyh@localhost) by abulafia.quesejoda.com (8.16.1/8.16.1/Submit) id 18LGs1jH414662; Tue, 21 Sep 2021 18:54:01 +0200 From: Aldy Hernandez To: Andrew MacLeod Cc: GCC patches , Jeff Law , Aldy Hernandez Subject: [PATCH 1/7] Allocate non_null_ref tables at creation. Date: Tue, 21 Sep 2021 18:53:44 +0200 Message-Id: <20210921165350.414593-2-aldyh@redhat.com> In-Reply-To: <20210921165350.414593-1-aldyh@redhat.com> References: <20210921165350.414593-1-aldyh@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="US-ASCII" X-Spam-Status: No, score=-13.8 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_NONE, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Sep 2021 16:54:13 -0000 Preallocating the space is slightly cheaper than calling safe_grow_cleared. Committed. gcc/ChangeLog: * gimple-range-cache.cc (non_null_ref::non_null_ref): Use create and quick_grow_cleared instead of safe_grow_cleared. --- gcc/gimple-range-cache.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gcc/gimple-range-cache.cc b/gcc/gimple-range-cache.cc index fbf0f95eef9..b856b212169 100644 --- a/gcc/gimple-range-cache.cc +++ b/gcc/gimple-range-cache.cc @@ -37,8 +37,8 @@ along with GCC; see the file COPYING3. If not see non_null_ref::non_null_ref () { - m_nn.create (0); - m_nn.safe_grow_cleared (num_ssa_names); + m_nn.create (num_ssa_names); + m_nn.quick_grow_cleared (num_ssa_names); bitmap_obstack_initialize (&m_bitmaps); } -- 2.31.1