aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan Hubicka <jh@suse.cz>2005-06-04 13:00:57 +0200
committerJan Hubicka <hubicka@gcc.gnu.org>2005-06-04 11:00:57 +0000
commite0342c26d32711da67235f44ab63714d9cc14f4a (patch)
treead7551fb133434089490b54ee1f128a2f9fb7b37
parent29405f9481f118a1a8a02873ccef08b5b21b80ef (diff)
downloadgcc-e0342c26d32711da67235f44ab63714d9cc14f4a.zip
gcc-e0342c26d32711da67235f44ab63714d9cc14f4a.tar.gz
gcc-e0342c26d32711da67235f44ab63714d9cc14f4a.tar.bz2
predict.c (tree_predict_edge): Do not predict entry edge and single succestor edge.
* predict.c (tree_predict_edge): Do not predict entry edge and single succestor edge. From-SVN: r100581
-rw-r--r--gcc/ChangeLog5
-rw-r--r--gcc/predict.c16
2 files changed, 15 insertions, 6 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index d32b69e..267231d 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,8 @@
+2005-06-04 Jan Hubicka <jh@suse.cz>
+
+ * predict.c (tree_predict_edge): Do not predict entry edge and
+ single succestor edge.
+
2005-06-04 Joseph S. Myers <joseph@codesourcery.com>
PR c/21873
diff --git a/gcc/predict.c b/gcc/predict.c
index 8ca44f6..22468ac 100644
--- a/gcc/predict.c
+++ b/gcc/predict.c
@@ -231,13 +231,17 @@ rtl_predict_edge (edge e, enum br_predictor predictor, int probability)
void
tree_predict_edge (edge e, enum br_predictor predictor, int probability)
{
- struct edge_prediction *i = ggc_alloc (sizeof (struct edge_prediction));
+ if ((e->src != ENTRY_BLOCK_PTR && EDGE_COUNT (e->src->succs) > 1)
+ && flag_guess_branch_prob)
+ {
+ struct edge_prediction *i = ggc_alloc (sizeof (struct edge_prediction));
- i->next = e->src->predictions;
- e->src->predictions = i;
- i->probability = probability;
- i->predictor = predictor;
- i->edge = e;
+ i->next = e->src->predictions;
+ e->src->predictions = i;
+ i->probability = probability;
+ i->predictor = predictor;
+ i->edge = e;
+ }
}
/* Remove all predictions on given basic block that are attached