aboutsummaryrefslogtreecommitdiff
path: root/gcc/predict.c
diff options
context:
space:
mode:
authorJeff Law <law@redhat.com>2004-11-22 10:14:00 -0700
committerJeff Law <law@gcc.gnu.org>2004-11-22 10:14:00 -0700
commit9ff3d2dea058075c670842e6ae0ac47d4405f829 (patch)
treee3538ca20caef7bf1f7f387c46b84c91cda52be6 /gcc/predict.c
parent169c5767efa86cacdd6be4ac8cdc21b35f7cab5b (diff)
downloadgcc-9ff3d2dea058075c670842e6ae0ac47d4405f829.zip
gcc-9ff3d2dea058075c670842e6ae0ac47d4405f829.tar.gz
gcc-9ff3d2dea058075c670842e6ae0ac47d4405f829.tar.bz2
cfg.c (cached_make_edge): Use find_edge rather than an inlined variant.
* cfg.c (cached_make_edge): Use find_edge rather than an inlined variant. * cfgbuild.c (make_edges): Likewise. * cfghooks.c (can_duplicate_block_p): Likewise. * cfgloop.c (loop_latch_edge): Likewise. * cfgloopmanip.c (force_single_succ_latches): Likewise. * cfgrtl.c (rtl_flow_call_edges_add): Likewise. * predict.c (predict_loops, propagate_freq): Likewise. * tracer.c (tail_duplicate): Likewise. * tree-cfg.c (disband_implicit_edges): Likewise. (tree_forwarder_block_p, tree_flow_call_edges_add): Likewise. From-SVN: r91019
Diffstat (limited to 'gcc/predict.c')
-rw-r--r--gcc/predict.c41
1 files changed, 21 insertions, 20 deletions
diff --git a/gcc/predict.c b/gcc/predict.c
index 432e837..daf9839 100644
--- a/gcc/predict.c
+++ b/gcc/predict.c
@@ -669,13 +669,15 @@ predict_loops (struct loops *loops_info, bool rtlsimpleloops)
/* Loop branch heuristics - predict an edge back to a
loop's head as taken. */
- FOR_EACH_EDGE (e, ei, bb->succs)
- if (e->dest == loop->header
- && e->src == loop->latch)
- {
- header_found = 1;
- predict_edge_def (e, PRED_LOOP_BRANCH, TAKEN);
- }
+ if (bb == loop->latch)
+ {
+ e = find_edge (loop->latch, loop->header);
+ if (e)
+ {
+ header_found = 1;
+ predict_edge_def (e, PRED_LOOP_BRANCH, TAKEN);
+ }
+ }
/* Loop exit heuristics - predict an edge exiting the loop if the
conditional has no loop header successors as not taken. */
@@ -1660,21 +1662,20 @@ propagate_freq (struct loop *loop, bitmap tovisit)
bitmap_clear_bit (tovisit, bb->index);
- /* Compute back edge frequencies. */
- FOR_EACH_EDGE (e, ei, bb->succs)
- if (e->dest == head)
- {
- sreal tmp;
+ e = find_edge (bb, head);
+ if (e)
+ {
+ sreal tmp;
- /* EDGE_INFO (e)->back_edge_prob
- = ((e->probability * BLOCK_INFO (bb)->frequency)
- / REG_BR_PROB_BASE); */
+ /* EDGE_INFO (e)->back_edge_prob
+ = ((e->probability * BLOCK_INFO (bb)->frequency)
+ / REG_BR_PROB_BASE); */
- sreal_init (&tmp, e->probability, 0);
- sreal_mul (&tmp, &tmp, &BLOCK_INFO (bb)->frequency);
- sreal_mul (&EDGE_INFO (e)->back_edge_prob,
- &tmp, &real_inv_br_prob_base);
- }
+ sreal_init (&tmp, e->probability, 0);
+ sreal_mul (&tmp, &tmp, &BLOCK_INFO (bb)->frequency);
+ sreal_mul (&EDGE_INFO (e)->back_edge_prob,
+ &tmp, &real_inv_br_prob_base);
+ }
/* Propagate to successor blocks. */
FOR_EACH_EDGE (e, ei, bb->succs)