+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>
* config/aarch64/aarch64.c (aarch64_sve_cmp_immediate_p)
if (pre_ipa_mem_report)
{
fprintf (stderr, "Memory consumption before IPA\n");
- dump_memory_report (false);
+ dump_memory_report ();
}
if (!quiet_flag)
fprintf (stderr, "Performing interprocedural optimizations\n");
if (post_ipa_mem_report)
{
fprintf (stderr, "Memory consumption after IPA\n");
- dump_memory_report (false);
+ dump_memory_report ();
}
timevar_pop (TV_CGRAPHOPT);
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. */
static inline void
dump_header (const char *name)
/* Dump per-site memory statistics. */
void
-dump_ggc_loc_statistics (bool final)
+dump_ggc_loc_statistics ()
{
if (! GATHER_STATISTICS)
return;
ggc_force_collect = true;
ggc_collect ();
- ggc_mem_desc.dump (GGC_ORIGIN, final ? ggc_usage::compare_final : NULL);
+ ggc_mem_desc.dump (GGC_ORIGIN);
ggc_force_collect = false;
}
/* Free a block. To be used when known for certain it's not reachable. */
extern void ggc_free (void *);
-extern void dump_ggc_loc_statistics (bool);
+extern void dump_ggc_loc_statistics ();
/* Reallocator. */
#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>
* lto-partition.c (add_symbol_to_partition_1): Update.
if (pre_ipa_mem_report)
{
fprintf (stderr, "Memory consumption before IPA\n");
- dump_memory_report (false);
+ dump_memory_report ();
}
symtab->function_flags_ready = true;
if (post_ipa_mem_report)
{
fprintf (stderr, "Memory consumption after IPA\n");
- dump_memory_report (false);
+ dump_memory_report ();
}
/* Show the LTO report before launching LTRANS. */
if (flag_lto_report || (flag_wpa && flag_lto_report_wpa))
print_lto_report_1 ();
if (mem_report_wpa)
- dump_memory_report (true);
+ dump_memory_report ();
}
/* Create artificial pointers for "omp declare target link" vars. */
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,
CMP comparator can be provided. */
- mem_list_t *get_list (mem_alloc_origin origin, unsigned *length,
- int (*cmp) (const void *first,
- const void *second) = NULL);
+ mem_list_t *get_list (mem_alloc_origin origin, unsigned *length);
/* Dump all tracked instances of type ORIGIN. If we want to process custom
order, CMP comparator can be provided. */
- void dump (mem_alloc_origin origin,
- int (*cmp) (const void *first, const void *second) = NULL);
+ void dump (mem_alloc_origin origin);
/* Reverse object map used for every object allocation mapping. */
reverse_object_map_t *m_reverse_object_map;
template <class T>
inline
typename mem_alloc_description<T>::mem_list_t *
-mem_alloc_description<T>::get_list (mem_alloc_origin origin, unsigned *length,
- int (*cmp) (const void *first,
- const void *second))
+mem_alloc_description<T>::get_list (mem_alloc_origin origin, unsigned *length)
{
/* vec data structure is not used because all vectors generate memory
allocation info a it would create a cycle. */
if ((*it).first->m_origin == origin)
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;
return list;
template <class T>
inline void
-mem_alloc_description<T>::dump (mem_alloc_origin origin,
- int (*cmp) (const void *first,
- const void *second))
+mem_alloc_description<T>::dump (mem_alloc_origin origin)
{
unsigned length;
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::print_dash_line ();
}
void
-dump_memory_report (bool final)
+dump_memory_report ()
{
dump_line_table_statistics ();
ggc_print_statistics ();
dump_bitmap_statistics ();
dump_hash_table_loc_statistics ();
dump_vec_loc_statistics ();
- dump_ggc_loc_statistics (final);
+ dump_ggc_loc_statistics ();
dump_alias_stats (stderr);
dump_pta_stats (stderr);
}
}
if (mem_report)
- dump_memory_report (true);
+ dump_memory_report ();
if (profile_report)
dump_profile_report ();
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 target_reinit (void);