diff options
author | Martin Liska <mliska@suse.cz> | 2017-06-21 14:51:46 +0200 |
---|---|---|
committer | Martin Liska <marxin@gcc.gnu.org> | 2017-06-21 12:51:46 +0000 |
commit | e59a1c22fb249388e82b4fd004f33615abe36d2e (patch) | |
tree | 0ba9b3f978dc6746d354dccdfb340b58bb47cbfb /gcc/predict.def | |
parent | ff9baa5f1c532a43d7d14a800f5a4a5c5757dca6 (diff) | |
download | gcc-e59a1c22fb249388e82b4fd004f33615abe36d2e.zip gcc-e59a1c22fb249388e82b4fd004f33615abe36d2e.tar.gz gcc-e59a1c22fb249388e82b4fd004f33615abe36d2e.tar.bz2 |
Make early return predictor more precise.
2017-06-21 Martin Liska <mliska@suse.cz>
PR tree-optimization/79489
* gimplify.c (maybe_add_early_return_predict_stmt): New
function.
(gimplify_return_expr): Call the function.
* predict.c (tree_estimate_probability_bb): Remove handling
of early return.
* predict.def: Update comment about early return predictor.
* gimple-predict.h (is_gimple_predict): New function.
* predict.def: Change default value of early return to 66.
* tree-tailcall.c (find_tail_calls): Skip GIMPLE_PREDICT
statements.
* passes.def: Put pass_strip_predict_hints to the beginning of
IPA passes.
From-SVN: r249450
Diffstat (limited to 'gcc/predict.def')
-rw-r--r-- | gcc/predict.def | 15 |
1 files changed, 3 insertions, 12 deletions
diff --git a/gcc/predict.def b/gcc/predict.def index fcda6c4..f7b2bf7 100644 --- a/gcc/predict.def +++ b/gcc/predict.def @@ -128,18 +128,9 @@ DEF_PREDICTOR (PRED_POLYMORPHIC_CALL, "polymorphic call", HITRATE (59), 0) indefinitely. */ DEF_PREDICTOR (PRED_RECURSIVE_CALL, "recursive call", HITRATE (75), 0) -/* Branch causing function to terminate is probably not taken. - FIXME: early return currently predicts code: - int foo (int a) - { - if (a) - bar(); - else - bar2(); - } - even though there is no return statement involved. We probably want to track - this from FE or retire the predictor. */ -DEF_PREDICTOR (PRED_TREE_EARLY_RETURN, "early return (on trees)", HITRATE (54), 0) +/* Branch causing function to terminate is probably not taken. */ +DEF_PREDICTOR (PRED_TREE_EARLY_RETURN, "early return (on trees)", HITRATE (66), + 0) /* Branch containing goto is probably not taken. FIXME: Currently not used. */ |