From patchwork Fri May 29 13:38:34 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: 477895 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 D6F46140F96 for ; Fri, 29 May 2015 23:38:47 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b=nza+krDf; 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 :message-id:date:from:mime-version:to:subject:references :in-reply-to:content-type; q=dns; s=default; b=UsPiXyBpyZcfTCkCT oLddCJVVV63Ym7bHoFCvYjfTDBUfIxs5PAzp/k+JGgpUjQX1b+WsclVBmvwmDJ6d 8Bo9X5nEr3jY4FkTEnuLBALU5ZzqLoJ2rbuGw2rN8d0yeXG13DqWry+14k3Fxr9T vAw2XQmD19N0BboogghNW1dAJ4= 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 :message-id:date:from:mime-version:to:subject:references :in-reply-to:content-type; s=default; bh=BkGMecyyEftEnzy0rJiiY5K ded0=; b=nza+krDfjg2jsBHyLkrYYcIN2ZYgAz0pA24ITnJfMPQwrb/InOr4p97 abONfMtCblVO+TXs14oO7X6mniVd6yvupE9cxxcpk9salH0wvmsAyXgq60MRQae/ MQf6pnGLne0dUQmFHCA0i0Q6qJa7zZd3tlHcmfZqaX5EpkNuR+j4= Received: (qmail 72261 invoked by alias); 29 May 2015 13:38:41 -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 72251 invoked by uid 89); 29 May 2015 13:38:40 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=0.8 required=5.0 tests=AWL, BAYES_50, KAM_LAZY_DOMAIN_SECURITY autolearn=no version=3.3.2 X-HELO: mx2.suse.de Received: from cantor2.suse.de (HELO mx2.suse.de) (195.135.220.15) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (CAMELLIA256-SHA encrypted) ESMTPS; Fri, 29 May 2015 13:38:38 +0000 Received: from relay1.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id CE0D8AC73; Fri, 29 May 2015 13:38:34 +0000 (UTC) Message-ID: <55686BDA.2050800@suse.cz> Date: Fri, 29 May 2015 15:38:34 +0200 From: =?windows-1252?Q?Martin_Li=9Aka?= User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.6.0 MIME-Version: 1.0 To: Jeff Law , gcc-patches@gcc.gnu.org Subject: Re: [PATCH 18/35] Change use to type-based pool allocator in stmt.c. References: <83d59ba92a3c4b3ba831ebc2fce325f0416848d0.1432735040.git.mliska@suse.cz> <5ffe646f8fb4d5a75e1c98d8a7c64c1c8d5c4b83.1432735040.git.mliska@suse.cz> <5566086B.8050300@redhat.com> In-Reply-To: <5566086B.8050300@redhat.com> X-IsSubscribed: yes On 05/27/2015 08:09 PM, Jeff Law wrote: > On 05/27/2015 07:56 AM, mliska wrote: >> gcc/ChangeLog: >> >> 2015-04-30 Martin Liska >> >> * stmt.c (add_case_node): Use new type-based pool allocator. >> (expand_case): Likewise. >> (expand_sjlj_dispatch_table): Likewise. > OK. > jeff > v2 From 7d6b26873043b383aaa0b382f4edbcf43424ea54 Mon Sep 17 00:00:00 2001 From: mliska Date: Wed, 27 May 2015 15:56:50 +0200 Subject: [PATCH 17/32] Change use to type-based pool allocator in stmt.c. gcc/ChangeLog: 2015-04-30 Martin Liska * stmt.c (add_case_node): Use new type-based pool allocator. (expand_case): Likewise. (expand_sjlj_dispatch_table): Likewise. --- gcc/stmt.c | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/gcc/stmt.c b/gcc/stmt.c index 303df72..a04f69b 100644 --- a/gcc/stmt.c +++ b/gcc/stmt.c @@ -748,7 +748,7 @@ do_jump_if_equal (machine_mode mode, rtx op0, rtx op1, rtx_code_label *label, static struct case_node * add_case_node (struct case_node *head, tree low, tree high, - tree label, int prob, alloc_pool case_node_pool) + tree label, int prob, pool_allocator &case_node_pool) { struct case_node *r; @@ -756,7 +756,7 @@ add_case_node (struct case_node *head, tree low, tree high, gcc_checking_assert (high && (TREE_TYPE (low) == TREE_TYPE (high))); /* Add this label to the chain. */ - r = (struct case_node *) pool_alloc (case_node_pool); + r = case_node_pool.allocate (); r->low = low; r->high = high; r->code_label = label; @@ -1160,7 +1160,7 @@ expand_case (gswitch *stmt) struct case_node *case_list = 0; /* A pool for case nodes. */ - alloc_pool case_node_pool; + pool_allocator case_node_pool ("struct case_node pool", 100); /* An ERROR_MARK occurs for various reasons including invalid data type. ??? Can this still happen, with GIMPLE and all? */ @@ -1171,9 +1171,6 @@ expand_case (gswitch *stmt) expressions being INTEGER_CST. */ gcc_assert (TREE_CODE (index_expr) != INTEGER_CST); - case_node_pool = create_alloc_pool ("struct case_node pool", - sizeof (struct case_node), - 100); do_pending_stack_adjust (); @@ -1273,7 +1270,6 @@ expand_case (gswitch *stmt) reorder_insns (NEXT_INSN (before_case), get_last_insn (), before_case); free_temp_slots (); - free_alloc_pool (case_node_pool); } /* Expand the dispatch to a short decrement chain if there are few cases @@ -1340,9 +1336,8 @@ expand_sjlj_dispatch_table (rtx dispatch_index, { /* Similar to expand_case, but much simpler. */ struct case_node *case_list = 0; - alloc_pool case_node_pool = create_alloc_pool ("struct sjlj_case pool", - sizeof (struct case_node), - ncases); + pool_allocator case_node_pool ("struct sjlj_case pool", + ncases); tree index_expr = make_tree (index_type, dispatch_index); tree minval = build_int_cst (index_type, 0); tree maxval = CASE_LOW (dispatch_table.last ()); @@ -1362,7 +1357,6 @@ expand_sjlj_dispatch_table (rtx dispatch_index, minval, maxval, range, BLOCK_FOR_INSN (before_case)); emit_label (default_label); - free_alloc_pool (case_node_pool); } /* Dispatching something not handled? Trap! */ -- 2.1.4