aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeffrey A Law <law@cygnus.com>2000-05-04 20:40:17 +0000
committerJeff Law <law@gcc.gnu.org>2000-05-04 14:40:17 -0600
commit926fd2e161ada3acf143b8c123b9237d53e3c27e (patch)
tree5296ac150cb883c7cf09da641945890c5dda21bb
parent18b554cb71bb790f06d71feb133ac9a12366f324 (diff)
downloadgcc-926fd2e161ada3acf143b8c123b9237d53e3c27e.zip
gcc-926fd2e161ada3acf143b8c123b9237d53e3c27e.tar.gz
gcc-926fd2e161ada3acf143b8c123b9237d53e3c27e.tar.bz2
predict.c (estimate_probability): If no prediction was found...
* predict.c (estimate_probability): If no prediction was found, then predict the successor that is the next physical block (if such a successor exists). From-SVN: r33683
-rw-r--r--gcc/ChangeLog6
-rw-r--r--gcc/predict.c13
2 files changed, 19 insertions, 0 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index fbab640..a1312d23 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,9 @@
+Thu May 4 14:37:23 2000 Jeffrey A Law (law@cygnus.com)
+
+ * predict.c (estimate_probability): If no prediction was found, then
+ predict the successor that is the next physical block (if such a
+ successor exists).
+
2000-05-04 Richard Henderson <rth@cygnus.com>
* config/alpha/t-alpha (LIB2FUNCS_EXTRA): Use qrrnd.asm in place.
diff --git a/gcc/predict.c b/gcc/predict.c
index b957e5f6..148d46b 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;