aboutsummaryrefslogtreecommitdiff
path: root/gcc/predict.c
diff options
context:
space:
mode:
authorJan Hubicka <jh@suse.cz>2004-09-23 02:50:37 +0200
committerJan Hubicka <hubicka@gcc.gnu.org>2004-09-23 00:50:37 +0000
commite53de54da399b14c108c994a81c047502cf4a513 (patch)
treeb424c4477beb895f8bc28d96a8c822154f4b71bc /gcc/predict.c
parentd0259e11e7c68f2dbc212e5a31efc2a02dd79add (diff)
downloadgcc-e53de54da399b14c108c994a81c047502cf4a513.zip
gcc-e53de54da399b14c108c994a81c047502cf4a513.tar.gz
gcc-e53de54da399b14c108c994a81c047502cf4a513.tar.bz2
cfgexpand.c (add_reg_br_prob_note): New function.
* cfgexpand.c (add_reg_br_prob_note): New function. (expand_gimple_cond_expr): Use it. (tree_expand_cfg): No longer kill the profile. * cfgrt.c (rtl_verify_flow_info_1): Check profile consistency only if it is present. * passes.c (rest_of_handle_loop_optimize): Kill the profile. * predict.c (combine_predictions_for_insn): Set the probabilities based on REG_BR_PROB note if present. * predict.c (branch_prob): Profile is read only with flag_branch_probabilities. From-SVN: r87910
Diffstat (limited to 'gcc/predict.c')
-rw-r--r--gcc/predict.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/gcc/predict.c b/gcc/predict.c
index 7eaee34..cc314ec 100644
--- a/gcc/predict.c
+++ b/gcc/predict.c
@@ -438,6 +438,15 @@ combine_predictions_for_insn (rtx insn, basic_block bb)
= REG_BR_PROB_BASE - combined_probability;
}
}
+ else if (bb->succ->succ_next)
+ {
+ int prob = INTVAL (XEXP (prob_note, 0));
+
+ BRANCH_EDGE (bb)->probability = prob;
+ FALLTHRU_EDGE (bb)->probability = REG_BR_PROB_BASE - prob;
+ }
+ else
+ bb->succ->probability = REG_BR_PROB_BASE;
}
/* Combine predictions into single probability and store them into CFG.