diff options
author | Richard Biener <rguenther@suse.de> | 2020-10-26 16:47:17 +0100 |
---|---|---|
committer | Richard Biener <rguenther@suse.de> | 2020-10-27 08:43:06 +0100 |
commit | 83220838dd6f7701ca264347c934b12de7703b42 (patch) | |
tree | f04fbf29e18c88965d9ea2d3f49d98b72486e371 /gcc/tree-vectorizer.h | |
parent | 119295372f3717e78edd43a8ae1a2003d0fcc0e6 (diff) | |
download | gcc-83220838dd6f7701ca264347c934b12de7703b42.zip gcc-83220838dd6f7701ca264347c934b12de7703b42.tar.gz gcc-83220838dd6f7701ca264347c934b12de7703b42.tar.bz2 |
Move SLP nodes to an alloc-pool
This introduces a global alloc-pool for SLP nodes to reduce overhead
on SLP allocation churn which will get worse and to eventually release
SLP cycles which will retain a refcount of one and thus are never
freed at the moment.
2020-10-26 Richard Biener <rguenther@suse.de>
* tree-vectorizer.h (slp_tree_pool): Declare.
(_slp_tree::operator new): Likewise.
(_slp_tree::operator delete): Likewise.
* tree-vectorizer.c (vectorize_loops): Allocate and free the
slp_tree_pool.
(pass_slp_vectorize::execute): Likewise.
* tree-vect-slp.c (slp_tree_pool): Define.
(_slp_tree::operator new): Likewise.
(_slp_tree::operator delete): Likewise.
Diffstat (limited to 'gcc/tree-vectorizer.h')
-rw-r--r-- | gcc/tree-vectorizer.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/gcc/tree-vectorizer.h b/gcc/tree-vectorizer.h index b56073c..9c55383 100644 --- a/gcc/tree-vectorizer.h +++ b/gcc/tree-vectorizer.h @@ -26,6 +26,7 @@ typedef class _stmt_vec_info *stmt_vec_info; #include "tree-data-ref.h" #include "tree-hash-traits.h" #include "target.h" +#include "alloc-pool.h" /* Used for naming of new temporaries. */ @@ -115,6 +116,8 @@ typedef hash_map<tree_operand_hash, ************************************************************************/ typedef struct _slp_tree *slp_tree; +extern object_allocator<_slp_tree> *slp_tree_pool; + /* A computation tree of an SLP instance. Each node corresponds to a group of stmts to be packed in a SIMD stmt. */ struct _slp_tree { @@ -163,6 +166,12 @@ struct _slp_tree { enum tree_code code; int vertex; + + /* Allocate from slp_tree_pool. */ + static void *operator new (size_t); + + /* Return memory to slp_tree_pool. */ + static void operator delete (void *, size_t); }; |