summaryrefslogtreecommitdiff
path: root/gcc/predict.c
diff options
context:
space:
mode:
authorhubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4>2001-06-22 17:23:14 +0000
committerhubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4>2001-06-22 17:23:14 +0000
commit17a8121649b62d1893a5c942bdf0719e766894ed (patch)
treedd8484defdb75a57e43380239e2d1f1b2bcafed1 /gcc/predict.c
parent63f236087f033781e482c61b8d159595cb371d4f (diff)
downloadgcc-17a8121649b62d1893a5c942bdf0719e766894ed.tar.gz
* predict.c (estimate_bb_frequencies): Do not handle conditional
jumps jumping to fallthru basic block as conditional jumps. * tm.texi (GCOV_TYPE_SIZE): Document. * basic-block.h (gcov_type): Define. (struct edge_def): Use gcov_type for count field. (struct basic_block_def): Likewise. * defaults.h (GCOV_TYPE_SIZE): Define. * final.c (end_final): Use GCOV_TYPE_SIZE. * flow.c (dump_edge_info, dump_flow_info, dump_bb): Print count fields using HOST_WIDEST_INT_PRINT_DEC. * gcov-io.h (__fetch_gcov_type, __store_gcov_type, __read_gcov_type, __write_gcov_type): New. (store_long): Remove. * gcov.c (gcov_type): Set default. (struct adj_list): Use gcov_type for arc_count. (bb_info): Use gcov_type for succ_count, pred_count and exec_count. (create_program_flow_graph): Read arc_count properly. (solve_program_flow_graph): 'total' is gcov_type. (output_data): Line_counts is gcov_type, print it properly. * libgcc2.c (struct bb): Counts is gcov_type. (__bb_exit_func): Use __read_gcov_type and __write_gcov_type. * profile.c (LONG_TYPE_SIZE, LONG_LONG_TYPE_SIZE): Set default. (GCOV_TYPE_SIZE): Define. (struct bb_info): succ_count and pred_count is gcov_type. (compute_branch_probabilities): Use __read_gcov_type, print read edges to the dump file. (total): Is gcov_type. (gen_edge_profiler): Use GCOV_TYPE_SIZE. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@43506 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/predict.c')
-rw-r--r--gcc/predict.c18
1 files changed, 15 insertions, 3 deletions
diff --git a/gcc/predict.c b/gcc/predict.c
index 058adb51e25..e51128264db 100644
--- a/gcc/predict.c
+++ b/gcc/predict.c
@@ -187,8 +187,18 @@ dump_prediction (predictor, probability, bb)
probability * 100.0 / REG_BR_PROB_BASE);
if (bb->count)
- fprintf (rtl_dump_file, " exec %i hit %i (%.1f%%)",
- bb->count, e->count, e->count * 100.0 / bb->count);
+ {
+ fprintf (rtl_dump_file, " exec ",
+ bb->count, e->count, e->count * 100.0 / bb->count);
+ fprintf (rtl_dump_file, HOST_WIDEST_INT_PRINT_DEC,
+ (HOST_WIDEST_INT) bb->count);
+ fprintf (rtl_dump_file, " hit ",
+ e->count, e->count * 100.0 / bb->count);
+ fprintf (rtl_dump_file, HOST_WIDEST_INT_PRINT_DEC,
+ (HOST_WIDEST_INT) e->count);
+ fprintf (rtl_dump_file, " (%.1f%%)",
+ e->count, e->count * 100.0 / bb->count);
+ }
fprintf (rtl_dump_file, "\n");
}
@@ -701,7 +711,9 @@ estimate_bb_frequencies (loops)
int probability;
edge fallthru, branch;
- if (GET_CODE (last_insn) != JUMP_INSN || !any_condjump_p (last_insn))
+ if (GET_CODE (last_insn) != JUMP_INSN || !any_condjump_p (last_insn)
+ /* Avoid handling of conditionals jump jumping to fallthru edge. */
+ || BASIC_BLOCK (i)->succ->succ_next == NULL)
{
/* We can predict only conditional jumps at the moment.
Expect each edge to be equall probable.