- add dumping of indirect/external calls
authorMichael Beck <beck@ipd.info.uni-karlsruhe.de>
Wed, 7 May 2008 02:32:30 +0000 (02:32 +0000)
committerMichael Beck <beck@ipd.info.uni-karlsruhe.de>
Wed, 7 May 2008 02:32:30 +0000 (02:32 +0000)
- replace -> by = for better TeX output

[r19542]

ir/stat/firmstat.c
ir/stat/firmstat_t.h
ir/stat/stat_dmp.c

index 75f1cf0..44defc0 100644 (file)
@@ -804,6 +804,8 @@ static void stat_update_call(ir_node *call, graph_entry_t *graph)
                        /* it is recursive, if it calls at least once */
                        if (callee == graph->irg)
                                graph->is_recursive = 1;
+                       if (callee == NULL)
+                               cnt_inc(&graph->cnt[gcnt_external_calls]);
                }  /* if */
        } else {
                /* indirect call, be could not predict */
index 5279c03..32b03f3 100644 (file)
@@ -133,6 +133,7 @@ enum graph_counter_names {
        gcnt_call_with_all_cnst_arg,   /**< number of calls with all const args */
        gcnt_call_with_local_adr,      /**< number of calls with address of local var args */
        gcnt_indirect_calls,           /**< number of indirect calls */
+       gcnt_external_calls,           /**< number of external calls */
        gcnt_pure_adr_ops,             /**< number of pure address operation */
        gcnt_all_adr_ops,              /**< number of all address operation */
        gcnt_global_adr,               /**< number of global load/store addresses. */
index 74261ad..a210c87 100644 (file)
@@ -77,8 +77,8 @@ static const struct {
        { FS_OPT_SUB_MUL_A_X_A,  "algebraic simplification: a * x - a = a * (x - 1)" },
        { FS_OPT_SUB_SUB_X_Y_Z,  "algebraic simplification: (x - y) - z = x - (y + z)" },
        { FS_OPT_SUB_C_NOT_X,    "algebraic simplification: c - ~a = a + (c+1)" },
-       { FS_OPT_SUB_TO_ADD,     "algebraic simplification: (-a) - b = -(a + b), a - (b - c) = a + (c - b), a - (b * C) -> a + (b * -C)" },
-       { FS_OPT_MUL_MINUS,      "algebraic simplification: (-a) * (b - c) -> a * (c - b)" },
+       { FS_OPT_SUB_TO_ADD,     "algebraic simplification: (-a) - b = -(a + b), a - (b - c) = a + (c - b), a - (b * C) = a + (b * -C)" },
+       { FS_OPT_MUL_MINUS,      "algebraic simplification: (-a) * (b - c) = a * (c - b)" },
        { FS_OPT_MUL_MINUS_1,    "algebraic simplification: a * -1 = -a" },
        { FS_OPT_MINUS_MUL_C,    "algebraic simplification: (-a) * C = a * (-C)" },
        { FS_OPT_MUL_MINUS_MINUS,"algebraic simplification: (-a) * (-b) = a * b" },
@@ -87,7 +87,7 @@ static const struct {
        { FS_OPT_TO_EOR,         "algebraic simplification: (a|b) & ~(a&b) = a^b" },
        { FS_OPT_EOR_A_A,        "algebraic simplification: a ^ a = 0" },
        { FS_OPT_EOR_TO_NOT_BOOL,"algebraic simplification: bool ^ 1 = !bool" },
-       { FS_OPT_EOR_TO_NOT,     "algebraic simplification: x ^ 0b1..1 = ~x, (a ^ b) & b -> ~a & b" },
+       { FS_OPT_EOR_TO_NOT,     "algebraic simplification: x ^ 0b1..1 = ~x, (a ^ b) & b = ~a & b" },
        { FS_OPT_NOT_CMP,        "algebraic simplification: !(a cmp b) = a !cmp b" },
        { FS_OPT_OR_SHFT_TO_ROT, "algebraic simplification: (x << c) | (x >> (bits - c)) == Rot(x, c)" },
        { FS_OPT_REASSOC_SHIFT,  "algebraic simplification: (x SHF c1) SHF c2 = x SHF (c1+c2)" },
@@ -469,7 +469,8 @@ static void simple_dump_graph(dumper_t *dmp, graph_entry_t *entry)
                        " recursive                 : %s\n"
                        " chain call                : %s\n"
                        " calls                     : %u\n"
-                       " indirect calls            : %u\n",
+                       " indirect calls            : %u\n"
+                       " external calls            : %u\n",
                        entry->is_deleted ? "DELETED " : "",
                        cnt_to_uint(&entry->cnt[gcnt_acc_walked]), cnt_to_uint(&entry->cnt[gcnt_acc_walked_blocks]),
                        cnt_to_uint(&entry->cnt[gcnt_acc_was_inlined]),
@@ -480,7 +481,8 @@ static void simple_dump_graph(dumper_t *dmp, graph_entry_t *entry)
                        entry->is_recursive ? "YES" : "NO",
                        entry->is_chain_call ? "YES" : "NO",
                        cnt_to_uint(&entry->cnt[gcnt_all_calls]),
-                       cnt_to_uint(&entry->cnt[gcnt_indirect_calls])
+                       cnt_to_uint(&entry->cnt[gcnt_indirect_calls]),
+                       cnt_to_uint(&entry->cnt[gcnt_external_calls])
                );
 
                for (i = 0; i < IF_RESULT_LAST; ++i) {
@@ -630,6 +632,8 @@ static void simple_dump_param_tbl(dumper_t *dmp, const distrib_tbl_t *tbl, graph
        fprintf(dmp->f, "-------------------------------\n");
 
        fprintf(dmp->f, "Number of Calls           %12u\n", cnt_to_uint(&global->cnt[gcnt_all_calls]));
+       fprintf(dmp->f, "indirect calls            %12u\n", cnt_to_uint(&global->cnt[gcnt_indirect_calls]));
+       fprintf(dmp->f, "external calls            %12u\n", cnt_to_uint(&global->cnt[gcnt_external_calls]));
        fprintf(dmp->f, "with const params         %12u\n", cnt_to_uint(&global->cnt[gcnt_call_with_cnst_arg]));
        fprintf(dmp->f, "with all const params     %12u\n", cnt_to_uint(&global->cnt[gcnt_call_with_all_cnst_arg]));
        fprintf(dmp->f, "with local var adr params %12u\n", cnt_to_uint(&global->cnt[gcnt_call_with_local_adr]));