Commit fd46280d by Martin Liska Committed by Martin Liska

Pass memory statistics for {symbol,call}_summary.

2019-10-29  Martin Liska  <mliska@suse.cz>

	* symbol-summary.h (function_summary): Pass memory location
	to underlaying hash_map (or vec).
	(V>::fast_function_summary): Likewise.

From-SVN: r277573
parent 78cd68c0
2019-10-29 Martin Liska <mliska@suse.cz> 2019-10-29 Martin Liska <mliska@suse.cz>
* symbol-summary.h (function_summary): Pass memory location
to underlaying hash_map (or vec).
(V>::fast_function_summary): Likewise.
2019-10-29 Martin Liska <mliska@suse.cz>
* ggc.h (ggc_alloc_no_dtor): New function. * ggc.h (ggc_alloc_no_dtor): New function.
* ipa-fnsummary.c (ipa_free_fn_summary): Call * ipa-fnsummary.c (ipa_free_fn_summary): Call
destructor and ggc_free. destructor and ggc_free.
...@@ -129,7 +129,7 @@ class GTY((user)) function_summary <T *>: public function_summary_base<T> ...@@ -129,7 +129,7 @@ class GTY((user)) function_summary <T *>: public function_summary_base<T>
{ {
public: public:
/* Default construction takes SYMTAB as an argument. */ /* Default construction takes SYMTAB as an argument. */
function_summary (symbol_table *symtab, bool ggc = false); function_summary (symbol_table *symtab, bool ggc = false CXX_MEM_STAT_INFO);
/* Destructor. */ /* Destructor. */
virtual ~function_summary (); virtual ~function_summary ();
...@@ -213,8 +213,11 @@ private: ...@@ -213,8 +213,11 @@ private:
}; };
template <typename T> template <typename T>
function_summary<T *>::function_summary (symbol_table *symtab, bool ggc): function_summary<T *>::function_summary (symbol_table *symtab, bool ggc
function_summary_base<T> (symtab), m_ggc (ggc), m_map (13, ggc) MEM_STAT_DECL):
function_summary_base<T> (symtab), m_ggc (ggc), m_map (13, ggc, true,
GATHER_STATISTICS
PASS_MEM_STAT)
{ {
this->m_symtab_insertion_hook this->m_symtab_insertion_hook
= this->m_symtab->add_cgraph_insertion_hook (function_summary::symtab_insertion, = this->m_symtab->add_cgraph_insertion_hook (function_summary::symtab_insertion,
...@@ -325,7 +328,7 @@ class GTY((user)) fast_function_summary <T *, V> ...@@ -325,7 +328,7 @@ class GTY((user)) fast_function_summary <T *, V>
{ {
public: public:
/* Default construction takes SYMTAB as an argument. */ /* Default construction takes SYMTAB as an argument. */
fast_function_summary (symbol_table *symtab); fast_function_summary (symbol_table *symtab CXX_MEM_STAT_INFO);
/* Destructor. */ /* Destructor. */
virtual ~fast_function_summary (); virtual ~fast_function_summary ();
...@@ -407,10 +410,10 @@ private: ...@@ -407,10 +410,10 @@ private:
}; };
template <typename T, typename V> template <typename T, typename V>
fast_function_summary<T *, V>::fast_function_summary (symbol_table *symtab): fast_function_summary<T *, V>::fast_function_summary (symbol_table *symtab MEM_STAT_DECL):
function_summary_base<T> (symtab), m_vector (NULL) function_summary_base<T> (symtab), m_vector (NULL)
{ {
vec_alloc (m_vector, 13); vec_alloc (m_vector, 13 PASS_MEM_STAT);
this->m_symtab_insertion_hook this->m_symtab_insertion_hook
= this->m_symtab->add_cgraph_insertion_hook (fast_function_summary::symtab_insertion, = this->m_symtab->add_cgraph_insertion_hook (fast_function_summary::symtab_insertion,
this); this);
...@@ -602,8 +605,11 @@ class GTY((user)) call_summary <T *>: public call_summary_base<T> ...@@ -602,8 +605,11 @@ class GTY((user)) call_summary <T *>: public call_summary_base<T>
{ {
public: public:
/* Default construction takes SYMTAB as an argument. */ /* Default construction takes SYMTAB as an argument. */
call_summary (symbol_table *symtab, bool ggc = false) call_summary (symbol_table *symtab, bool ggc = false
: call_summary_base<T> (symtab), m_ggc (ggc), m_map (13, ggc) CXX_MEM_STAT_INFO)
: call_summary_base<T> (symtab), m_ggc (ggc), m_map (13, ggc, true,
GATHER_STATISTICS
PASS_MEM_STAT)
{ {
this->m_symtab_removal_hook this->m_symtab_removal_hook
= this->m_symtab->add_edge_removal_hook (call_summary::symtab_removal, = this->m_symtab->add_edge_removal_hook (call_summary::symtab_removal,
...@@ -768,10 +774,10 @@ class GTY((user)) fast_call_summary <T *, V>: public call_summary_base<T> ...@@ -768,10 +774,10 @@ class GTY((user)) fast_call_summary <T *, V>: public call_summary_base<T>
{ {
public: public:
/* Default construction takes SYMTAB as an argument. */ /* Default construction takes SYMTAB as an argument. */
fast_call_summary (symbol_table *symtab) fast_call_summary (symbol_table *symtab CXX_MEM_STAT_INFO)
: call_summary_base<T> (symtab), m_vector (NULL) : call_summary_base<T> (symtab), m_vector (NULL)
{ {
vec_alloc (m_vector, 13); vec_alloc (m_vector, 13 PASS_MEM_STAT);
this->m_symtab_removal_hook this->m_symtab_removal_hook
= this->m_symtab->add_edge_removal_hook (fast_call_summary::symtab_removal, = this->m_symtab->add_edge_removal_hook (fast_call_summary::symtab_removal,
this); this);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment