aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorJan Hubicka <hubicka@ucw.cz>2016-06-01 01:33:08 +0200
committerJan Hubicka <hubicka@gcc.gnu.org>2016-05-31 23:33:08 +0000
commit050fb2092b4e8fc92243112565f7230e672e4399 (patch)
tree9897cd26c87d0ce3445534bb6224cf4f786ec88c /gcc
parent226e9d1aabee7a3524fd6f62dc1390ce7881b7a5 (diff)
downloadgcc-050fb2092b4e8fc92243112565f7230e672e4399.zip
gcc-050fb2092b4e8fc92243112565f7230e672e4399.tar.gz
gcc-050fb2092b4e8fc92243112565f7230e672e4399.tar.bz2
predict-lop-exit-1.C: Update template for new predictor name.
* g++.d/predict-lop-exit-1.C: Update template for new predictor name. * g++.d/predict-lop-exit-2.C: Update template for new predictor name. * g++.d/predict-lop-exit-2.C: Update template for new predictor name. * predict.def (PRED_LOOP_EXTRA_EXIT): Define. * predict.c (predict_iv_comparison): Also check PRED_LOOP_EXTRA_EXIT. (predict_extra_loop_exits): Use PRED_LOOP_EXTRA_EXIT instead of PRED_LOOP_EXIT. From-SVN: r236968
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog7
-rw-r--r--gcc/predict.c9
-rw-r--r--gcc/predict.def5
-rw-r--r--gcc/testsuite/ChangeLog6
-rw-r--r--gcc/testsuite/g++.dg/predict-loop-exit-1.C1
-rw-r--r--gcc/testsuite/g++.dg/predict-loop-exit-2.C1
-rw-r--r--gcc/testsuite/g++.dg/predict-loop-exit-3.C1
7 files changed, 26 insertions, 4 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index c5734b4..45f31d4 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,5 +1,12 @@
2016-05-31 Jan Hubicka <hubicka@ucw.cz>
+ * predict.def (PRED_LOOP_EXTRA_EXIT): Define.
+ * predict.c (predict_iv_comparison): Also check PRED_LOOP_EXTRA_EXIT.
+ (predict_extra_loop_exits): Use PRED_LOOP_EXTRA_EXIT instead of
+ PRED_LOOP_EXIT.
+
+2016-05-31 Jan Hubicka <hubicka@ucw.cz>
+
* doc/invoke.texi (-frename-registers): Drop -fpeel-loops from list
of flags impliying the register renaming.
* toplev.c (process_options): Do not imply flag_rename_registers with
diff --git a/gcc/predict.c b/gcc/predict.c
index 396e150..e9dda20 100644
--- a/gcc/predict.c
+++ b/gcc/predict.c
@@ -1245,7 +1245,8 @@ predict_iv_comparison (struct loop *loop, basic_block bb,
if (predicted_by_p (bb, PRED_LOOP_ITERATIONS_GUESSED)
|| predicted_by_p (bb, PRED_LOOP_ITERATIONS)
- || predicted_by_p (bb, PRED_LOOP_EXIT))
+ || predicted_by_p (bb, PRED_LOOP_EXIT)
+ || predicted_by_p (bb, PRED_LOOP_EXTRA_EXIT))
return;
stmt = last_stmt (bb);
@@ -1418,7 +1419,7 @@ predict_iv_comparison (struct loop *loop, basic_block bb,
The edge BB7->BB8 is loop exit because BB8 is outside of the loop.
From the dataflow, we can infer that BB4->BB6 and BB5->BB6 are also loop
exits. This function takes BB7->BB8 as input, and finds out the extra loop
- exits to predict them using PRED_LOOP_EXIT. */
+ exits to predict them using PRED_LOOP_EXTRA_EXIT. */
static void
predict_extra_loop_exits (edge exit_edge)
@@ -1474,12 +1475,12 @@ predict_extra_loop_exits (edge exit_edge)
continue;
if (EDGE_COUNT (e->src->succs) != 1)
{
- predict_paths_leading_to_edge (e, PRED_LOOP_EXIT, NOT_TAKEN);
+ predict_paths_leading_to_edge (e, PRED_LOOP_EXTRA_EXIT, NOT_TAKEN);
continue;
}
FOR_EACH_EDGE (e1, ei, e->src->preds)
- predict_paths_leading_to_edge (e1, PRED_LOOP_EXIT, NOT_TAKEN);
+ predict_paths_leading_to_edge (e1, PRED_LOOP_EXTRA_EXIT, NOT_TAKEN);
}
}
diff --git a/gcc/predict.def b/gcc/predict.def
index 18ac753..b83ec60 100644
--- a/gcc/predict.def
+++ b/gcc/predict.def
@@ -92,6 +92,11 @@ DEF_PREDICTOR (PRED_LOOP_BRANCH, "loop branch", HITRATE (86),
DEF_PREDICTOR (PRED_LOOP_EXIT, "loop exit", HITRATE (91),
PRED_FLAG_FIRST_MATCH)
+/* Edge causing loop to terminate by computing value used by later conditional.
+ */
+DEF_PREDICTOR (PRED_LOOP_EXTRA_EXIT, "extra loop exit", HITRATE (91),
+ PRED_FLAG_FIRST_MATCH)
+
/* Pointers are usually not NULL. */
DEF_PREDICTOR (PRED_POINTER, "pointer", HITRATE (85), 0)
DEF_PREDICTOR (PRED_TREE_POINTER, "pointer (on trees)", HITRATE (85), 0)
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index cc1624f..df64820 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,9 @@
+2016-05-31 Jan Hubicka <hubicka@ucw.cz>
+
+ * g++.d/predict-lop-exit-1.C: Update template for new predictor name.
+ * g++.d/predict-lop-exit-2.C: Update template for new predictor name.
+ * g++.d/predict-lop-exit-2.C: Update template for new predictor name.
+
2016-05-31 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/71248
diff --git a/gcc/testsuite/g++.dg/predict-loop-exit-1.C b/gcc/testsuite/g++.dg/predict-loop-exit-1.C
index c8c202e..357397f 100644
--- a/gcc/testsuite/g++.dg/predict-loop-exit-1.C
+++ b/gcc/testsuite/g++.dg/predict-loop-exit-1.C
@@ -9,4 +9,5 @@ void test() {
return;
}
+/* { dg-final { scan-tree-dump-times "extra loop exit heuristics:" 2 "profile_estimate"} } */
/* { dg-final { scan-tree-dump-times "loop exit heuristics:" 3 "profile_estimate"} } */
diff --git a/gcc/testsuite/g++.dg/predict-loop-exit-2.C b/gcc/testsuite/g++.dg/predict-loop-exit-2.C
index ae18003..172fab1 100644
--- a/gcc/testsuite/g++.dg/predict-loop-exit-2.C
+++ b/gcc/testsuite/g++.dg/predict-loop-exit-2.C
@@ -9,4 +9,5 @@ void test() {
return;
}
+/* { dg-final { scan-tree-dump-times "extra loop exit heuristics:" 1 "profile_estimate"} } */
/* { dg-final { scan-tree-dump-times "loop exit heuristics:" 2 "profile_estimate"} } */
diff --git a/gcc/testsuite/g++.dg/predict-loop-exit-3.C b/gcc/testsuite/g++.dg/predict-loop-exit-3.C
index 35c768f..e6ceec8 100644
--- a/gcc/testsuite/g++.dg/predict-loop-exit-3.C
+++ b/gcc/testsuite/g++.dg/predict-loop-exit-3.C
@@ -9,4 +9,5 @@ void test() {
return;
}
+/* { dg-final { scan-tree-dump-times "extra loop exit heuristics:" 2 "profile_estimate"} } */
/* { dg-final { scan-tree-dump-times "loop exit heuristics:" 3 "profile_estimate"} } */