From patchwork Tue Sep 21 16:53:44 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aldy Hernandez X-Patchwork-Id: 45248 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 3D4B6385841C for ; Tue, 21 Sep 2021 16:59:34 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 3D4B6385841C DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1632243574; bh=SsSilHF61099LbxFmDmo36ijk+sUsO5tsiEGN5VS86c=; h=To:Subject:Date:In-Reply-To:References:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=h6fmqCDuucie0axwsfVBCbblFXvdnniSqfiRiEr/Yd0O+U9+OLQgwu+/shWioMF3b Zh7OxesCMnGgehkG/pduyhjDMTHOTjd/SBBJVKn6GuUjpwtyZP7VBSdlcFV7myU7k1 YpB74HJgAKjxBAcORIcOvnI4RAF/yyAxAaUrAN+U= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org 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 To: Andrew MacLeod 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 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-Patchwork-Original-From: Aldy Hernandez via Gcc-patches From: Aldy Hernandez Reply-To: Aldy Hernandez Cc: GCC patches Errors-To: gcc-patches-bounces+patchwork=sourceware.org@gcc.gnu.org Sender: "Gcc-patches" 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); }