From eb42964415d14caa18dcc2eca05f04af547fd58f Mon Sep 17 00:00:00 2001 From: hubicka Date: Sat, 28 Jul 2001 21:37:35 +0000 Subject: * basic-block.h (EDGE_FREQUENCY): New macro. * bb-reorder (fixup_reorder_chain): Set counts and frequencies for new BB/edges. * flow.c (find_sub_basic_blocks): Likewise. (try_crossjump_to_edge): Likewise; use EDGE_FREQUENCY (redirect_edge_and_branch): Use EDGE_FREQUENCY. * predict.c (DEF_PREDICTOR): New argument FLAGS. (HITRATE): New macro. (PRED_FLAG_FIRST_MATCH): New constant. (predictor_info): New field flgags. (combine_predictions_for_insn): Use DS theory to combine probabilities; set the edge probabilities when finished. (estimate_probability): Avoid duplicated matches of LOOP_BRANCH heuristics for nested loops; update comment. * predict.def: Add flags for each prediction, set probabilities according to B&L paper. * predict.h (DEF_PREDICTOR): New argument FLAGS. * profile.c (compute_branch_probabilities): Cleanup way the edge probabilities are computed and REG_BR_PROB notes are dropped; if values does not match, emit error. (init_branch_prob): Do error instead of warning when profile driven feedback is missing or corrupt. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@44439 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/basic-block.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'gcc/basic-block.h') diff --git a/gcc/basic-block.h b/gcc/basic-block.h index 654e63a9478..bddba84b7e1 100644 --- a/gcc/basic-block.h +++ b/gcc/basic-block.h @@ -511,6 +511,12 @@ struct edge_list #define BRANCH_EDGE(bb) ((bb)->succ->flags & EDGE_FALLTHRU \ ? (bb)->succ->succ_next : (bb)->succ) +/* Return expected execution frequency of the edge E. */ +#define EDGE_FREQUENCY(e) (((e)->src->frequency \ + * (e)->probability \ + + REG_BR_PROB_BASE / 2) \ + / REG_BR_PROB_BASE) + struct edge_list * create_edge_list PARAMS ((void)); void free_edge_list PARAMS ((struct edge_list *)); void print_edge_list PARAMS ((FILE *, struct edge_list *)); -- cgit v1.2.1