+2019-11-05 Jan Hubicka <jh@suse.cz>
+
+ * hsa-brig.c: Include alloc-pool.h
+ * hsa-dump.c: Likewise.
+ * hsa-gen.c: Likewise.
+ * hse-regalloc.c: Likewise.
+ * ipa-hsa.c: Likewise.
+ * ipa-predicate.c: Likewise.
+ * ipa-reference.c: Likewise.
+ * ipa-sra.c: Likewise.
+ * omp-expand.c: Likewise.
+ * omp-general.c: Likewise.
+ * omp-low.c: Likewise.
+ * sumbol-summary.h (function_summary_base): Add allocator.
+ (function_summary<T *>::function_summary): Update construction.
+ (fast_function_summary<T *, V>::fast_function_summary): Likewise.
+ (call_summary_base): Add allcator.
+ (call_summary<T *>::call_summary): Update construction.
+ (fast_call_summary<T *, V>::fast_call_summary): Likewise.
+
2019-11-05 Jakub Jelinek <jakub@redhat.com>
PR tree-optimization/91945
{
public:
/* Default construction takes SYMTAB as an argument. */
- function_summary_base (symbol_table *symtab): m_symtab (symtab),
- m_insertion_enabled (true)
+ function_summary_base (symbol_table *symtab CXX_MEM_STAT_INFO):
+ m_symtab (symtab),
+ m_insertion_enabled (true),
+ allocator ("function summary" PASS_MEM_STAT)
{}
/* Basic implementation of insert operation. */
{
/* Call gcc_internal_because we do not want to call finalizer for
a type T. We call dtor explicitly. */
- return is_ggc () ? new (ggc_internal_alloc (sizeof (T))) T () : new T () ;
+ return is_ggc () ? new (ggc_internal_alloc (sizeof (T))) T ()
+ : allocator.allocate () ;
}
/* Release an item that is stored within map. */
ggc_free (item);
}
else
- delete item;
+ allocator.remove (item);
}
/* Unregister all call-graph hooks. */
private:
/* Return true when the summary uses GGC memory for allocation. */
virtual bool is_ggc () = 0;
+ object_allocator<T> allocator;
};
template <typename T>
template <typename T>
function_summary<T *>::function_summary (symbol_table *symtab, bool ggc
MEM_STAT_DECL):
- function_summary_base<T> (symtab), m_ggc (ggc), m_map (13, ggc, true,
- GATHER_STATISTICS
- PASS_MEM_STAT)
+ function_summary_base<T> (symtab PASS_MEM_STAT), m_ggc (ggc),
+ m_map (13, ggc, true, GATHER_STATISTICS PASS_MEM_STAT)
{
this->m_symtab_insertion_hook
= this->m_symtab->add_cgraph_insertion_hook (function_summary::symtab_insertion,
template <typename T, typename V>
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 PASS_MEM_STAT), m_vector (NULL)
{
vec_alloc (m_vector, 13 PASS_MEM_STAT);
this->m_symtab_insertion_hook
{
public:
/* Default construction takes SYMTAB as an argument. */
- call_summary_base (symbol_table *symtab): m_symtab (symtab),
- m_initialize_when_cloning (false)
+ call_summary_base (symbol_table *symtab CXX_MEM_STAT_INFO):
+ m_symtab (symtab),
+ m_initialize_when_cloning (false),
+ allocator ("call summary" PASS_MEM_STAT)
{}
/* Basic implementation of removal operation. */
{
/* Call gcc_internal_because we do not want to call finalizer for
a type T. We call dtor explicitly. */
- return is_ggc () ? new (ggc_internal_alloc (sizeof (T))) T () : new T () ;
+ return is_ggc () ? new (ggc_internal_alloc (sizeof (T))) T ()
+ : allocator.allocate ();
}
/* Release an item that is stored within map. */
ggc_free (item);
}
else
- delete item;
+ allocator.remove (item);
}
/* Unregister all call-graph hooks. */
private:
/* Return true when the summary uses GGC memory for allocation. */
virtual bool is_ggc () = 0;
+ object_allocator<T> allocator;
};
template <typename T>
/* Default construction takes SYMTAB as an argument. */
call_summary (symbol_table *symtab, bool ggc = false
CXX_MEM_STAT_INFO)
- : call_summary_base<T> (symtab), m_ggc (ggc), m_map (13, ggc, true,
- GATHER_STATISTICS
- PASS_MEM_STAT)
+ : call_summary_base<T> (symtab PASS_MEM_STAT), m_ggc (ggc),
+ m_map (13, ggc, true, GATHER_STATISTICS PASS_MEM_STAT)
{
this->m_symtab_removal_hook
= this->m_symtab->add_edge_removal_hook (call_summary::symtab_removal,
public:
/* Default construction takes SYMTAB as an argument. */
fast_call_summary (symbol_table *symtab CXX_MEM_STAT_INFO)
- : call_summary_base<T> (symtab), m_vector (NULL)
+ : call_summary_base<T> (symtab PASS_MEM_STAT), m_vector (NULL)
{
vec_alloc (m_vector, 13 PASS_MEM_STAT);
this->m_symtab_removal_hook