* predict.c (counts_to_freqs): Make glolbal.
* predict.h (counts_to_freqa): Declare.
* profile.c (compute_branch_probabilities): Compute frequencies
* tree-profile.c (do_tree_profiling): Refine conditional on when
tree profiling pass is needed.
From-SVN: r88093
2004-09-25 Jan Hubicka <jh@suse.cz>
+ * predict.c (counts_to_freqs): Make glolbal.
+ * predict.h (counts_to_freqa): Declare.
+ * profile.c (compute_branch_probabilities): Compute frequencies
+ * tree-profile.c (do_tree_profiling): Refine conditional on when
+ tree profiling pass is needed.
+
* passes.c (rest_of_handle_cfg): Disable const/pure function
detection when doing tree based profiling.
static void estimate_loops_at_level (struct loop *loop);
static void propagate_freq (struct loop *);
static void estimate_bb_frequencies (struct loops *);
-static int counts_to_freqs (void);
static void predict_paths_leading_to (basic_block, int *, enum br_predictor, enum prediction);
static bool last_basic_block_p (basic_block);
static void compute_function_frequency (void);
/* Convert counts measured by profile driven feedback to frequencies.
Return nonzero iff there was any nonzero execution count. */
-static int
+int
counts_to_freqs (void)
{
gcov_type count_max, true_count_max = 0;
extern void predict_insn_def (rtx, enum br_predictor, enum prediction);
extern void predict_insn (rtx, enum br_predictor, int);
+extern int counts_to_freqs (void);
#endif /* GCC_PREDICT_H */
num_branches++, num_never_executed;
}
}
+ counts_to_freqs ();
if (dump_file)
{
static bool do_tree_profiling (void)
{
- if (flag_tree_based_profiling)
+ if (flag_tree_based_profiling
+ && (profile_arc_flag || flag_test_coverage || flag_branch_probabilities))
{
tree_register_profile_hooks ();
tree_register_value_prof_hooks ();
+ return true;
}
- return flag_tree_based_profiling;
+ return false;
}
/* Return the file on which profile dump output goes, if any. */