"Architecture dependant optimization",
"Reassociation optimization",
"Polymorphic call optimization",
+ "an if conversion was tried",
"Lowered",
};
+static const char *if_conv_names[] = {
+ "if conv done ",
+ "if conv side effect ",
+ "if conv Phi node found ",
+ "if conv to deep DAG's ",
+ "if conv bad control flow ",
+};
+
/**
* dumps a opcode hash into human readable form
*/
fprintf(dmp->f, "%-16s %-8s %-8s %-8s\n", "Opcode", "alive", "created", "->Id");
for (entry = pset_first(set); entry; entry = pset_next(set)) {
- fprintf(dmp->f, "%-16s %8d %8d %8d\n",
+ fprintf(dmp->f, "%-16s %8u %8u %8u\n",
get_id_str(entry->op->name), entry->cnt_alive.cnt[0], entry->new_node.cnt[0], entry->into_Id.cnt[0]);
cnt_add(&f_alive, &entry->cnt_alive);
cnt_add(&f_Id, &entry->into_Id);
}
fprintf(dmp->f, "-------------------------------------------\n");
- fprintf(dmp->f, "%-16s %8d %8d %8d\n", "Sum",
+ fprintf(dmp->f, "%-16s %8u %8u %8u\n", "Sum",
f_alive.cnt[0],
f_new_node.cnt[0],
f_Id.cnt[0]);
}
/**
- * dumps a optimization hash into human readable form
+ * dumps an optimization hash into human readable form
*/
static void simple_dump_opt_hash(dumper_t *dmp, pset *set, int index)
{
fprintf(dmp->f, "%-16s %-8s\n", "Opcode", "deref");
for (; entry; entry = pset_next(set)) {
- fprintf(dmp->f, "%-16s %8d\n",
+ fprintf(dmp->f, "%-16s %8u\n",
get_id_str(entry->op->name), entry->count.cnt[0]);
}
}
}
+/**
+ * dumps the number of real_function_call optimization
+ */
+static void simple_dump_real_func_calls(dumper_t *dmp, counter_t *cnt)
+{
+ if (! cnt_eq(cnt, 0)) {
+ fprintf(dmp->f, "\nReal Function Calls optimized:\n");
+ fprintf(dmp->f, "%-16s %8u\n",
+ "Call", cnt->cnt[0]);
+ }
+}
+
+/**
+ * dumps the number of tail_recursion optimization
+ */
+static void simple_dump_tail_recursion(dumper_t *dmp, unsigned num_tail_recursion)
+{
+ if (num_tail_recursion > 0) {
+ fprintf(dmp->f, "\nTail recursion optimized:\n");
+ fprintf(dmp->f, "%-16s %8u\n", "Call", num_tail_recursion);
+ }
+}
+
/**
* dumps the edges count
*/
*/
static void simple_dump_graph(dumper_t *dmp, graph_entry_t *entry)
{
- int dump_opts = 1;
+ int i, dump_opts = 1;
block_entry_t *b_entry;
if (entry->irg) {
}
else {
if (entry->ent)
- fprintf(dmp->f, "\nEntity %s, Irg %p", get_entity_name(entry->ent), (void *)entry->irg);
+ fprintf(dmp->f, "\nEntity %s, Irg %p", get_entity_ld_name(entry->ent), (void *)entry->irg);
else
fprintf(dmp->f, "\nIrg %p", (void *)entry->irg);
}
" calls only leaf functions : %s\n"
" recursive : %s\n"
" chain call : %s\n"
- " calls : %u\n"
- " indirect calls : %u\n",
+ " calls : %u\n"
+ " indirect calls : %u\n",
entry->is_deleted ? "DELETED " : "",
entry->cnt_walked.cnt[0], entry->cnt_walked_blocks.cnt[0],
entry->cnt_was_inlined.cnt[0],
entry->cnt_got_inlined.cnt[0],
- entry->cnt_strength_red.cnt[0],
- entry->is_leaf ? "YES" : "NO",
- entry->is_leaf_call == LCS_NON_LEAF_CALL ? "NO" : (entry->is_leaf_call == LCS_LEAF_CALL ? "Yes" : "Maybe"),
- entry->is_recursive ? "YES" : "NO",
- entry->is_chain_call ? "YES" : "NO",
+ entry->cnt_strength_red.cnt[0],
+ entry->is_leaf ? "YES" : "NO",
+ entry->is_leaf_call == LCS_NON_LEAF_CALL ? "NO" : (entry->is_leaf_call == LCS_LEAF_CALL ? "Yes" : "Maybe"),
+ entry->is_recursive ? "YES" : "NO",
+ entry->is_chain_call ? "YES" : "NO",
entry->cnt_all_calls.cnt[0],
entry->cnt_indirect_calls.cnt[0]
);
+
+ for (i = 0; i < sizeof(entry->cnt_if_conv)/sizeof(entry->cnt_if_conv[0]); ++i) {
+ fprintf(dmp->f, " %s : %u\n", if_conv_names[i], entry->cnt_if_conv[i].cnt[0]);
+ }
+
}
else {
fprintf(dmp->f, "\nGlobals counts:\n");
if (dump_opts) {
int i;
+ simple_dump_real_func_calls(dmp, &entry->cnt_real_func_call);
+ simple_dump_tail_recursion(dmp, entry->num_tail_recursion);
+
for (i = 0; i < sizeof(entry->opt_hash)/sizeof(entry->opt_hash[0]); ++i) {
simple_dump_opt_hash(dmp, entry->opt_hash[i], i);
}
/* dump block info */
- fprintf(dmp->f, "\n%12s %12s %12s %12s %12s %12s\n", "Block Nr", "Nodes", "intern E", "incoming E", "outgoing E", "quot");
+ fprintf(dmp->f, "\n%12s %12s %12s %12s %12s %12s %12s\n", "Block Nr", "Nodes", "intern E", "incoming E", "outgoing E", "Phi", "quot");
for (b_entry = pset_first(entry->block_hash);
- b_entry;
- b_entry = pset_next(entry->block_hash)) {
- fprintf(dmp->f, "BLK %12ld %12u %12u %12u %12u %4.8f\n",
- b_entry->block_nr,
- b_entry->cnt_nodes.cnt[0],
- b_entry->cnt_edges.cnt[0],
- b_entry->cnt_in_edges.cnt[0],
- b_entry->cnt_out_edges.cnt[0],
- (double)b_entry->cnt_edges.cnt[0] / (double)b_entry->cnt_nodes.cnt[0]
+ b_entry;
+ b_entry = pset_next(entry->block_hash)) {
+ fprintf(dmp->f, "BLK %12ld %12u %12u %12u %12u %12u %4.8f\n",
+ b_entry->block_nr,
+ b_entry->cnt_nodes.cnt[0],
+ b_entry->cnt_edges.cnt[0],
+ b_entry->cnt_in_edges.cnt[0],
+ b_entry->cnt_out_edges.cnt[0],
+ b_entry->cnt_phi_data.cnt[0],
+ (double)b_entry->cnt_edges.cnt[0] / (double)b_entry->cnt_nodes.cnt[0]
);
}
}