diff options
author | Richard Biener <rguenther@suse.de> | 2020-12-02 14:43:59 +0100 |
---|---|---|
committer | Richard Biener <rguenther@suse.de> | 2020-12-02 15:55:18 +0100 |
commit | feb93adf76eda52385a73eb57c5bef7c870a2564 (patch) | |
tree | ab341ac008fc8dbb5f504d4850d989a1f09bf142 /gcc/tree-vectorizer.h | |
parent | bad800c03d00a57fc21718c160459d9a1e8d747a (diff) | |
download | gcc-feb93adf76eda52385a73eb57c5bef7c870a2564.zip gcc-feb93adf76eda52385a73eb57c5bef7c870a2564.tar.gz gcc-feb93adf76eda52385a73eb57c5bef7c870a2564.tar.bz2 |
tree-optimization/97630 - fix SLP cycle memory leak
This fixes SLP cycles leaking memory by maintaining a double-linked
list of allocatd SLP nodes we can zap when we free the alloc pool.
2020-12-02 Richard Biener <rguenther@suse.de>
PR tree-optimization/97630
* tree-vectorizer.h (_slp_tree::next_node,
_slp_tree::prev_node): New.
(vect_slp_init): Declare.
(vect_slp_fini): Likewise.
* tree-vectorizer.c (vectorize_loops): Call vect_slp_init/fini.
(pass_slp_vectorize::execute): Likewise.
* tree-vect-slp.c (vect_slp_init): New.
(vect_slp_fini): Likewise.
(slp_first_node): New global.
(_slp_tree::_slp_tree): Link node into the SLP tree list.
(_slp_tree::~_slp_tree): Delink node from the SLP tree list.
Diffstat (limited to 'gcc/tree-vectorizer.h')
-rw-r--r-- | gcc/tree-vectorizer.h | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/gcc/tree-vectorizer.h b/gcc/tree-vectorizer.h index 0ee4ef3..c0f786c 100644 --- a/gcc/tree-vectorizer.h +++ b/gcc/tree-vectorizer.h @@ -26,7 +26,6 @@ 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. */ @@ -116,8 +115,6 @@ 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 { @@ -172,6 +169,10 @@ struct _slp_tree { /* Return memory to slp_tree_pool. */ static void operator delete (void *, size_t); + + /* Linked list of nodes to release when we free the slp_tree_pool. */ + slp_tree next_node; + slp_tree prev_node; }; /* The enum describes the type of operations that an SLP instance @@ -1963,6 +1964,8 @@ extern int vect_get_known_peeling_cost (loop_vec_info, int, int *, extern tree cse_and_gimplify_to_preheader (loop_vec_info, tree); /* In tree-vect-slp.c. */ +extern void vect_slp_init (void); +extern void vect_slp_fini (void); extern void vect_free_slp_instance (slp_instance); extern bool vect_transform_slp_perm_load (vec_info *, slp_tree, vec<tree>, gimple_stmt_iterator *, poly_uint64, |