hsa-brig.c: Include alloc-pool.h
authorJan Hubicka <jh@suse.cz>
Tue, 5 Nov 2019 10:38:02 +0000 (11:38 +0100)
committerJan Hubicka <hubicka@gcc.gnu.org>
Tue, 5 Nov 2019 10:38:02 +0000 (10:38 +0000)
* 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.

From-SVN: r277821

13 files changed:
gcc/ChangeLog
gcc/hsa-brig.c
gcc/hsa-dump.c
gcc/hsa-gen.c
gcc/hsa-regalloc.c
gcc/ipa-hsa.c
gcc/ipa-predicate.c
gcc/ipa-reference.c
gcc/ipa-sra.c
gcc/omp-expand.c
gcc/omp-general.c
gcc/omp-low.c
gcc/symbol-summary.h

index 39832efe348aa9f64b40939bf24d4be7b3f7d3c3..cf4b36ff291729db42d45e6193ca24b1471267d3 100644 (file)
@@ -1,3 +1,23 @@
+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
index 45f4149969aaa2379b790d668ff5321fdc0f64d5..14d5c52cc6f4d477b56b567e969367b38cb9fc08 100644 (file)
@@ -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"
index 2d856012c4a08065fe9f0283854c711781eae54a..d91b474c02823b5239430f4cbfc120648f00a78c 100644 (file)
@@ -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"
 
index 26e1e2496bf5d383da9dfb4e94de6d78178a9823..436f4c5f9f513de0c2da74f272552f812d10bbe5 100644 (file)
@@ -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"
index 597bb666c6eee3c73865aa3f13cd33f977130f7a..dd1937cdae822c37ec28c7cf1696c620dcf34545 100644 (file)
@@ -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"
 
index 654009bdf6fdee080ecf0d788578366c7fda18ad..369fe5a8de83edc73ab3f6d55d3f2915e331cdb0 100644 (file)
@@ -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"
 
index 721f0957f9f9bfbf062cd0f826ab12fd3c54cfdc..f9ec7ab490c3ba225e678b5c18ed80ea6f12fedc 100644 (file)
@@ -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"
index 09aa9280d0fc0a4e57ec04604bda86bae0716e0f..6713e2b30db3dbaefd8344cfdc900d02f59bd006 100644 (file)
@@ -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
index 7367441b10551c0bfbe2e808c8b042324f77cdb0..aceb5c722ea64adc6c58c3eadd086294337e7abe 100644 (file)
@@ -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"
index 0f703bede4713f69df8f6aad3361f73072e3faae..eadff6e50f86edcf07260dc0ab35758028e05073 100644 (file)
@@ -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"
index 7f8d7a84dcc14936c78e5ab5cbb723ac9db90be6..72a0f20feeea53bb1e05be449c7ea58827a60c2e 100644 (file)
@@ -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"
index cd7da6da0ef10cc9c2774b925c9c2705e7d12abb..122f4278881310e4638e22838f56dc1970b024a9 100644 (file)
@@ -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"
index f677f16e0cea1626b23c336d604ef43d9caaf4eb..d663cbb90fdd126cd0935c7e9673b36d39b87502 100644 (file)
@@ -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<T> allocator;
 };
 
 template <typename T>
@@ -215,9 +219,8 @@ private:
 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,
@@ -411,7 +414,7 @@ private:
 
 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
@@ -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<T> allocator;
 };
 
 template <typename T>
@@ -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<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,
@@ -775,7 +781,7 @@ class GTY((user)) fast_call_summary <T *, V>: public call_summary_base<T>
 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