#include "system.h"
#include "coretypes.h"
#include "tm.h"
-#include "hash-set.h"
-#include "machmode.h"
-#include "vec.h"
-#include "double-int.h"
-#include "input.h"
#include "alias.h"
#include "symtab.h"
-#include "wide-int.h"
-#include "inchash.h"
#include "tree.h"
#include "fold-const.h"
#include "predict.h"
#include "dominance.h"
#include "cfg.h"
#include "basic-block.h"
-#include "hash-map.h"
-#include "is-a.h"
-#include "plugin-api.h"
#include "hard-reg-set.h"
-#include "input.h"
#include "function.h"
-#include "ipa-ref.h"
#include "cgraph.h"
#include "tree-pass.h"
#include "tree-ssa-alias.h"
duplicate entries. */
vec<histogram_entry *> histogram;
-static alloc_pool histogram_pool;
+static pool_allocator<histogram_entry> histogram_pool
+ ("IPA histogram", 10);
/* Hashtable support for storing SSA names hashed by their SSA_NAME_VAR. */
-struct histogram_hash : typed_noop_remove <histogram_entry>
+struct histogram_hash : nofree_ptr_hash <histogram_entry>
{
- typedef histogram_entry value_type;
- typedef histogram_entry compare_type;
- static inline hashval_t hash (const value_type *);
- static inline int equal (const value_type *, const compare_type *);
+ static inline hashval_t hash (const histogram_entry *);
+ static inline int equal (const histogram_entry *, const histogram_entry *);
};
inline hashval_t
if (!*val)
{
- *val = (histogram_entry *) pool_alloc (histogram_pool);
+ *val = histogram_pool.allocate ();
**val = key;
histogram.safe_push (*val);
}
{
cumulated_time += histogram[i]->count * histogram[i]->time;
cumulated_size += histogram[i]->size;
- fprintf (file, " %"PRId64": time:%i (%2.2f) size:%i (%2.2f)\n",
+ fprintf (file, " %" PRId64": time:%i (%2.2f) size:%i (%2.2f)\n",
(int64_t) histogram[i]->count,
histogram[i]->time,
cumulated_time * 100.0 / overall_time,
basic_block bb;
hash_table<histogram_hash> hashtable (10);
- histogram_pool = create_alloc_pool ("IPA histogram", sizeof (struct histogram_entry),
- 10);
FOR_EACH_FUNCTION_WITH_GIMPLE_BODY (node)
FOR_EACH_BB_FN (bb, DECL_STRUCT_FUNCTION (node->decl))
int j = 0;
hash_table<histogram_hash> hashtable (10);
- histogram_pool = create_alloc_pool ("IPA histogram", sizeof (struct histogram_entry),
- 10);
while ((file_data = file_data_vec[j++]))
{
{
gcov_type min, cumulated_time = 0, cumulated_size = 0;
- fprintf (dump_file, "Overall time: %"PRId64"\n",
+ fprintf (dump_file, "Overall time: %" PRId64"\n",
(int64_t)overall_time);
min = get_hot_bb_threshold ();
for (i = 0; i < (int)histogram.length () && histogram[i]->count >= min;
cumulated_time += histogram[i]->count * histogram[i]->time;
cumulated_size += histogram[i]->size;
}
- fprintf (dump_file, "GCOV min count: %"PRId64
+ fprintf (dump_file, "GCOV min count: %" PRId64
" Time:%3.2f%% Size:%3.2f%%\n",
(int64_t)min,
cumulated_time * 100.0 / overall_time,
cumulated_time += histogram[i]->count * histogram[i]->time;
cumulated_size += histogram[i]->size;
}
- fprintf (dump_file, "Determined min count: %"PRId64
+ fprintf (dump_file, "Determined min count: %" PRId64
" Time:%3.2f%% Size:%3.2f%%\n",
(int64_t)threshold,
cumulated_time * 100.0 / overall_time,
}
}
histogram.release ();
- free_alloc_pool (histogram_pool);
+ histogram_pool.release ();
/* Produce speculative calls: we saved common traget from porfiling into
e->common_target_id. Now, at link time, we can look up corresponding