Commit c5281d50 by Martin Liska Committed by Martin Liska

Remove misleading sorting function in ggc memory report.

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

	* cgraphunit.c (symbol_table::compile): Remove argument
	for dump_memory_report.
	* ggc-common.c (dump_ggc_loc_statistics): Likewise.
	(compare_final): Remove in order to make report
	better readable.
	* ggc.h (dump_ggc_loc_statistics):  Remove argument.
	* mem-stats.h (mem_alloc_description::get_list):
	Do not pass cmp.
	(mem_alloc_description::dump): Likewise here.
	* toplev.c (dump_memory_report): Remove final
	argument.
	(finalize): Likewise.
	* toplev.h (dump_memory_report): Remove argument.
2019-10-29  Martin Liska  <mliska@suse.cz>

	* lto.c (do_whole_program_analysis): Remove argument.

From-SVN: r277557
parent 6bc67182
2019-10-29 Martin Liska <mliska@suse.cz>
* cgraphunit.c (symbol_table::compile): Remove argument
for dump_memory_report.
* ggc-common.c (dump_ggc_loc_statistics): Likewise.
(compare_final): Remove in order to make report
better readable.
* ggc.h (dump_ggc_loc_statistics): Remove argument.
* mem-stats.h (mem_alloc_description::get_list):
Do not pass cmp.
(mem_alloc_description::dump): Likewise here.
* toplev.c (dump_memory_report): Remove final
argument.
(finalize): Likewise.
* toplev.h (dump_memory_report): Remove argument.
2019-10-29 Richard Sandiford <richard.sandiford@arm.com> 2019-10-29 Richard Sandiford <richard.sandiford@arm.com>
* config/aarch64/aarch64.c (aarch64_sve_cmp_immediate_p) * config/aarch64/aarch64.c (aarch64_sve_cmp_immediate_p)
...@@ -2604,7 +2604,7 @@ symbol_table::compile (void) ...@@ -2604,7 +2604,7 @@ symbol_table::compile (void)
if (pre_ipa_mem_report) if (pre_ipa_mem_report)
{ {
fprintf (stderr, "Memory consumption before IPA\n"); fprintf (stderr, "Memory consumption before IPA\n");
dump_memory_report (false); dump_memory_report ();
} }
if (!quiet_flag) if (!quiet_flag)
fprintf (stderr, "Performing interprocedural optimizations\n"); fprintf (stderr, "Performing interprocedural optimizations\n");
...@@ -2639,7 +2639,7 @@ symbol_table::compile (void) ...@@ -2639,7 +2639,7 @@ symbol_table::compile (void)
if (post_ipa_mem_report) if (post_ipa_mem_report)
{ {
fprintf (stderr, "Memory consumption after IPA\n"); fprintf (stderr, "Memory consumption after IPA\n");
dump_memory_report (false); dump_memory_report ();
} }
timevar_pop (TV_CGRAPHOPT); timevar_pop (TV_CGRAPHOPT);
......
...@@ -933,21 +933,6 @@ public: ...@@ -933,21 +933,6 @@ public:
return s.second->get_balance () - f.second->get_balance (); return s.second->get_balance () - f.second->get_balance ();
} }
/* Compare rows in final GGC summary dump. */
static int
compare_final (const void *first, const void *second)
{
typedef std::pair<mem_location *, ggc_usage *> mem_pair_t;
const ggc_usage *f = ((const mem_pair_t *)first)->second;
const ggc_usage *s = ((const mem_pair_t *)second)->second;
size_t a = f->m_allocated + f->m_overhead - f->m_freed;
size_t b = s->m_allocated + s->m_overhead - s->m_freed;
return a == b ? 0 : (a < b ? 1 : -1);
}
/* Dump header with NAME. */ /* Dump header with NAME. */
static inline void static inline void
dump_header (const char *name) dump_header (const char *name)
...@@ -970,7 +955,7 @@ static mem_alloc_description<ggc_usage> ggc_mem_desc; ...@@ -970,7 +955,7 @@ static mem_alloc_description<ggc_usage> ggc_mem_desc;
/* Dump per-site memory statistics. */ /* Dump per-site memory statistics. */
void void
dump_ggc_loc_statistics (bool final) dump_ggc_loc_statistics ()
{ {
if (! GATHER_STATISTICS) if (! GATHER_STATISTICS)
return; return;
...@@ -978,7 +963,7 @@ dump_ggc_loc_statistics (bool final) ...@@ -978,7 +963,7 @@ dump_ggc_loc_statistics (bool final)
ggc_force_collect = true; ggc_force_collect = true;
ggc_collect (); ggc_collect ();
ggc_mem_desc.dump (GGC_ORIGIN, final ? ggc_usage::compare_final : NULL); ggc_mem_desc.dump (GGC_ORIGIN);
ggc_force_collect = false; ggc_force_collect = false;
} }
......
...@@ -149,7 +149,7 @@ extern void *ggc_realloc (void *, size_t CXX_MEM_STAT_INFO); ...@@ -149,7 +149,7 @@ extern void *ggc_realloc (void *, size_t CXX_MEM_STAT_INFO);
/* Free a block. To be used when known for certain it's not reachable. */ /* Free a block. To be used when known for certain it's not reachable. */
extern void ggc_free (void *); extern void ggc_free (void *);
extern void dump_ggc_loc_statistics (bool); extern void dump_ggc_loc_statistics ();
/* Reallocator. */ /* Reallocator. */
#define GGC_RESIZEVEC(T, P, N) \ #define GGC_RESIZEVEC(T, P, N) \
......
2019-10-29 Martin Liska <mliska@suse.cz>
* lto.c (do_whole_program_analysis): Remove argument.
2019-10-24 Jan Hubicka <hubicka@ucw.cz> 2019-10-24 Jan Hubicka <hubicka@ucw.cz>
* lto-partition.c (add_symbol_to_partition_1): Update. * lto-partition.c (add_symbol_to_partition_1): Update.
......
...@@ -457,7 +457,7 @@ do_whole_program_analysis (void) ...@@ -457,7 +457,7 @@ do_whole_program_analysis (void)
if (pre_ipa_mem_report) if (pre_ipa_mem_report)
{ {
fprintf (stderr, "Memory consumption before IPA\n"); fprintf (stderr, "Memory consumption before IPA\n");
dump_memory_report (false); dump_memory_report ();
} }
symtab->function_flags_ready = true; symtab->function_flags_ready = true;
...@@ -539,14 +539,14 @@ do_whole_program_analysis (void) ...@@ -539,14 +539,14 @@ do_whole_program_analysis (void)
if (post_ipa_mem_report) if (post_ipa_mem_report)
{ {
fprintf (stderr, "Memory consumption after IPA\n"); fprintf (stderr, "Memory consumption after IPA\n");
dump_memory_report (false); dump_memory_report ();
} }
/* Show the LTO report before launching LTRANS. */ /* Show the LTO report before launching LTRANS. */
if (flag_lto_report || (flag_wpa && flag_lto_report_wpa)) if (flag_lto_report || (flag_wpa && flag_lto_report_wpa))
print_lto_report_1 (); print_lto_report_1 ();
if (mem_report_wpa) if (mem_report_wpa)
dump_memory_report (true); dump_memory_report ();
} }
/* Create artificial pointers for "omp declare target link" vars. */ /* Create artificial pointers for "omp declare target link" vars. */
......
...@@ -361,14 +361,11 @@ public: ...@@ -361,14 +361,11 @@ public:
are filtered by ORIGIN type, LENGTH is return value where we register are filtered by ORIGIN type, LENGTH is return value where we register
the number of elements in the list. If we want to process custom order, the number of elements in the list. If we want to process custom order,
CMP comparator can be provided. */ CMP comparator can be provided. */
mem_list_t *get_list (mem_alloc_origin origin, unsigned *length, mem_list_t *get_list (mem_alloc_origin origin, unsigned *length);
int (*cmp) (const void *first,
const void *second) = NULL);
/* Dump all tracked instances of type ORIGIN. If we want to process custom /* Dump all tracked instances of type ORIGIN. If we want to process custom
order, CMP comparator can be provided. */ order, CMP comparator can be provided. */
void dump (mem_alloc_origin origin, void dump (mem_alloc_origin origin);
int (*cmp) (const void *first, const void *second) = NULL);
/* Reverse object map used for every object allocation mapping. */ /* Reverse object map used for every object allocation mapping. */
reverse_object_map_t *m_reverse_object_map; reverse_object_map_t *m_reverse_object_map;
...@@ -593,9 +590,7 @@ mem_alloc_description<T>::~mem_alloc_description () ...@@ -593,9 +590,7 @@ mem_alloc_description<T>::~mem_alloc_description ()
template <class T> template <class T>
inline inline
typename mem_alloc_description<T>::mem_list_t * typename mem_alloc_description<T>::mem_list_t *
mem_alloc_description<T>::get_list (mem_alloc_origin origin, unsigned *length, mem_alloc_description<T>::get_list (mem_alloc_origin origin, unsigned *length)
int (*cmp) (const void *first,
const void *second))
{ {
/* vec data structure is not used because all vectors generate memory /* vec data structure is not used because all vectors generate memory
allocation info a it would create a cycle. */ allocation info a it would create a cycle. */
...@@ -608,7 +603,7 @@ mem_alloc_description<T>::get_list (mem_alloc_origin origin, unsigned *length, ...@@ -608,7 +603,7 @@ mem_alloc_description<T>::get_list (mem_alloc_origin origin, unsigned *length,
if ((*it).first->m_origin == origin) if ((*it).first->m_origin == origin)
list[i++] = std::pair<mem_location*, T*> (*it); list[i++] = std::pair<mem_location*, T*> (*it);
qsort (list, i, element_size, cmp == NULL ? T::compare : cmp); qsort (list, i, element_size, T::compare);
*length = i; *length = i;
return list; return list;
...@@ -637,15 +632,13 @@ mem_alloc_description<T>::get_sum (mem_alloc_origin origin) ...@@ -637,15 +632,13 @@ mem_alloc_description<T>::get_sum (mem_alloc_origin origin)
template <class T> template <class T>
inline void inline void
mem_alloc_description<T>::dump (mem_alloc_origin origin, mem_alloc_description<T>::dump (mem_alloc_origin origin)
int (*cmp) (const void *first,
const void *second))
{ {
unsigned length; unsigned length;
fprintf (stderr, "\n"); fprintf (stderr, "\n");
mem_list_t *list = get_list (origin, &length, cmp); mem_list_t *list = get_list (origin, &length);
T total = get_sum (origin); T total = get_sum (origin);
T::print_dash_line (); T::print_dash_line ();
......
...@@ -1994,7 +1994,7 @@ target_reinit (void) ...@@ -1994,7 +1994,7 @@ target_reinit (void)
} }
void void
dump_memory_report (bool final) dump_memory_report ()
{ {
dump_line_table_statistics (); dump_line_table_statistics ();
ggc_print_statistics (); ggc_print_statistics ();
...@@ -2006,7 +2006,7 @@ dump_memory_report (bool final) ...@@ -2006,7 +2006,7 @@ dump_memory_report (bool final)
dump_bitmap_statistics (); dump_bitmap_statistics ();
dump_hash_table_loc_statistics (); dump_hash_table_loc_statistics ();
dump_vec_loc_statistics (); dump_vec_loc_statistics ();
dump_ggc_loc_statistics (final); dump_ggc_loc_statistics ();
dump_alias_stats (stderr); dump_alias_stats (stderr);
dump_pta_stats (stderr); dump_pta_stats (stderr);
} }
...@@ -2058,7 +2058,7 @@ finalize (bool no_backend) ...@@ -2058,7 +2058,7 @@ finalize (bool no_backend)
} }
if (mem_report) if (mem_report)
dump_memory_report (true); dump_memory_report ();
if (profile_report) if (profile_report)
dump_profile_report (); dump_profile_report ();
......
...@@ -66,7 +66,7 @@ extern bool wrapup_global_declarations (tree *, int); ...@@ -66,7 +66,7 @@ extern bool wrapup_global_declarations (tree *, int);
extern void global_decl_processing (void); extern void global_decl_processing (void);
extern void dump_memory_report (bool); extern void dump_memory_report ();
extern void dump_profile_report (void); extern void dump_profile_report (void);
extern void target_reinit (void); extern void target_reinit (void);
......
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