diff options
author | rth <rth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2000-04-27 05:58:05 +0000 |
---|---|---|
committer | rth <rth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2000-04-27 05:58:05 +0000 |
commit | 8f8a2c5e5008674c5d6685753ad5cdfb14515880 (patch) | |
tree | 0935d72565c8f62d3c8af62f67c83e7ecadf6c31 | |
parent | 77122c272ca8f152f162e0479c3891dceabb4b0b (diff) | |
download | ppe42-gcc-8f8a2c5e5008674c5d6685753ad5cdfb14515880.tar.gz ppe42-gcc-8f8a2c5e5008674c5d6685753ad5cdfb14515880.zip |
* jump.c (invert_jump): Always invert REG_BR_PROB. Do it correctly.
* bb-reorder.c (reorder_basic_blocks): Don't run estimate_probability.
* flow.c (calculate_loop_depth): Remove.
* output.h (calculate_loop_depth): Don't declare.
* toplev.c (rest_of_compilation): Expand calculate_loop_depth
inline; run estimate_probability at the same time.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@33464 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r-- | gcc/ChangeLog | 10 | ||||
-rw-r--r-- | gcc/bb-reorder.c | 4 | ||||
-rw-r--r-- | gcc/flow.c | 17 | ||||
-rw-r--r-- | gcc/jump.c | 18 | ||||
-rw-r--r-- | gcc/output.h | 1 | ||||
-rw-r--r-- | gcc/toplev.c | 17 |
6 files changed, 33 insertions, 34 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 7931e3c38e7..1d134c0ee30 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,13 @@ +2000-04-26 Richard Henderson <rth@cygnus.com> + + * jump.c (invert_jump): Always invert REG_BR_PROB. Do it correctly. + + * bb-reorder.c (reorder_basic_blocks): Don't run estimate_probability. + * flow.c (calculate_loop_depth): Remove. + * output.h (calculate_loop_depth): Don't declare. + * toplev.c (rest_of_compilation): Expand calculate_loop_depth + inline; run estimate_probability at the same time. + 2000-04-26 Neil Booth <NeilB@earthling.net> * cpplib.h: "~=" is not a single pp-token. diff --git a/gcc/bb-reorder.c b/gcc/bb-reorder.c index 5f2e178c032..7812ff1bab9 100644 --- a/gcc/bb-reorder.c +++ b/gcc/bb-reorder.c @@ -813,10 +813,6 @@ reorder_basic_blocks () /* Dump loop information. */ flow_loops_dump (&loops_info, rtl_dump_file, 0); - /* Estimate using heuristics if no profiling info is available. */ - if (! flag_branch_probabilities) - estimate_probability (&loops_info); - reorder_last_visited = BASIC_BLOCK (0); for (i = 0; i < n_basic_blocks; i++) diff --git a/gcc/flow.c b/gcc/flow.c index 7b24942977f..23402d39120 100644 --- a/gcc/flow.c +++ b/gcc/flow.c @@ -2469,23 +2469,6 @@ tidy_fallthru_edges () tidy_fallthru_edge (s, b, c); } } - -/* Discover and record the loop depth at the head of each basic block. */ - -void -calculate_loop_depth (dump) - FILE *dump; -{ - struct loops loops; - - /* The loop infrastructure does the real job for us. */ - flow_loops_find (&loops); - - if (dump) - flow_loops_dump (&loops, dump, 0); - - flow_loops_free (&loops); -} /* Perform data flow analysis. F is the first insn of the function; FLAGS is a set of PROP_* flags diff --git a/gcc/jump.c b/gcc/jump.c index 6b5fecdc91f..06b5bd58e26 100644 --- a/gcc/jump.c +++ b/gcc/jump.c @@ -4431,17 +4431,13 @@ invert_jump (jump, nlabel) if (redirect_jump (jump, nlabel)) { - if (flag_branch_probabilities) - { - rtx note = find_reg_note (jump, REG_BR_PROB, 0); - - /* An inverted jump means that a probability taken becomes a - probability not taken. Subtract the branch probability from the - probability base to convert it back to a taken probability. - (We don't flip the probability on a branch that's never taken. */ - if (note && XINT (XEXP (note, 0), 0) >= 0) - XINT (XEXP (note, 0), 0) = REG_BR_PROB_BASE - XINT (XEXP (note, 0), 0); - } + /* An inverted jump means that a probability taken becomes a + probability not taken. Subtract the branch probability from the + probability base to convert it back to a taken probability. */ + + rtx note = find_reg_note (jump, REG_BR_PROB, 0); + if (note) + XEXP (note, 0) = GEN_INT (REG_BR_PROB_BASE - INTVAL (XEXP (note, 0))); return 1; } diff --git a/gcc/output.h b/gcc/output.h index e54bc3571a6..6af8de6bea0 100644 --- a/gcc/output.h +++ b/gcc/output.h @@ -134,7 +134,6 @@ extern int regno_clobbered_at_setjmp PARAMS ((int)); extern void dump_flow_info PARAMS ((FILE *)); extern void find_basic_blocks PARAMS ((rtx, int, FILE *)); extern void cleanup_cfg PARAMS ((rtx)); -extern void calculate_loop_depth PARAMS ((FILE *)); extern void free_basic_block_vars PARAMS ((int)); extern void set_block_num PARAMS ((rtx, int)); #endif diff --git a/gcc/toplev.c b/gcc/toplev.c index dd8ea2a8e8a..65f7ee807c4 100644 --- a/gcc/toplev.c +++ b/gcc/toplev.c @@ -3246,7 +3246,22 @@ rest_of_compilation (decl) find_basic_blocks (insns, max_reg_num (), rtl_dump_file); cleanup_cfg (insns); if (optimize) - calculate_loop_depth (rtl_dump_file); + { + struct loops loops; + + /* Discover and record the loop depth at the head of each basic + block. The loop infrastructure does the real job for us. */ + flow_loops_find (&loops); + + /* Estimate using heuristics if no profiling info is available. */ + if (! flag_branch_probabilities) + estimate_probability (&loops); + + if (rtl_dump_file) + flow_loops_dump (&loops, rtl_dump_file, 0); + + flow_loops_free (&loops); + } life_analysis (insns, rtl_dump_file, PROP_FINAL); mark_constant_function (); }); |