summaryrefslogtreecommitdiff
path: root/gcc/predict.def
diff options
context:
space:
mode:
authordehao <dehao@138bc75d-0d04-0410-961f-82ee72b054a4>2012-05-08 10:01:44 +0000
committerdehao <dehao@138bc75d-0d04-0410-961f-82ee72b054a4>2012-05-08 10:01:44 +0000
commitfd757b763e4afa80c8663061807858592005834a (patch)
tree732faa7f65751352d1a617a0eb9ad11d9033c84f /gcc/predict.def
parent128e3935ca7fd502266fd72f8da7373ccb1990ee (diff)
downloadgcc-fd757b763e4afa80c8663061807858592005834a.tar.gz
2012-05-08 Dehao Chen <dehao@google.com>
gcc/ * predict.c (find_qualified_ssa_name): New (find_ssa_name_in_expr): New (find_ssa_name_in_assign_stmt): New (is_comparison_with_loop_invariant_p): New (is_bound_expr_similar): New (predict_iv_comparison): New (predict_loops): Add heuristic for loop-nested branches that compare an induction variable to a loop bound variable. * predict.def (PRED_LOOP_IV_COMPARE): New macro testsuite/ * gcc.dg/predict-1.c: Check if LOOP_IV_COMPARE static predict heuristic is working properly. * gcc.dg/predict-2.c: Likewise. * gcc/dg/predict-3.c: Likewise. * gcc/dg/predict-4.c: Likewise. * gcc/dg/predict-5.c: Likewise. * gcc/dg/predict-6.c: Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@187277 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/predict.def')
-rw-r--r--gcc/predict.def10
1 files changed, 10 insertions, 0 deletions
diff --git a/gcc/predict.def b/gcc/predict.def
index 4b3e87aa568..591bb1caf58 100644
--- a/gcc/predict.def
+++ b/gcc/predict.def
@@ -116,3 +116,13 @@ DEF_PREDICTOR (PRED_NULL_RETURN, "null return", HITRATE (90), 0)
/* Branches to a mudflap bounds check are extremely unlikely. */
DEF_PREDICTOR (PRED_MUDFLAP, "mudflap check", PROB_VERY_LIKELY, 0)
+
+/* Branches to compare induction variable to a loop bound is
+ extremely likely. */
+DEF_PREDICTOR (PRED_LOOP_IV_COMPARE_GUESS, "guess loop iv compare",
+ PROB_VERY_LIKELY, 0)
+
+/* Use number of loop iterations determined by # of iterations analysis
+ 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)