+2011-04-13 Nathan Froyd <froydnj@codesourcery.com>
+
+ * postreload-gcse.c (gcse_after_reload_main): Add calls to
+ statistics_counter_event.
+ * tree-ssa-copyrename.c (stats): Define.
+ (rename_ssa_copies): Count coalesced SSA_NAMEs. Add call to
+ statistics_counter_event.
+ * tree-ssa-math-opts.c (reciprocal_stats, sincos_stats): Define.
+ (bswap_stats, widen_mul_stats): Define.
+ (insert_reciprocals): Increment rdivs_inserted.
+ (execute_cse_reciprocals): Zeroize reciprocal_stats. Increment
+ rfuncs_inserted. Add calls to statistics_counter_event.
+ (execute_cse_sincos_1): Increment inserted.
+ (execute_cse_sincos): Zeroize sincos_stats. Add call to
+ statistics_counter_event.
+ (execute_optimize_bswap): Zeroize bswap_stats. Increment fields
+ of bswap_stats. Add calls to statistics_counter_event.
+ (convert_mult_to_widen): Increment widen_mults_inserted.
+ (convert_plusminus_to_widen): Increment maccs_inserted.
+ (convert_mult_to_fma): Increment fmas_inserted.
+ (execute_optimize_widening_mul): Zeroize widen_mul_stats. Add
+ calls to statistics_counter_event.
+
2011-04-13 Vladimir Makarov <vmakarov@redhat.com>
PR rtl-optimization/48455
bool bb_has_division;
};
+static struct
+{
+ /* Number of 1.0/X ops inserted. */
+ int rdivs_inserted;
+
+ /* Number of 1.0/FUNC ops inserted. */
+ int rfuncs_inserted;
+} reciprocal_stats;
+
+static struct
+{
+ /* Number of cexpi calls inserted. */
+ int inserted;
+} sincos_stats;
+
+static struct
+{
+ /* Number of hand-written 32-bit bswaps found. */
+ int found_32bit;
+
+ /* Number of hand-written 64-bit bswaps found. */
+ int found_64bit;
+} bswap_stats;
+
+static struct
+{
+ /* Number of widening multiplication ops inserted. */
+ int widen_mults_inserted;
+
+ /* Number of integer multiply-and-accumulate ops inserted. */
+ int maccs_inserted;
+
+ /* Number of fp fused multiply-add ops inserted. */
+ int fmas_inserted;
+} widen_mul_stats;
/* The instance of "struct occurrence" representing the highest
interesting block in the dominator tree. */
gsi_insert_before (&gsi, new_stmt, GSI_SAME_STMT);
}
+ reciprocal_stats.rdivs_inserted++;
+
occ->recip_def_stmt = new_stmt;
}
sizeof (struct occurrence),
n_basic_blocks / 3 + 1);
+ memset (&reciprocal_stats, 0, sizeof (reciprocal_stats));
calculate_dominance_info (CDI_DOMINATORS);
calculate_dominance_info (CDI_POST_DOMINATORS);
gimple_replace_lhs (stmt1, arg1);
gimple_call_set_fndecl (stmt1, fndecl);
update_stmt (stmt1);
+ reciprocal_stats.rfuncs_inserted++;
FOR_EACH_IMM_USE_STMT (stmt, ui, arg1)
{
}
}
+ statistics_counter_event (cfun, "reciprocal divs inserted",
+ reciprocal_stats.rdivs_inserted);
+ statistics_counter_event (cfun, "reciprocal functions inserted",
+ reciprocal_stats.rfuncs_inserted);
+
free_dominance_info (CDI_DOMINATORS);
free_dominance_info (CDI_POST_DOMINATORS);
free_alloc_pool (occ_pool);
gsi_insert_before (&gsi, stmt, GSI_SAME_STMT);
}
update_stmt (stmt);
+ sincos_stats.inserted++;
/* And adjust the recorded old call sites. */
for (i = 0; VEC_iterate(gimple, stmts, i, use_stmt); ++i)
bool cfg_changed = false;
calculate_dominance_info (CDI_DOMINATORS);
+ memset (&sincos_stats, 0, sizeof (sincos_stats));
FOR_EACH_BB (bb)
{
}
}
+ statistics_counter_event (cfun, "sincos statements inserted",
+ sincos_stats.inserted);
+
free_dominance_info (CDI_DOMINATORS);
return cfg_changed ? TODO_cleanup_cfg : 0;
}
bswap64_type = TREE_VALUE (TYPE_ARG_TYPES (TREE_TYPE (fndecl)));
}
+ memset (&bswap_stats, 0, sizeof (bswap_stats));
+
FOR_EACH_BB (bb)
{
gimple_stmt_iterator gsi;
continue;
changed = true;
+ if (type_size == 32)
+ bswap_stats.found_32bit++;
+ else
+ bswap_stats.found_64bit++;
bswap_tmp = bswap_src;
}
}
+ statistics_counter_event (cfun, "32-bit bswap implementations found",
+ bswap_stats.found_32bit);
+ statistics_counter_event (cfun, "64-bit bswap implementations found",
+ bswap_stats.found_64bit);
+
return (changed ? TODO_dump_func | TODO_update_ssa | TODO_verify_ssa
| TODO_verify_stmts : 0);
}
gimple_assign_set_rhs2 (stmt, fold_convert (type2, rhs2));
gimple_assign_set_rhs_code (stmt, WIDEN_MULT_EXPR);
update_stmt (stmt);
+ widen_mul_stats.widen_mults_inserted++;
return true;
}
fold_convert (type2, mult_rhs2),
add_rhs);
update_stmt (gsi_stmt (*gsi));
+ widen_mul_stats.maccs_inserted++;
return true;
}
mulop1, op2,
addop);
gsi_replace (&gsi, fma_stmt, true);
+ widen_mul_stats.fmas_inserted++;
}
return true;
basic_block bb;
bool cfg_changed = false;
+ memset (&widen_mul_stats, 0, sizeof (widen_mul_stats));
+
FOR_EACH_BB (bb)
{
gimple_stmt_iterator gsi;
}
}
+ statistics_counter_event (cfun, "widening multiplications inserted",
+ widen_mul_stats.widen_mults_inserted);
+ statistics_counter_event (cfun, "widening maccs inserted",
+ widen_mul_stats.maccs_inserted);
+ statistics_counter_event (cfun, "fused multiply-adds inserted",
+ widen_mul_stats.fmas_inserted);
+
return cfg_changed ? TODO_cleanup_cfg : 0;
}