diff options
author | Jan Hubicka <jh@suse.cz> | 2005-06-04 13:00:57 +0200 |
---|---|---|
committer | Jan Hubicka <hubicka@gcc.gnu.org> | 2005-06-04 11:00:57 +0000 |
commit | e0342c26d32711da67235f44ab63714d9cc14f4a (patch) | |
tree | ad7551fb133434089490b54ee1f128a2f9fb7b37 /gcc/predict.c | |
parent | 29405f9481f118a1a8a02873ccef08b5b21b80ef (diff) | |
download | gcc-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
Diffstat (limited to 'gcc/predict.c')
-rw-r--r-- | gcc/predict.c | 16 |
1 files changed, 10 insertions, 6 deletions
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 |