public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: "Martin Liška" <mliska@suse.cz>
To: gcc-patches@gcc.gnu.org
Subject: Re: [PATCH 25/35] Change use to type-based pool allocator in tree-ssa-sccvn.c.
Date: Fri, 29 May 2015 13:41:00 -0000	[thread overview]
Message-ID: <55686C44.2000109@suse.cz> (raw)
In-Reply-To: <5566094F.7020207@redhat.com>

[-- Attachment #1: Type: text/plain, Size: 548 bytes --]

On 05/27/2015 08:13 PM, Jeff Law wrote:
> On 05/27/2015 07:56 AM, mliska wrote:
>> gcc/ChangeLog:
>>
>> 2015-04-30  Martin Liska  <mliska@suse.cz>
>>
>>     * tree-ssa-sccvn.c (vn_reference_insert): Use new type-based pool allocator.
>>     (vn_reference_insert_pieces): Likewise.
>>     (vn_phi_insert): Likewise.
>>     (visit_reference_op_call): Likewise.
>>     (copy_phi): Likewise.
>>     (copy_reference): Likewise.
>>     (process_scc): Likewise.
>>     (allocate_vn_table): Likewise.
>>     (free_vn_table): Likewise.
> OK.
> jeff
>
>

v2

[-- Attachment #2: 0024-Change-use-to-type-based-pool-allocator-in-tree-ssa-.patch --]
[-- Type: text/x-patch, Size: 4821 bytes --]

From a82fef12303a5382582e3967ab48c2a077830a90 Mon Sep 17 00:00:00 2001
From: mliska <mliska@suse.cz>
Date: Wed, 27 May 2015 15:56:52 +0200
Subject: [PATCH 24/32] Change use to type-based pool allocator in
 tree-ssa-sccvn.c.

gcc/ChangeLog:

2015-04-30  Martin Liska  <mliska@suse.cz>

	* tree-ssa-sccvn.c (vn_reference_insert): Use new type-based pool allocator.
	(vn_reference_insert_pieces): Likewise.
	(vn_phi_insert): Likewise.
	(visit_reference_op_call): Likewise.
	(copy_phi): Likewise.
	(copy_reference): Likewise.
	(process_scc): Likewise.
	(allocate_vn_table): Likewise.
	(free_vn_table): Likewise.
---
 gcc/tree-ssa-sccvn.c | 33 +++++++++++++++------------------
 1 file changed, 15 insertions(+), 18 deletions(-)

diff --git a/gcc/tree-ssa-sccvn.c b/gcc/tree-ssa-sccvn.c
index 03be480..98b0cc5 100644
--- a/gcc/tree-ssa-sccvn.c
+++ b/gcc/tree-ssa-sccvn.c
@@ -289,8 +289,8 @@ typedef struct vn_tables_s
   vn_phi_table_type *phis;
   vn_reference_table_type *references;
   struct obstack nary_obstack;
-  alloc_pool phis_pool;
-  alloc_pool references_pool;
+  pool_allocator<vn_phi_s> *phis_pool;
+  pool_allocator<vn_reference_s> *references_pool;
 } *vn_tables_t;
 
 
@@ -2285,7 +2285,7 @@ vn_reference_insert (tree op, tree result, tree vuse, tree vdef)
   vn_reference_t vr1;
   bool tem;
 
-  vr1 = (vn_reference_t) pool_alloc (current_info->references_pool);
+  vr1 = current_info->references_pool->allocate ();
   if (TREE_CODE (result) == SSA_NAME)
     vr1->value_id = VN_INFO (result)->value_id;
   else
@@ -2330,7 +2330,7 @@ vn_reference_insert_pieces (tree vuse, alias_set_type set, tree type,
   vn_reference_s **slot;
   vn_reference_t vr1;
 
-  vr1 = (vn_reference_t) pool_alloc (current_info->references_pool);
+  vr1 = current_info->references_pool->allocate ();
   vr1->value_id = value_id;
   vr1->vuse = vuse ? SSA_VAL (vuse) : NULL_TREE;
   vr1->operands = valueize_refs (operands);
@@ -2756,7 +2756,7 @@ static vn_phi_t
 vn_phi_insert (gimple phi, tree result)
 {
   vn_phi_s **slot;
-  vn_phi_t vp1 = (vn_phi_t) pool_alloc (current_info->phis_pool);
+  vn_phi_t vp1 = current_info->phis_pool->allocate ();
   unsigned i;
   vec<tree> args = vNULL;
 
@@ -2999,7 +2999,7 @@ visit_reference_op_call (tree lhs, gcall *stmt)
 	changed |= set_ssa_val_to (vdef, vdef);
       if (lhs)
 	changed |= set_ssa_val_to (lhs, lhs);
-      vr2 = (vn_reference_t) pool_alloc (current_info->references_pool);
+      vr2 = current_info->references_pool->allocate ();
       vr2->vuse = vr1.vuse;
       /* As we are not walking the virtual operand chain we know the
 	 shared_lookup_references are still original so we can re-use
@@ -3873,7 +3873,7 @@ copy_nary (vn_nary_op_t onary, vn_tables_t info)
 static void
 copy_phi (vn_phi_t ophi, vn_tables_t info)
 {
-  vn_phi_t phi = (vn_phi_t) pool_alloc (info->phis_pool);
+  vn_phi_t phi = info->phis_pool->allocate ();
   vn_phi_s **slot;
   memcpy (phi, ophi, sizeof (*phi));
   ophi->phiargs.create (0);
@@ -3889,7 +3889,7 @@ copy_reference (vn_reference_t oref, vn_tables_t info)
 {
   vn_reference_t ref;
   vn_reference_s **slot;
-  ref = (vn_reference_t) pool_alloc (info->references_pool);
+  ref = info->references_pool->allocate ();
   memcpy (ref, oref, sizeof (*ref));
   oref->operands.create (0);
   slot = info->references->find_slot_with_hash (ref, ref->hashcode, INSERT);
@@ -3954,8 +3954,8 @@ process_scc (vec<tree> scc)
       optimistic_info->references->empty ();
       obstack_free (&optimistic_info->nary_obstack, NULL);
       gcc_obstack_init (&optimistic_info->nary_obstack);
-      empty_alloc_pool (optimistic_info->phis_pool);
-      empty_alloc_pool (optimistic_info->references_pool);
+      optimistic_info->phis_pool->release ();
+      optimistic_info->references_pool->release ();
       FOR_EACH_VEC_ELT (scc, i, var)
 	VN_INFO (var)->expr = NULL_TREE;
       FOR_EACH_VEC_ELT (scc, i, var)
@@ -4132,12 +4132,9 @@ allocate_vn_table (vn_tables_t table)
   table->references = new vn_reference_table_type (23);
 
   gcc_obstack_init (&table->nary_obstack);
-  table->phis_pool = create_alloc_pool ("VN phis",
-					sizeof (struct vn_phi_s),
-					30);
-  table->references_pool = create_alloc_pool ("VN references",
-					      sizeof (struct vn_reference_s),
-					      30);
+  table->phis_pool = new pool_allocator<vn_phi_s> ("VN phis", 30);
+  table->references_pool = new pool_allocator<vn_reference_s> ("VN references",
+							       30);
 }
 
 /* Free a value number table.  */
@@ -4152,8 +4149,8 @@ free_vn_table (vn_tables_t table)
   delete table->references;
   table->references = NULL;
   obstack_free (&table->nary_obstack, NULL);
-  free_alloc_pool (table->phis_pool);
-  free_alloc_pool (table->references_pool);
+  delete table->phis_pool;
+  delete table->references_pool;
 }
 
 static void
-- 
2.1.4


  reply	other threads:[~2015-05-29 13:40 UTC|newest]

Thread overview: 108+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-27 14:09 [PATCH 01/35] Introduce new type-based pool allocator mliska
2015-05-27 14:00 ` [PATCH 03/35] Change use to type-based pool allocator in lra-lives.c mliska
2015-05-27 17:53   ` Jeff Law
2015-05-29 13:34     ` Martin Liška
2015-05-28  0:48   ` Trevor Saunders
2015-05-27 14:00 ` [PATCH 04/35] Change use to type-based pool allocator in lra.c mliska
2015-05-27 17:55   ` Jeff Law
2015-05-29 13:34     ` Martin Liška
2015-05-27 14:00 ` [PATCH 12/35] Change use to type-based pool allocator in cselib.c mliska
2015-05-29 13:38   ` Martin Liška
2015-05-27 14:00 ` [PATCH 10/35] Change use to type-based pool allocator in cfg.c mliska
2015-05-27 18:01   ` Jeff Law
2015-05-29 13:34     ` Martin Liška
2015-05-27 14:00 ` [PATCH 09/35] Change use to type-based pool allocator in c-format.c mliska
2015-05-27 14:16   ` Jakub Jelinek
2015-05-27 18:01   ` Jeff Law
2015-05-29 13:35     ` Martin Liška
2015-05-27 14:00 ` [PATCH 06/35] Change use to type-based pool allocator in ira-color.c mliska
2015-05-27 14:07 ` [PATCH 19/35] Change use to type-based pool allocator in sel-sched-ir.c mliska
2015-05-27 18:12   ` Jeff Law
2015-05-29 13:40     ` Martin Liška
2015-05-27 14:09 ` [PATCH 02/35] Change use to type-based pool allocator in et-forest.c mliska
2015-05-27 17:50   ` Jeff Law
2015-05-29 13:33     ` Martin Liška
2015-05-27 14:15 ` [PATCH 05/35] Change use to type-based pool allocator in ira-color.c mliska
2015-05-27 17:59   ` Jeff Law
2015-05-29 13:34     ` Martin Liška
2015-05-27 14:17 ` [PATCH 21/35] Change use to type-based pool allocator in regcprop.c mliska
2015-05-27 18:14   ` Jeff Law
2015-05-29 13:40     ` Martin Liška
2015-05-27 14:17 ` [PATCH 23/35] Change use to type-based pool allocator in tree-ssa-pre.c mliska
2015-05-27 18:59   ` Jeff Law
2015-05-29 13:41     ` Martin Liška
2015-05-27 14:17 ` [PATCH 28/35] Change use to type-based pool allocator in ipa-profile.c mliska
2015-05-27 18:18   ` Jeff Law
2015-05-29 13:42     ` Martin Liška
2015-05-27 14:17 ` [PATCH 35/35] Remove old pool allocator mliska
2015-05-27 19:40   ` Jeff Law
2015-05-29 14:11     ` Martin Liška
2015-05-27 14:17 ` [PATCH 32/35] Change use to type-based pool allocator in ira-build.c mliska
2015-05-27 19:34   ` Jeff Law
2015-05-29 13:44     ` Martin Liška
2015-05-27 14:17 ` [PATCH 34/35] " mliska
2015-05-27 14:18 ` [PATCH 27/35] Change use to type-based pool allocator in tree-ssa-structalias.c mliska
2015-05-27 18:20   ` Jeff Law
2015-05-29 13:42     ` Martin Liška
2015-05-27 14:19 ` [PATCH 14/35] Change use to type-based pool allocator in df-scan.c mliska
2015-05-29 13:38   ` Martin Liška
2015-05-27 14:19 ` [PATCH 08/35] Change use to type-based pool allocator in asan.c mliska
2015-05-27 18:01   ` Jeff Law
2015-05-27 14:19 ` [PATCH 25/35] Change use to type-based pool allocator in tree-ssa-sccvn.c mliska
2015-05-27 18:16   ` Jeff Law
2015-05-29 13:41     ` Martin Liška [this message]
2015-05-27 14:19 ` [PATCH 11/35] Change use to type-based pool allocator in sh.c mliska
2015-05-27 18:03   ` Jeff Law
2015-05-29 13:37     ` Martin Liška
2015-05-27 14:20 ` [PATCH 31/35] Change use to type-based pool allocator in ipa-prop.c and ipa-cp.c mliska
2015-05-29 14:09   ` Martin Liška
2015-05-27 14:20 ` [PATCH 07/35] Change use to type-based pool allocator in var-tracking.c mliska
2015-05-29 13:34   ` Martin Liška
2015-05-27 14:20 ` [PATCH 29/35] Change use to type-based pool allocator in ipa-prop.c mliska
2015-05-27 18:22   ` Jeff Law
2015-05-29 13:42     ` Martin Liška
2015-05-27 14:21 ` [PATCH 20/35] Change use to type-based pool allocator in ira-build.c mliska
2015-05-27 18:15   ` Jeff Law
2015-05-29 13:39     ` Martin Liška
2015-05-27 14:21 ` [PATCH 24/35] Change use to type-based pool allocator in tree-ssa-reassoc.c mliska
2015-05-27 18:15   ` Jeff Law
2015-05-29 13:41     ` Martin Liška
2015-05-27 14:21 ` [PATCH 30/35] Change use to type-based pool allocator in ipa-inline-analysis.c mliska
2015-05-29 14:06   ` Martin Liška
2015-05-27 14:21 ` [PATCH 16/35] Change use to type-based pool allocator in tree-sra.c mliska
2015-05-27 18:11   ` Jeff Law
2015-05-29 13:39     ` Martin Liška
2015-05-27 14:21 ` [PATCH 15/35] Change use to type-based pool allocator in dse.c mliska
2015-05-29 13:38   ` Martin Liška
2015-05-27 14:21 ` [PATCH 18/35] Change use to type-based pool allocator in stmt.c mliska
2015-05-27 18:13   ` Jeff Law
2015-05-29 13:39     ` Martin Liška
2015-05-27 14:21 ` [PATCH 26/35] Change use to type-based pool allocator in tree-ssa-strlen.c mliska
2015-05-27 18:17   ` Jeff Law
2015-05-29 13:42   ` Martin Liška
2015-05-27 14:42 ` [PATCH 22/35] Change use to type-based pool allocator in sched-deps.c mliska
2015-05-27 18:16   ` Jeff Law
2015-05-29 13:40     ` Martin Liška
2015-05-27 14:55 ` [PATCH 17/35] Change use to type-based pool allocator in tree-ssa-math-opts.c mliska
2015-05-27 18:12   ` Jeff Law
2015-05-29 13:39     ` Martin Liška
2015-05-27 14:58 ` [PATCH 33/35] Change use to type-based pool allocator in ira-color.c mliska
2015-05-27 18:24   ` Jeff Law
2015-05-28 11:23   ` Statically-allocated objects with non-trivial ctors (was Re: [PATCH 33/35] Change use to type-based pool allocator in ira-color.c.) David Malcolm
2015-05-28 17:38     ` Jeff Law
2015-05-28 18:30       ` Richard Biener
2015-05-28 18:34         ` Jakub Jelinek
2015-05-28 19:25           ` Martin Liška
2015-05-28 20:42             ` Trevor Saunders
2015-05-29  5:16     ` Trevor Saunders
2015-05-27 15:04 ` [PATCH 13/35] Change use to type-based pool allocator in df-problems.c mliska
2015-05-27 18:05   ` Jeff Law
2015-05-29 13:37     ` Martin Liška
2015-05-27 17:50 ` [PATCH 01/35] Introduce new type-based pool allocator Jeff Law
2015-05-28 13:27   ` Martin Liška
2015-05-28 18:04     ` Jeff Law
2015-05-29 13:33       ` Martin Liška
2015-05-30  5:14         ` Jeff Law
2015-06-02 10:10         ` Andreas Schwab
2015-06-02 13:57           ` Martin Liška
2015-06-02 14:00             ` Richard Biener

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=55686C44.2000109@suse.cz \
    --to=mliska@suse.cz \
    --cc=gcc-patches@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).