summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Liska <mliska@suse.cz>2018-01-23 16:43:59 +0100
committerMartin Liska <marxin@gcc.gnu.org>2018-01-23 15:43:59 +0000
commit813d6db9c42ae27854356c87f0fa16b0f9079118 (patch)
treebf904d9fa75ede80506f4ff8781fe497534ac014
parent66ce8ff7603b3b717fff93d706b1cf3548ba4671 (diff)
Remove predictors that are unrealiable.
2018-01-23 Martin Liska <mliska@suse.cz> * predict.def (PRED_INDIR_CALL): Set probability to PROB_EVEN in order to ignore the predictor. (PRED_POLYMORPHIC_CALL): Likewise. (PRED_RECURSIVE_CALL): Likewise. From-SVN: r256988
-rw-r--r--gcc/ChangeLog7
-rw-r--r--gcc/predict.c2
-rw-r--r--gcc/predict.def14
3 files changed, 13 insertions, 10 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index fd93bc8a426..3238e70f63e 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,5 +1,12 @@
2018-01-23 Martin Liska <mliska@suse.cz>
+ * predict.def (PRED_INDIR_CALL): Set probability to PROB_EVEN in
+ order to ignore the predictor.
+ (PRED_POLYMORPHIC_CALL): Likewise.
+ (PRED_RECURSIVE_CALL): Likewise.
+
+2018-01-23 Martin Liska <mliska@suse.cz>
+
* tree-profile.c (tree_profiling): Print function header to
aware reader which function we are working on.
* value-prof.c (gimple_find_values_to_profile): Do not print
diff --git a/gcc/predict.c b/gcc/predict.c
index 724ba458db9..2d932e9fd11 100644
--- a/gcc/predict.c
+++ b/gcc/predict.c
@@ -4216,7 +4216,7 @@ test_prediction_value_range ()
continue;
unsigned p = 100 * predictors[i].probability / REG_BR_PROB_BASE;
- ASSERT_TRUE (p > 50 && p <= 100);
+ ASSERT_TRUE (p >= 50 && p <= 100);
}
}
diff --git a/gcc/predict.def b/gcc/predict.def
index fe72080d5bd..4ed97ed165c 100644
--- a/gcc/predict.def
+++ b/gcc/predict.def
@@ -118,15 +118,11 @@ DEF_PREDICTOR (PRED_TREE_FPOPCODE, "fp_opcode (on trees)", HITRATE (90), 0)
/* Branch guarding call is probably taken. */
DEF_PREDICTOR (PRED_CALL, "call", HITRATE (67), 0)
-/* PRED_CALL is not very reliable predictor and it turns out to be even
- less reliable for indirect calls and polymorphic calls. For spec2k6
- the predictio nis slightly in the direction of taking the call. */
-DEF_PREDICTOR (PRED_INDIR_CALL, "indirect call", HITRATE (86), 0)
-DEF_PREDICTOR (PRED_POLYMORPHIC_CALL, "polymorphic call", HITRATE (59), 0)
-
-/* Recursive calls are usually not taken or the function will recurse
- indefinitely. */
-DEF_PREDICTOR (PRED_RECURSIVE_CALL, "recursive call", HITRATE (75), 0)
+/* Call predictors are for now ignored, lets leave the predictor
+ to measure its benefit. */
+DEF_PREDICTOR (PRED_INDIR_CALL, "indirect call", PROB_EVEN, 0)
+DEF_PREDICTOR (PRED_POLYMORPHIC_CALL, "polymorphic call", PROB_EVEN, 0)
+DEF_PREDICTOR (PRED_RECURSIVE_CALL, "recursive call", PROB_EVEN, 0)
/* Branch causing function to terminate is probably not taken. */
DEF_PREDICTOR (PRED_TREE_EARLY_RETURN, "early return (on trees)", HITRATE (66),