From a895e6d72d763d3fc090ec852d405a07a61d01f4 Mon Sep 17 00:00:00 2001 From: Jan Hubicka Date: Tue, 5 Nov 2019 11:38:02 +0100 Subject: [PATCH] hsa-brig.c: Include alloc-pool.h * 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::function_summary): Update construction. (fast_function_summary::fast_function_summary): Likewise. (call_summary_base): Add allcator. (call_summary::call_summary): Update construction. (fast_call_summary::fast_call_summary): Likewise. From-SVN: r277821 --- gcc/ChangeLog | 20 ++++++++++++++++++++ gcc/hsa-brig.c | 1 + gcc/hsa-dump.c | 1 + gcc/hsa-gen.c | 1 + gcc/hsa-regalloc.c | 1 + gcc/ipa-hsa.c | 1 + gcc/ipa-predicate.c | 2 +- gcc/ipa-reference.c | 1 + gcc/ipa-sra.c | 1 + gcc/omp-expand.c | 1 + gcc/omp-general.c | 1 + gcc/omp-low.c | 1 + gcc/symbol-summary.h | 38 ++++++++++++++++++++++---------------- 13 files changed, 53 insertions(+), 17 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 39832ef..cf4b36f 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,23 @@ +2019-11-05 Jan Hubicka + + * 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::function_summary): Update construction. + (fast_function_summary::fast_function_summary): Likewise. + (call_summary_base): Add allcator. + (call_summary::call_summary): Update construction. + (fast_call_summary::fast_call_summary): Likewise. + 2019-11-05 Jakub Jelinek PR tree-optimization/91945 diff --git a/gcc/hsa-brig.c b/gcc/hsa-brig.c index 45f4149..14d5c52 100644 --- a/gcc/hsa-brig.c +++ b/gcc/hsa-brig.c @@ -44,6 +44,7 @@ along with GCC; see the file COPYING3. If not see #include "cgraph.h" #include "dumpfile.h" #include "print-tree.h" +#include "alloc-pool.h" #include "symbol-summary.h" #include "hsa-common.h" #include "gomp-constants.h" diff --git a/gcc/hsa-dump.c b/gcc/hsa-dump.c index 2d85601..d91b474 100644 --- a/gcc/hsa-dump.c +++ b/gcc/hsa-dump.c @@ -33,6 +33,7 @@ along with GCC; see the file COPYING3. If not see #include "gimple-pretty-print.h" #include "cgraph.h" #include "print-tree.h" +#include "alloc-pool.h" #include "symbol-summary.h" #include "hsa-common.h" diff --git a/gcc/hsa-gen.c b/gcc/hsa-gen.c index 26e1e24..436f4c5 100644 --- a/gcc/hsa-gen.c +++ b/gcc/hsa-gen.c @@ -48,6 +48,7 @@ along with GCC; see the file COPYING3. If not see #include "ssa-iterators.h" #include "cgraph.h" #include "print-tree.h" +#include "alloc-pool.h" #include "symbol-summary.h" #include "hsa-common.h" #include "cfghooks.h" diff --git a/gcc/hsa-regalloc.c b/gcc/hsa-regalloc.c index 597bb66..dd1937c 100644 --- a/gcc/hsa-regalloc.c +++ b/gcc/hsa-regalloc.c @@ -35,6 +35,7 @@ along with GCC; see the file COPYING3. If not see #include "cgraph.h" #include "print-tree.h" #include "cfghooks.h" +#include "alloc-pool.h" #include "symbol-summary.h" #include "hsa-common.h" diff --git a/gcc/ipa-hsa.c b/gcc/ipa-hsa.c index 654009b..369fe5a 100644 --- a/gcc/ipa-hsa.c +++ b/gcc/ipa-hsa.c @@ -40,6 +40,7 @@ along with GCC; see the file COPYING3. If not see #include "stringpool.h" #include "cgraph.h" #include "print-tree.h" +#include "alloc-pool.h" #include "symbol-summary.h" #include "hsa-common.h" diff --git a/gcc/ipa-predicate.c b/gcc/ipa-predicate.c index 721f095..f9ec7ab 100644 --- a/gcc/ipa-predicate.c +++ b/gcc/ipa-predicate.c @@ -25,8 +25,8 @@ along with GCC; see the file COPYING3. If not see #include "tree.h" #include "cgraph.h" #include "tree-vrp.h" -#include "symbol-summary.h" #include "alloc-pool.h" +#include "symbol-summary.h" #include "ipa-prop.h" #include "ipa-fnsummary.h" #include "real.h" diff --git a/gcc/ipa-reference.c b/gcc/ipa-reference.c index 09aa928..6713e2b 100644 --- a/gcc/ipa-reference.c +++ b/gcc/ipa-reference.c @@ -48,6 +48,7 @@ along with GCC; see the file COPYING3. If not see #include "calls.h" #include "ipa-utils.h" #include "ipa-reference.h" +#include "alloc-pool.h" #include "symbol-summary.h" /* The static variables defined within the compilation unit that are diff --git a/gcc/ipa-sra.c b/gcc/ipa-sra.c index 7367441..aceb5c7 100644 --- a/gcc/ipa-sra.c +++ b/gcc/ipa-sra.c @@ -75,6 +75,7 @@ along with GCC; see the file COPYING3. If not see #include "gimple-walk.h" #include "tree-dfa.h" #include "tree-sra.h" +#include "alloc-pool.h" #include "symbol-summary.h" #include "params.h" #include "dbgcnt.h" diff --git a/gcc/omp-expand.c b/gcc/omp-expand.c index 0f703be..eadff6e 100644 --- a/gcc/omp-expand.c +++ b/gcc/omp-expand.c @@ -52,6 +52,7 @@ along with GCC; see the file COPYING3. If not see #include "omp-general.h" #include "omp-offload.h" #include "tree-cfgcleanup.h" +#include "alloc-pool.h" #include "symbol-summary.h" #include "gomp-constants.h" #include "gimple-pretty-print.h" diff --git a/gcc/omp-general.c b/gcc/omp-general.c index 7f8d7a8..72a0f20 100644 --- a/gcc/omp-general.c +++ b/gcc/omp-general.c @@ -37,6 +37,7 @@ along with GCC; see the file COPYING3. If not see #include "attribs.h" #include "gimplify.h" #include "cgraph.h" +#include "alloc-pool.h" #include "symbol-summary.h" #include "hsa-common.h" #include "tree-pass.h" diff --git a/gcc/omp-low.c b/gcc/omp-low.c index cd7da6d..122f427 100644 --- a/gcc/omp-low.c +++ b/gcc/omp-low.c @@ -52,6 +52,7 @@ along with GCC; see the file COPYING3. If not see #include "omp-low.h" #include "omp-grid.h" #include "gimple-low.h" +#include "alloc-pool.h" #include "symbol-summary.h" #include "tree-nested.h" #include "context.h" diff --git a/gcc/symbol-summary.h b/gcc/symbol-summary.h index f677f16..d663cbb 100644 --- a/gcc/symbol-summary.h +++ b/gcc/symbol-summary.h @@ -28,8 +28,10 @@ class function_summary_base { 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. */ @@ -59,7 +61,8 @@ protected: { /* 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. */ @@ -71,7 +74,7 @@ protected: ggc_free (item); } else - delete item; + allocator.remove (item); } /* Unregister all call-graph hooks. */ @@ -92,6 +95,7 @@ protected: private: /* Return true when the summary uses GGC memory for allocation. */ virtual bool is_ggc () = 0; + object_allocator allocator; }; template @@ -215,9 +219,8 @@ private: template function_summary::function_summary (symbol_table *symtab, bool ggc MEM_STAT_DECL): - function_summary_base (symtab), m_ggc (ggc), m_map (13, ggc, true, - GATHER_STATISTICS - PASS_MEM_STAT) + function_summary_base (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, @@ -411,7 +414,7 @@ private: template fast_function_summary::fast_function_summary (symbol_table *symtab MEM_STAT_DECL): - function_summary_base (symtab), m_vector (NULL) + function_summary_base (symtab PASS_MEM_STAT), m_vector (NULL) { vec_alloc (m_vector, 13 PASS_MEM_STAT); this->m_symtab_insertion_hook @@ -531,8 +534,10 @@ class call_summary_base { 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. */ @@ -547,7 +552,8 @@ protected: { /* 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. */ @@ -559,7 +565,7 @@ protected: ggc_free (item); } else - delete item; + allocator.remove (item); } /* Unregister all call-graph hooks. */ @@ -578,6 +584,7 @@ protected: private: /* Return true when the summary uses GGC memory for allocation. */ virtual bool is_ggc () = 0; + object_allocator allocator; }; template @@ -607,9 +614,8 @@ public: /* Default construction takes SYMTAB as an argument. */ call_summary (symbol_table *symtab, bool ggc = false CXX_MEM_STAT_INFO) - : call_summary_base (symtab), m_ggc (ggc), m_map (13, ggc, true, - GATHER_STATISTICS - PASS_MEM_STAT) + : call_summary_base (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, @@ -775,7 +781,7 @@ class GTY((user)) fast_call_summary : public call_summary_base public: /* Default construction takes SYMTAB as an argument. */ fast_call_summary (symbol_table *symtab CXX_MEM_STAT_INFO) - : call_summary_base (symtab), m_vector (NULL) + : call_summary_base (symtab PASS_MEM_STAT), m_vector (NULL) { vec_alloc (m_vector, 13 PASS_MEM_STAT); this->m_symtab_removal_hook -- 2.7.4