summaryrefslogtreecommitdiffhomepage
path: root/ir/stat
diff options
context:
space:
mode:
authorChristoph Mallon <mallon@cs.uni-saarland.de>2015-07-16 08:17:03 +0200
committerChristoph Mallon <mallon@cs.uni-saarland.de>2015-07-16 08:59:09 +0200
commitd3945d4edfd9f53cb9ae608dc749ef81e516b513 (patch)
tree4936c099227fc32b17ff3c1b192a04d7997ac2f1 /ir/stat
parent7964db4f1f67ecbe183a35801575a6a4f4607582 (diff)
Remove unused Perm statistics.
Diffstat (limited to 'ir/stat')
-rw-r--r--ir/stat/distrib.c30
-rw-r--r--ir/stat/firmstat.c185
-rw-r--r--ir/stat/firmstat_t.h65
-rw-r--r--ir/stat/stat_dmp.c103
4 files changed, 2 insertions, 381 deletions
diff --git a/ir/stat/distrib.c b/ir/stat/distrib.c
index 0eb0844..efee9b9 100644
--- a/ir/stat/distrib.c
+++ b/ir/stat/distrib.c
@@ -113,24 +113,6 @@ static distrib_entry_t *distrib_get_entry(distrib_tbl_t *tbl, const void *object
}
/*
- * adds a new object count into the distribution table
- */
-void stat_add_distrib_tbl(distrib_tbl_t *tbl, const void *object, const counter_t *cnt)
-{
- distrib_entry_t *elem = distrib_get_entry(tbl, object);
-
- cnt_add(&elem->cnt, cnt);
-}
-
-/*
- * adds a new key count into the integer distribution table
- */
-void stat_add_int_distrib_tbl(distrib_tbl_t *tbl, int key, const counter_t *cnt)
-{
- stat_add_distrib_tbl(tbl, INT_TO_PTR(key), cnt);
-}
-
-/*
* increases object count by one
*/
void stat_inc_distrib_tbl(distrib_tbl_t *tbl, const void *object)
@@ -168,18 +150,6 @@ void stat_insert_int_distrib_tbl(distrib_tbl_t *tbl, int key)
}
/*
- * returns the sum over all counters in a distribution table
- */
-int stat_get_count_distrib_tbl(distrib_tbl_t *tbl)
-{
- counter_t cnt = ZERO_CNT;
-
- foreach_pset(tbl->hash_map, distrib_entry_t, entry)
- cnt_add(&cnt, &entry->cnt);
- return cnt_to_uint(&cnt);
-}
-
-/*
* calculates the mean value of a distribution
*/
double stat_calc_mean_distrib_tbl(distrib_tbl_t *tbl)
diff --git a/ir/stat/firmstat.c b/ir/stat/firmstat.c
index bff14e9..c1a0d88 100644
--- a/ir/stat/firmstat.c
+++ b/ir/stat/firmstat.c
@@ -120,28 +120,6 @@ static int reg_pressure_cmp(const void *elt, const void *key)
}
/**
- * Compare two elements of the perm_stat hash.
- */
-static int perm_stat_cmp(const void *elt, const void *key)
-{
- const perm_stat_entry_t *e1 = (const perm_stat_entry_t*)elt;
- const perm_stat_entry_t *e2 = (const perm_stat_entry_t*)key;
-
- return e1->perm != e2->perm;
-}
-
-/**
- * Compare two elements of the perm_class hash.
- */
-static int perm_class_cmp(const void *elt, const void *key)
-{
- const perm_class_entry_t *e1 = (const perm_class_entry_t*)elt;
- const perm_class_entry_t *e2 = (const perm_class_entry_t*)key;
-
- return e1->class_name != e2->class_name;
-}
-
-/**
* Compare two elements of the ir_op hash.
*/
static int opcode_cmp_2(const void *elt, const void *key)
@@ -371,12 +349,8 @@ static void be_block_clear_entry(be_block_entry_t *elem)
if (elem->sched_ready)
stat_delete_distrib_tbl(elem->sched_ready);
- if (elem->perm_class_stat)
- del_pset(elem->perm_class_stat);
-
- elem->reg_pressure = new_pset(reg_pressure_cmp, 5);
- elem->sched_ready = stat_new_int_distrib_tbl();
- elem->perm_class_stat = new_pset(perm_class_cmp, 5);
+ elem->reg_pressure = new_pset(reg_pressure_cmp, 5);
+ elem->sched_ready = stat_new_int_distrib_tbl();
}
/**
@@ -407,87 +381,6 @@ static be_block_entry_t *be_block_get_entry(struct obstack *obst, long block_nr,
}
/**
- * clears all sets in perm_class_entry_t
- */
-static void perm_class_clear_entry(perm_class_entry_t *elem)
-{
- if (elem->perm_stat)
- del_pset(elem->perm_stat);
-
- elem->perm_stat = new_pset(perm_stat_cmp, 5);
-}
-
-/**
- * Returns the associated perm_class entry for a register class.
- *
- * @param class_name the register class name
- * @param hmap a hash map containing class_name -> perm_class_entry_t
- */
-static perm_class_entry_t *perm_class_get_entry(struct obstack *obst, const char *class_name,
- hmap_perm_class_entry_t *hmap)
-{
- perm_class_entry_t key;
- perm_class_entry_t *elem;
-
- key.class_name = class_name;
-
- elem = (perm_class_entry_t*)pset_find(hmap, &key, hash_ptr(class_name));
- if (elem)
- return elem;
-
- elem = OALLOCZ(obst, perm_class_entry_t);
-
- /* clear new counter */
- perm_class_clear_entry(elem);
-
- elem->class_name = class_name;
-
- return (perm_class_entry_t*)pset_insert(hmap, elem, hash_ptr(class_name));
-}
-
-/**
- * clears all sets in perm_stat_entry_t
- */
-static void perm_stat_clear_entry(perm_stat_entry_t *elem)
-{
- if (elem->chains)
- stat_delete_distrib_tbl(elem->chains);
-
- if (elem->cycles)
- stat_delete_distrib_tbl(elem->cycles);
-
- elem->chains = stat_new_int_distrib_tbl();
- elem->cycles = stat_new_int_distrib_tbl();
-}
-
-/**
- * Returns the associated perm_stat entry for a perm.
- *
- * @param perm the perm node
- * @param hmap a hash map containing perm -> perm_stat_entry_t
- */
-static perm_stat_entry_t *perm_stat_get_entry(struct obstack *obst, ir_node *perm, hmap_perm_stat_entry_t *hmap)
-{
- perm_stat_entry_t key;
- perm_stat_entry_t *elem;
-
- key.perm = perm;
-
- elem = (perm_stat_entry_t*)pset_find(hmap, &key, hash_ptr(perm));
- if (elem)
- return elem;
-
- elem = OALLOCZ(obst, perm_stat_entry_t);
-
- /* clear new counter */
- perm_stat_clear_entry(elem);
-
- elem->perm = perm;
-
- return (perm_stat_entry_t*)pset_insert(hmap, elem, hash_ptr(perm));
-}
-
-/**
* Clear optimizations counter,
*/
static void clear_optimization_counter(void)
@@ -1865,80 +1758,6 @@ void stat_be_block_sched_ready(ir_graph *irg, ir_node *block, int num_ready)
STAT_LEAVE;
}
-/**
- * Update the permutation statistic of a block.
- *
- * @param class_name the name of the register class
- * @param n_regs number of registers in the register class
- * @param perm the perm node
- * @param block the block containing the perm
- * @param size the size of the perm
- * @param real_size number of pairs with different registers
- */
-void stat_be_block_stat_perm(const char *class_name, int n_regs, ir_node *perm, ir_node *block,
- int size, int real_size)
-{
- if (! status->stat_options)
- return;
-
- STAT_ENTER;
- {
- graph_entry_t *graph = graph_get_entry(get_irn_irg(block), status->irg_hash);
- be_block_entry_t *block_ent;
- perm_class_entry_t *pc_ent;
- perm_stat_entry_t *ps_ent;
-
- block_ent = be_block_get_entry(&status->be_data, get_irn_node_nr(block), graph->be_block_hash);
- pc_ent = perm_class_get_entry(&status->be_data, class_name, block_ent->perm_class_stat);
- ps_ent = perm_stat_get_entry(&status->be_data, perm, pc_ent->perm_stat);
-
- pc_ent->n_regs = n_regs;
-
- /* update information */
- ps_ent->size = size;
- ps_ent->real_size = real_size;
- }
- STAT_LEAVE;
-}
-
-/**
- * Update the permutation statistic of a single perm.
- *
- * @param class_name the name of the register class
- * @param perm the perm node
- * @param block the block containing the perm
- * @param is_chain 1 if chain, 0 if cycle
- * @param size length of the cycle/chain
- * @param n_ops the number of ops representing this cycle/chain after lowering
- */
-void stat_be_block_stat_permcycle(const char *class_name, ir_node *perm, ir_node *block,
- int is_chain, int size, int n_ops)
-{
- if (! status->stat_options)
- return;
-
- STAT_ENTER;
- {
- graph_entry_t *graph = graph_get_entry(get_irn_irg(block), status->irg_hash);
- be_block_entry_t *block_ent;
- perm_class_entry_t *pc_ent;
- perm_stat_entry_t *ps_ent;
-
- block_ent = be_block_get_entry(&status->be_data, get_irn_node_nr(block), graph->be_block_hash);
- pc_ent = perm_class_get_entry(&status->be_data, class_name, block_ent->perm_class_stat);
- ps_ent = perm_stat_get_entry(&status->be_data, perm, pc_ent->perm_stat);
-
- if (is_chain) {
- ps_ent->n_copies += n_ops;
- stat_inc_int_distrib_tbl(ps_ent->chains, size);
- } else {
- ps_ent->n_exchg += n_ops;
- stat_inc_int_distrib_tbl(ps_ent->cycles, size);
- }
- }
- STAT_LEAVE;
-}
-
/* Dumps a statistics snapshot. */
void stat_dump_snapshot(const char *name, const char *phase)
{
diff --git a/ir/stat/firmstat_t.h b/ir/stat/firmstat_t.h
index 3055051..19bbccf 100644
--- a/ir/stat/firmstat_t.h
+++ b/ir/stat/firmstat_t.h
@@ -35,8 +35,6 @@ typedef pset hmap_opt_entry_t;
typedef pset hmap_block_entry_t;
typedef pset hmap_be_block_entry_t;
typedef pset hmap_reg_pressure_entry_t;
-typedef pset hmap_perm_stat_entry_t;
-typedef pset hmap_perm_class_entry_t;
typedef pset hmap_ir_op;
typedef pset hmap_distrib_entry_t;
@@ -291,28 +289,6 @@ typedef struct reg_pressure_entry_t {
} reg_pressure_entry_t;
/**
- * An entry for permutation statistics.
- */
-typedef struct perm_stat_entry_t {
- ir_node *perm; /**< the perm node */
- int size; /**< complete size */
- int real_size; /**< number of pairs with different registers */
- int n_copies; /**< number of copies created for lowering */
- int n_exchg; /**< number of exchanges created for lowering */
- distrib_tbl_t *cycles; /**< distribution of cycle lengths */
- distrib_tbl_t *chains; /**< distribution of chain lengths */
-} perm_stat_entry_t;
-
-/**
- * An entry for permutation statistics per class.
- */
-typedef struct perm_class_entry_t {
- const char *class_name; /**< name of the register class */
- int n_regs; /**< number of register in this class */
- HASH_MAP(perm_stat_entry_t) *perm_stat; /**< statistics about all perm nodes of this class */
-} perm_class_entry_t;
-
-/**
* An entry for a block or extended block in a ir-graph
*/
typedef struct be_block_entry_t {
@@ -320,7 +296,6 @@ typedef struct be_block_entry_t {
distrib_tbl_t *sched_ready; /**< distribution of ready nodes per block */
/**< the highest register pressures for this block for each register class */
HASH_MAP(reg_pressure_entry_t) *reg_pressure;
- HASH_MAP(perm_class_entry_t) *perm_class_stat; /**< statistics about perm nodes for each register class */
} be_block_entry_t;
/**
@@ -490,16 +465,6 @@ distrib_tbl_t *stat_new_int_distrib_tbl(void);
void stat_delete_distrib_tbl(distrib_tbl_t *tbl);
/**
- * adds a new object count into the distribution table.
- */
-void stat_add_distrib_tbl(distrib_tbl_t *tbl, const void *object, const counter_t *cnt);
-
-/**
- * adds a new key count into the integer distribution table.
- */
-void stat_add_int_distrib_tbl(distrib_tbl_t *tbl, int key, const counter_t *cnt);
-
-/**
* increases object count by one
*/
void stat_inc_distrib_tbl(distrib_tbl_t *tbl, const void *object);
@@ -522,11 +487,6 @@ void stat_insert_distrib_tbl(distrib_tbl_t *tbl, const void *object);
void stat_insert_int_distrib_tbl(distrib_tbl_t *tbl, int key);
/**
- * returns the sum over all counters in a distribution table
- */
-int stat_get_count_distrib_tbl(distrib_tbl_t *tbl);
-
-/**
* calculates the mean value of a distribution.
*/
double stat_calc_mean_distrib_tbl(distrib_tbl_t *tbl);
@@ -587,31 +547,6 @@ void stat_be_block_regpressure(ir_graph *irg, ir_node *block, int pressure, cons
void stat_be_block_sched_ready(ir_graph *irg, ir_node *block, int num_ready);
/**
- * Update the permutation statistic of a block
- *
- * @param class_name the name of the register class
- * @param perm the perm node
- * @param block the block containing the perm
- * @param size the size of the perm
- * @param real_size number of pairs with different registers
- */
-void stat_be_block_stat_perm(const char *class_name, int n_regs, ir_node *perm, ir_node *block,
- int size, int real_size);
-
-/**
- * Update the permutation statistic of a single perm
- *
- * @param class_name the name of the register class
- * @param perm the perm node
- * @param block the block containing the perm
- * @param is_chain 1 if chain, 0 if cycle
- * @param size length of the cycle/chain
- * @param n_ops the number of ops representing this cycle/chain after lowering
- */
-void stat_be_block_stat_permcycle(const char *class_name, ir_node *perm, ir_node *block,
- int is_chain, int size, int n_ops);
-
-/**
* Register an additional function for all dumper. This function
* is called in dump_snapshot once for each graph_entry and dumper.
*
diff --git a/ir/stat/stat_dmp.c b/ir/stat/stat_dmp.c
index f6513de..e6d8b5b 100644
--- a/ir/stat/stat_dmp.c
+++ b/ir/stat/stat_dmp.c
@@ -276,106 +276,6 @@ static void simple_dump_be_block_sched_ready(dumper_t *dmp, graph_entry_t *entry
}
/**
- * Adds the counter for given entry to another distribution table.
- */
-static void add_distrib_entry(const distrib_entry_t *entry, void *env)
-{
- distrib_tbl_t *sum_tbl = (distrib_tbl_t*)env;
-
- stat_add_int_distrib_tbl(sum_tbl, (int)PTR_TO_INT(entry->object), &entry->cnt);
-}
-
-/**
- * dumps permutation statistics for one and block and one class
- */
-static void simple_dump_be_block_permstat_class(dumper_t *dmp, perm_class_entry_t *entry)
-{
- distrib_tbl_t *sum_chains = stat_new_int_distrib_tbl();
- distrib_tbl_t *sum_cycles = stat_new_int_distrib_tbl();
- char buf[16];
- int i;
-
- fprintf(dmp->f, "%12s %12s %12s %12s %12s %12s\n",
- "size",
- "real size",
- "# chains",
- "# cycles",
- "# copies",
- "# exchanges"
- );
-
- foreach_pset(entry->perm_stat, perm_stat_entry_t, ps_ent) {
- fprintf(dmp->f, "%12d %12d %12d %12d %12d %12d\n",
- ps_ent->size,
- ps_ent->real_size,
- stat_get_count_distrib_tbl(ps_ent->chains),
- stat_get_count_distrib_tbl(ps_ent->cycles),
- ps_ent->n_copies,
- ps_ent->n_exchg
- );
-
- /* sum up distribution table for chains */
- stat_iterate_distrib_tbl(ps_ent->chains, add_distrib_entry, sum_chains);
-
- /* sum up distribution table for cycles */
- stat_iterate_distrib_tbl(ps_ent->cycles, add_distrib_entry, sum_cycles);
- }
-
- /* print chain distribution for all perms of this class in this block */
- fprintf(dmp->f, "chain distribution:\n");
-
- /* add all missing entries to chain distribution table */
- for (i = 1; i <= entry->n_regs; i++) {
- snprintf(buf, sizeof(buf), "length %d", i);
- fprintf(dmp->f, "%12s", buf);
- stat_insert_int_distrib_tbl(sum_chains, i);
- }
- fprintf(dmp->f, "\n");
- stat_iterate_distrib_tbl(sum_chains, simple_dump_distrib_entry, dmp);
- fprintf(dmp->f, "\n");
-
- /* print cycle distribution for all perms of this class in this block */
- fprintf(dmp->f, "cycle distribution:\n");
-
- /* add all missing entries to cycle distribution table */
- for (i = 1; i <= entry->n_regs; i++) {
- snprintf(buf, sizeof(buf), "length %d", i);
- fprintf(dmp->f, "%12s", buf);
- stat_insert_int_distrib_tbl(sum_cycles, i);
- }
- fprintf(dmp->f, "\n");
- stat_iterate_distrib_tbl(sum_cycles, simple_dump_distrib_entry, dmp);
- fprintf(dmp->f, "\n");
-
- /* delete temporary sum distribution tables */
- stat_delete_distrib_tbl(sum_chains);
- stat_delete_distrib_tbl(sum_cycles);
-
-}
-
-/**
- * dumps statistics about perms
- */
-static void simple_dump_be_block_permstat(dumper_t *dmp, graph_entry_t *entry)
-{
- if (pset_count(entry->be_block_hash) > 0) {
- fprintf(dmp->f, "\nPERMUTATION STATISTICS BEGIN:\n");
- foreach_pset(entry->be_block_hash, be_block_entry_t, b_entry) {
- fprintf(dmp->f, "BLOCK %ld:\n", b_entry->block_nr);
-
- if (b_entry->perm_class_stat) {
- foreach_pset(b_entry->perm_class_stat, perm_class_entry_t, pc_ent) {
- fprintf(dmp->f, "register class %s:\n", pc_ent->class_name);
- simple_dump_be_block_permstat_class(dmp, pc_ent);
- }
- }
- }
-
- fprintf(dmp->f, "PERMUTATION STATISTICS END\n");
- }
-}
-
-/**
* dumps the number of real_function_call optimization
*/
static void simple_dump_real_func_calls(dumper_t *dmp, counter_t *cnt)
@@ -523,9 +423,6 @@ static void simple_dump_graph(dumper_t *dmp, graph_entry_t *entry)
/* dump block ready nodes distribution */
simple_dump_be_block_sched_ready(dmp, entry);
-
- /* dump block permutation statistics */
- simple_dump_be_block_permstat(dmp, entry);
}
}