summaryrefslogtreecommitdiff
path: root/gcc/bb-reorder.c
diff options
context:
space:
mode:
authorzlomek <zlomek@138bc75d-0d04-0410-961f-82ee72b054a4>2003-02-19 18:12:54 +0000
committerzlomek <zlomek@138bc75d-0d04-0410-961f-82ee72b054a4>2003-02-19 18:12:54 +0000
commitd5ade7f449e69d05f535d632bf7f3410b1eb3e7f (patch)
tree4c8382923a9291af159b79e52ac1a3d9325f105d /gcc/bb-reorder.c
parent6a635b57b1040e31a3f79739bbfeb3c8c868b93c (diff)
downloadgcc-d5ade7f449e69d05f535d632bf7f3410b1eb3e7f.tar.gz
* bb-reorder.c (find_traces_1_round): Fixed condition for small
destination block with multiple predecessors. (connect_traces): Check whether the block is a start of trace. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@63127 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/bb-reorder.c')
-rw-r--r--gcc/bb-reorder.c31
1 files changed, 17 insertions, 14 deletions
diff --git a/gcc/bb-reorder.c b/gcc/bb-reorder.c
index 49889ee2ba3..f89900d470b 100644
--- a/gcc/bb-reorder.c
+++ b/gcc/bb-reorder.c
@@ -448,12 +448,6 @@ find_traces_1_round (branch_th, exec_th, count_th, traces, n_traces, round,
|| prob < branch_th || freq < exec_th || e->count < count_th)
continue;
- /* If the destination has multiple precessesors, and can be
- duplicated cheaper than a jump, don't allow it to be added
- to a trace. We'll duplicate it when connecting traces. */
- if (e->dest->pred->pred_next && copy_bb_p (e->dest, 0))
- continue;
-
if (better_edge_p (bb, e, prob, freq, best_prob, best_freq))
{
best_edge = e;
@@ -462,6 +456,13 @@ find_traces_1_round (branch_th, exec_th, count_th, traces, n_traces, round,
}
}
+ /* If the best destination has multiple precessesors, and can be
+ duplicated cheaper than a jump, don't allow it to be added
+ to a trace. We'll duplicate it when connecting traces. */
+ if (best_edge && best_edge->dest->pred->pred_next
+ && copy_bb_p (best_edge->dest, 0))
+ best_edge = NULL;
+
/* Add all non-selected successors to the heaps. */
for (e = bb->succ; e; e = e->succ_next)
{
@@ -922,15 +923,17 @@ connect_traces (n_traces, traces)
edge best2 = NULL;
int best2_len = 0;
- /* If the destination trace is only one block
- long, then no need to search the successor
+ /* If the destination is a start of a trace which is only
+ one block long, then no need to search the successor
blocks of the trace. Accept it. */
- if (traces[bbd[e->dest->index].start_of_trace].length == 1)
- {
- best = e;
- try_copy = true;
- continue;
- }
+ if (bbd[e->dest->index].start_of_trace >= 0
+ && traces[bbd[e->dest->index].start_of_trace].length
+ == 1)
+ {
+ best = e;
+ try_copy = true;
+ continue;
+ }
for (e2 = e->dest->succ; e2; e2 = e2->succ_next)
{