summaryrefslogtreecommitdiff
path: root/gcc/predict.c
diff options
context:
space:
mode:
authorlaw <law@138bc75d-0d04-0410-961f-82ee72b054a4>2000-05-04 20:40:17 +0000
committerlaw <law@138bc75d-0d04-0410-961f-82ee72b054a4>2000-05-04 20:40:17 +0000
commitbe302bc2a7d0c77c1e3fad53be4c8f5e36e5e25a (patch)
tree5296ac150cb883c7cf09da641945890c5dda21bb /gcc/predict.c
parent65e605d440c0dbfed36522d75cb7d87b698d731d (diff)
downloadgcc-be302bc2a7d0c77c1e3fad53be4c8f5e36e5e25a.tar.gz
* predict.c (estimate_probability): If no prediction was found, then
predict the successor that is the next physical block (if such a successor exists). git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@33683 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/predict.c')
-rw-r--r--gcc/predict.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/gcc/predict.c b/gcc/predict.c
index b957e5f6050..148d46bb1e6 100644
--- a/gcc/predict.c
+++ b/gcc/predict.c
@@ -202,6 +202,19 @@ estimate_probability (loops_info)
break;
}
+ /* If one of the blocks already directly follows the current
+ block, then predict it as the taken path. This reduces
+ random block movement. */
+ for (e = BASIC_BLOCK (i)->succ; e; e = e->succ_next)
+ if (e->dest->index == i + 1)
+ {
+ if (e->flags & EDGE_FALLTHRU)
+ prob = 0;
+ else
+ prob = REG_BR_PROB_BASE;
+ goto emitnote;
+ }
+
/* If we havn't chosen something by now, predict 50-50. */
prob = REG_BR_PROB_BASE / 2;