aboutsummaryrefslogtreecommitdiff
path: root/gcc/bb-reorder.c
diff options
context:
space:
mode:
authorRichard Henderson <rth@redhat.com>2005-02-15 01:26:27 -0800
committerRichard Henderson <rth@gcc.gnu.org>2005-02-15 01:26:27 -0800
commit934677f9cc4ff525b7139251b0a67586d1ac4e80 (patch)
tree961babd85411d8ffc1c9470e5cd19e24e4031630 /gcc/bb-reorder.c
parente22857eb9d98ed0dff03bb311988f18335a5bf71 (diff)
downloadgcc-934677f9cc4ff525b7139251b0a67586d1ac4e80.zip
gcc-934677f9cc4ff525b7139251b0a67586d1ac4e80.tar.gz
gcc-934677f9cc4ff525b7139251b0a67586d1ac4e80.tar.bz2
bb-reorder.c (find_traces_1_round): Force fallthru edge from a call to be best_edge.
* bb-reorder.c (find_traces_1_round): Force fallthru edge from a call to be best_edge. From-SVN: r95062
Diffstat (limited to 'gcc/bb-reorder.c')
-rw-r--r--gcc/bb-reorder.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/gcc/bb-reorder.c b/gcc/bb-reorder.c
index f454ce0..d054ffd 100644
--- a/gcc/bb-reorder.c
+++ b/gcc/bb-reorder.c
@@ -488,6 +488,7 @@ find_traces_1_round (int branch_th, int exec_th, gcov_type count_th,
do
{
int prob, freq;
+ bool ends_in_call;
/* The probability and frequency of the best edge. */
int best_prob = INT_MIN / 2;
@@ -501,6 +502,8 @@ find_traces_1_round (int branch_th, int exec_th, gcov_type count_th,
fprintf (dump_file, "Basic block %d was visited in trace %d\n",
bb->index, *n_traces - 1);
+ ends_in_call = block_ends_with_call_p (bb);
+
/* Select the successor that will be placed after BB. */
FOR_EACH_EDGE (e, ei, bb->succs)
{
@@ -520,6 +523,19 @@ find_traces_1_round (int branch_th, int exec_th, gcov_type count_th,
prob = e->probability;
freq = EDGE_FREQUENCY (e);
+ /* The only sensible preference for a call instruction is the
+ fallthru edge. Don't bother selecting anything else. */
+ if (ends_in_call)
+ {
+ if (e->flags & EDGE_CAN_FALLTHRU)
+ {
+ best_edge = e;
+ best_prob = prob;
+ best_freq = freq;
+ }
+ continue;
+ }
+
/* Edge that cannot be fallthru or improbable or infrequent
successor (i.e. it is unsuitable successor). */
if (!(e->flags & EDGE_CAN_FALLTHRU) || (e->flags & EDGE_COMPLEX)