* 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.
From-SVN: r33464
+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.
/* 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++)
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);
-}
\f
/* Perform data flow analysis.
F is the first insn of the function; FLAGS is a set of PROP_* flags
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;
}
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
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 ();
});