#include "stat_dmp.h"
#include "irtools.h"
#include "irhooks.h"
+#include "util.h"
/**
* names of the optimizations
{ FS_OPT_MUX_TRANSFORM, "algebraic simplification: Mux(t ==/!= f, t, f) = f/t, Mux(t ==/!= 0, -t, t) = -t/t" },
{ FS_OPT_MUX_TO_MIN, "algebraic simplification: Mux(a < b, a, b) = Min(a,b)" },
{ FS_OPT_MUX_TO_MAX, "algebraic simplification: Mux(a > b, a, b) = Max(a,b)" },
- { FS_OPT_MUX_TO_ABS, "algebraic simplification: Mux(a > 0, a, -a) = Abs(a)" },
{ FS_OPT_MUX_TO_BITOP, "algebraic simplification: Mux((a & 2^x) ==/!= 0, 2^x, 0) = (a & 2^x) (xor 2^x)" },
{ FS_OPT_IDEM_UNARY, "algebraic simplification: Idempotent unary operation" },
{ FS_OPT_MINUS_NOT, "algebraic simplification: -(~x) = x + 1" },
{ FS_OPT_NOT_PLUS_1, "algebraic simplification: ~x + 1 = -x" },
{ FS_OPT_ADD_X_NOT_X, "algebraic simplification: ~x + x = -1" },
{ FS_OPT_FP_INV_MUL, "algebraic simplification: x / y = x * (1.0/y)" },
- { FS_OPT_ABS_MINUS_X, "algebraic simplification: Abs(-x) = Abs(x)" },
{ FS_OPT_CONST_PHI, "constant evaluation on Phi node" },
{ FS_OPT_PREDICATE, "predicate optimization" },
{ FS_OPT_DEMORGAN, "optimization using DeMorgan's law" },
*/
static const char *get_opt_name(int index)
{
- assert(index < (int) ARR_SIZE(opt_names) && "index out of range");
+ assert(index < (int) ARRAY_SIZE(opt_names) && "index out of range");
assert((int) opt_names[index].kind == index && "opt_names broken");
return opt_names[index].name;
} /* get_opt_name */
static void simple_dump_distrib_entry(const distrib_entry_t *entry, void *env)
{
dumper_t *dmp = env;
- fprintf(dmp->f, "%12d", cnt_to_uint(&entry->cnt));
+ fprintf(dmp->f, "%12u", cnt_to_uint(&entry->cnt));
} /* simple_dump_distrib_entry */
/**
if (! dmp->f)
return;
- fprintf(dmp->f, "%-16s %8d\n", "Edges", cnt_to_uint(cnt));
+ fprintf(dmp->f, "%-16s %8u\n", "Edges", cnt_to_uint(cnt));
} /* simple_dump_edges */
/**
fprintf(dmp->f, "\nBit usage for integer constants\n");
fprintf(dmp->f, "-------------------------------\n");
- for (i = 0; i < ARR_SIZE(tbl->int_bits_count); ++i) {
+ for (i = 0; i < ARRAY_SIZE(tbl->int_bits_count); ++i) {
fprintf(dmp->f, "%5u %12u\n", (unsigned) (i + 1), cnt_to_uint(&tbl->int_bits_count[i]));
cnt_add(&sum, &tbl->int_bits_count[i]);
} /* for */
fprintf(dmp->f, "\nFloating point constants classification\n");
fprintf(dmp->f, "--------------------------------------\n");
- for (i = 0; i < ARR_SIZE(tbl->floats); ++i) {
+ for (i = 0; i < ARRAY_SIZE(tbl->floats); ++i) {
fprintf(dmp->f, "%-10s %12u\n", stat_fc_name(i), cnt_to_uint(&tbl->floats[i]));
cnt_add(&sum, &tbl->floats[i]);
} /* for */
csv_count_nodes(dmp, entry, cnt);
- fprintf(dmp->f, "%-40s, %p, %d, %d, %d, %d\n",
+ fprintf(dmp->f, "%-40s, %p, %u, %u, %u, %u\n",
name,
(void *)entry->irg,
cnt_to_uint(&cnt[0]),