diff options
author | Richard Henderson <rth@redhat.com> | 2012-07-26 14:31:40 -0700 |
---|---|---|
committer | Richard Henderson <rth@gcc.gnu.org> | 2012-07-26 14:31:40 -0700 |
commit | e45abe1f20e35a461c2378f4caf8b1455c98385d (patch) | |
tree | 20c51469f397cdea4c543dc55b62a9a1b3ce14d1 /gcc/predict.def | |
parent | 27ec0502c807dd79b1e6782806ac2d95bd084a6a (diff) | |
download | gcc-e45abe1f20e35a461c2378f4caf8b1455c98385d.tar.gz |
Hot/cold attributes for labels.
gcc/
* doc/extend.texi (attribute): Document hot/cold for labels.
* predict.c (tree_estimate_probability_bb): Handle hot/cold
attributes on user labels.
* predict.def (PRED_HOT_LABEL, PRED_COLD_LABEL): New.
gcc/c-family/
* c-common.c (handle_hot_attribute): Allow labels.
(handle_cold_attribute): Likewise.
gcc/testsuite/
* gcc.dg/attr-hotcold-1.c: New.
* gcc.dg/tree-ssa/attr-hotcold-2.c: New.
From-SVN: r189898
Diffstat (limited to 'gcc/predict.def')
-rw-r--r-- | gcc/predict.def | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/gcc/predict.def b/gcc/predict.def index 591bb1caf58..7e77f141a4d 100644 --- a/gcc/predict.def +++ b/gcc/predict.def @@ -126,3 +126,10 @@ DEF_PREDICTOR (PRED_LOOP_IV_COMPARE_GUESS, "guess loop iv compare", to set probability of branches that compares IV to loop bound variable. */ DEF_PREDICTOR (PRED_LOOP_IV_COMPARE, "loop iv compare", PROB_VERY_LIKELY, PRED_FLAG_FIRST_MATCH) + +/* Branches to hot labels are likely. */ +DEF_PREDICTOR (PRED_HOT_LABEL, "hot label", HITRATE (85), 0) + +/* Branches to cold labels are extremely unlikely. */ +DEF_PREDICTOR (PRED_COLD_LABEL, "cold label", PROB_VERY_LIKELY, + PRED_FLAG_FIRST_MATCH) |