From patchwork Wed May 27 13:56:54 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Martin_Li=C5=A1ka?= X-Patchwork-Id: 477147 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3142D14012C for ; Thu, 28 May 2015 00:17:33 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b=R8GRtW34; dkim-atps=neutral DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :resent-from:resent-to:resent-date:resent-message-id:message-id :in-reply-to:references:from:date:subject:to; q=dns; s=default; b= dhbc/F0MdGebQHN6Ea4EBgiiHLhjPOA22oQv2ELk1RPJQ8ih8D9Z8u4uz9yqTxcp G37ZkjtM2JVexp/njKQiOPmSastsy12BU7CuUg3jpWso8rtL5bnq9L2m9UIT/lsd c108vjI7gt/7SqsBhwMIf5IylevolIyUybubfVPnT+g= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :resent-from:resent-to:resent-date:resent-message-id:message-id :in-reply-to:references:from:date:subject:to; s=default; bh=zxmY YM4CKWviILjoMODWcZ8SpUM=; b=R8GRtW34dyTAwCaDIx5/zwJaRDRf2AeJBq8h XP4O9MUXgL3ZoOhAacBJ0pwhJk6qr0URiyW5X/GD5DuUob9u2k70A9fBzHpEtvHW kp/2SwQs4Mlhnd4NkXAHhpyePddxEQRnlJrefWfh8ZpqRsMysr486XBsDOxuZi4d A7Ln/X8= Received: (qmail 86920 invoked by alias); 27 May 2015 14:16:50 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 86839 invoked by uid 89); 27 May 2015 14:16:49 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=0.7 required=5.0 tests=AWL, BAYES_50, KAM_LAZY_DOMAIN_SECURITY autolearn=no version=3.3.2 X-HELO: eggs.gnu.org Received: from eggs.gnu.org (HELO eggs.gnu.org) (208.118.235.92) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-SHA encrypted) ESMTPS; Wed, 27 May 2015 14:16:47 +0000 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YxbsJ-0007JU-DS for gcc-patches@gcc.gnu.org; Wed, 27 May 2015 10:00:11 -0400 Received: from cantor2.suse.de ([195.135.220.15]:57515 helo=mx2.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YxbsJ-00078k-3c for gcc-patches@gcc.gnu.org; Wed, 27 May 2015 10:00:03 -0400 Received: from relay1.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 260FFAE06 for ; Wed, 27 May 2015 13:59:58 +0000 (UTC) Resent-From: =?UTF-8?B?TWFydGluIExpxaFrYQ==?= Resent-To: GCC Patches Resent-Date: Wed, 27 May 2015 15:59:57 +0200 Resent-Message-ID: <5565CDDD.50809@suse.cz> Resent-User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.6.0 Message-Id: In-Reply-To: <83d59ba92a3c4b3ba831ebc2fce325f0416848d0.1432735040.git.mliska@suse.cz> References: <83d59ba92a3c4b3ba831ebc2fce325f0416848d0.1432735040.git.mliska@suse.cz> From: mliska Date: Wed, 27 May 2015 15:56:54 +0200 Subject: [PATCH 29/35] Change use to type-based pool allocator in ipa-prop.c. To: gcc-patches@gcc.gnu.org X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x (no timestamps) [generic] X-Received-From: 195.135.220.15 X-IsSubscribed: yes gcc/ChangeLog: 2015-04-30 Martin Liska * ipa-prop.c (ipa_set_jf_constant): Use new type-based pool allocator. (ipa_edge_duplication_hook): Likewise. (ipa_free_all_structures_after_ipa_cp): Likewise. (ipa_free_all_structures_after_iinln): Likewise. --- gcc/ipa-prop.c | 23 +++++++---------------- 1 file changed, 7 insertions(+), 16 deletions(-) diff --git a/gcc/ipa-prop.c b/gcc/ipa-prop.c index 26be5f2..80ce6b8 100644 --- a/gcc/ipa-prop.c +++ b/gcc/ipa-prop.c @@ -176,7 +176,8 @@ struct ipa_cst_ref_desc /* Allocation pool for reference descriptions. */ -static alloc_pool ipa_refdesc_pool; +static pool_allocator ipa_refdesc_pool + ("IPA-PROP ref descriptions", 32); /* Return true if DECL_FUNCTION_SPECIFIC_OPTIMIZATION of the decl associated with NODE should prevent us from analyzing it for the purposes of IPA-CP. */ @@ -508,11 +509,8 @@ ipa_set_jf_constant (struct ipa_jump_func *jfunc, tree constant, && TREE_CODE (TREE_OPERAND (constant, 0)) == FUNCTION_DECL) { struct ipa_cst_ref_desc *rdesc; - if (!ipa_refdesc_pool) - ipa_refdesc_pool = create_alloc_pool ("IPA-PROP ref descriptions", - sizeof (struct ipa_cst_ref_desc), 32); - rdesc = (struct ipa_cst_ref_desc *) pool_alloc (ipa_refdesc_pool); + rdesc = ipa_refdesc_pool.allocate (); rdesc->cs = cs; rdesc->next_duplicate = NULL; rdesc->refcount = 1; @@ -3517,9 +3515,7 @@ ipa_edge_duplication_hook (struct cgraph_edge *src, struct cgraph_edge *dst, gcc_checking_assert (ref); dst->caller->clone_reference (ref, ref->stmt); - gcc_checking_assert (ipa_refdesc_pool); - struct ipa_cst_ref_desc *dst_rdesc - = (struct ipa_cst_ref_desc *) pool_alloc (ipa_refdesc_pool); + struct ipa_cst_ref_desc *dst_rdesc = ipa_refdesc_pool.allocate (); dst_rdesc->cs = dst; dst_rdesc->refcount = src_rdesc->refcount; dst_rdesc->next_duplicate = NULL; @@ -3527,10 +3523,7 @@ ipa_edge_duplication_hook (struct cgraph_edge *src, struct cgraph_edge *dst, } else if (src_rdesc->cs == src) { - struct ipa_cst_ref_desc *dst_rdesc; - gcc_checking_assert (ipa_refdesc_pool); - dst_rdesc - = (struct ipa_cst_ref_desc *) pool_alloc (ipa_refdesc_pool); + struct ipa_cst_ref_desc *dst_rdesc = ipa_refdesc_pool.allocate (); dst_rdesc->cs = dst; dst_rdesc->refcount = src_rdesc->refcount; dst_rdesc->next_duplicate = src_rdesc->next_duplicate; @@ -3681,8 +3674,7 @@ ipa_free_all_structures_after_ipa_cp (void) free_alloc_pool (ipcp_poly_ctx_values_pool); free_alloc_pool (ipcp_agg_lattice_pool); ipa_unregister_cgraph_hooks (); - if (ipa_refdesc_pool) - free_alloc_pool (ipa_refdesc_pool); + ipa_refdesc_pool.release (); } } @@ -3703,8 +3695,7 @@ ipa_free_all_structures_after_iinln (void) free_alloc_pool (ipcp_poly_ctx_values_pool); if (ipcp_agg_lattice_pool) free_alloc_pool (ipcp_agg_lattice_pool); - if (ipa_refdesc_pool) - free_alloc_pool (ipa_refdesc_pool); + ipa_refdesc_pool.release (); } /* Print ipa_tree_map data structures of all functions in the