aboutsummaryrefslogtreecommitdiff
path: root/gcc/predict.c
diff options
context:
space:
mode:
authorJan Hubicka <jh@suse.cz>2001-08-15 13:24:17 +0200
committerJan Hubicka <hubicka@gcc.gnu.org>2001-08-15 11:24:17 +0000
commitcc10816d2df6cc6ca36359e11baf40e95fc16f04 (patch)
treeeb462fa7de3248afd4b06ace45182e5e6dd29dc5 /gcc/predict.c
parentfd7e958f94d3143c2c59d0ad159e07414f790b56 (diff)
downloadgcc-cc10816d2df6cc6ca36359e11baf40e95fc16f04.zip
gcc-cc10816d2df6cc6ca36359e11baf40e95fc16f04.tar.gz
gcc-cc10816d2df6cc6ca36359e11baf40e95fc16f04.tar.bz2
* predict.def: Update hitrates.
From-SVN: r44920
Diffstat (limited to 'gcc/predict.c')
-rw-r--r--gcc/predict.c39
1 files changed, 10 insertions, 29 deletions
diff --git a/gcc/predict.c b/gcc/predict.c
index ade8121..63819e3 100644
--- a/gcc/predict.c
+++ b/gcc/predict.c
@@ -608,10 +608,6 @@ typedef struct block_info_def
/* True if block already converted. */
int visited:1;
-
- /* Number of block proceeded before adding basic block to the queue. Used
- to recognize irregular regions. */
- int nvisited;
} *block_info;
/* Similar information for edges. */
@@ -638,7 +634,6 @@ propagate_freq (head)
basic_block last = bb;
edge e;
basic_block nextbb;
- int nvisited = 0;
BLOCK_INFO (head)->frequency = 1;
for (; bb; bb = nextbb)
@@ -652,38 +647,25 @@ propagate_freq (head)
if (bb != head)
{
for (e = bb->pred; e; e = e->pred_next)
- if (!BLOCK_INFO (e->src)->visited && !EDGE_INFO (e)->back_edge)
+ if (!BLOCK_INFO (e->src)->visited && !(e->flags & EDGE_DFS_BACK))
break;
- /* We haven't proceeded all predecessors of edge e yet.
- These may be waiting in the queue or we may hit an
- irreducible region.
-
- To avoid infinite looping on irrecudible regions, count
- the number of blocks proceeded at the time the basic
- block has been queued. In the case the number doesn't
- change, we've hit an irreducible region and we can forget
- the backward edge. This can increase the time complexity
- by the number of irreducible blocks, but in the same way
- the standard the loop does, so it should not result in a
- noticeable slowdown.
-
- Alternatively we may distinguish backward and cross edges
- in the DFS tree by the preprocessing pass and ignore the
- existence of non-loop backward edges. */
- if (e && BLOCK_INFO (bb)->nvisited != nvisited)
+ /* We haven't proceeded all predecessors of edge e yet. */
+ if (e)
{
if (!nextbb)
nextbb = e->dest;
else
BLOCK_INFO (last)->next = e->dest;
- BLOCK_INFO (last)->nvisited = nvisited;
last = e->dest;
continue;
}
- else if (e && rtl_dump_file)
- fprintf (rtl_dump_file, "Irreducible region hit, ignoring edge to bb %i\n",
- bb->index);
+ if (rtl_dump_file)
+ for (e = bb->pred; e; e = e->pred_next)
+ if (!BLOCK_INFO (e->src)->visited && !EDGE_INFO (e)->back_edge)
+ fprintf (rtl_dump_file,
+ "Irreducible region hit, ignoring edge to %i->%i\n",
+ e->src->index, bb->index);
for (e = bb->pred; e; e = e->pred_next)
if (EDGE_INFO (e)->back_edge)
@@ -718,10 +700,8 @@ propagate_freq (head)
nextbb = e->dest;
else
BLOCK_INFO (last)->next = e->dest;
- BLOCK_INFO (last)->nvisited = nvisited;
last = e->dest;
}
- nvisited ++;
}
}
@@ -801,6 +781,7 @@ estimate_bb_frequencies (loops)
int i;
double freq_max = 0;
+ mark_dfs_back_edges ();
if (flag_branch_probabilities)
{
counts_to_freqs ();