predict.c (estimate_probability): If no prediction was found...
authorJeffrey A Law <law@cygnus.com>
Thu, 4 May 2000 20:40:17 +0000 (20:40 +0000)
committerJeff Law <law@gcc.gnu.org>
Thu, 4 May 2000 20:40:17 +0000 (14:40 -0600)
        * 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

gcc/ChangeLog
gcc/predict.c

index fbab6406025bd98137fb01348d55cd3a02b9f9f1..a1312d23b3753a270a4922d5fbca9f6be8deed19 100644 (file)
@@ -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.
index b957e5f6050fb59408acac70c35ba13d62340a1e..148d46bb1e6f89d5d6ce081089a01cb9d1dc5ba3 100644 (file)
@@ -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;