summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorhubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4>2004-09-25 10:06:18 +0000
committerhubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4>2004-09-25 10:06:18 +0000
commitffedd2549f6fe6cd65d27e8608032b38c940e79d (patch)
treea844c1a79dda581a3aa0d026ae759027d7ec0a30
parent182c482c1f4531d830caeb9755fd9ebf29dc189e (diff)
downloadgcc-ffedd2549f6fe6cd65d27e8608032b38c940e79d.tar.gz
* 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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@88093 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/ChangeLog6
-rw-r--r--gcc/predict.c3
-rw-r--r--gcc/predict.h1
-rw-r--r--gcc/profile.c1
-rw-r--r--gcc/tree-profile.c6
5 files changed, 13 insertions, 4 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index db7034463da..023b449ed37 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,5 +1,11 @@
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.
diff --git a/gcc/predict.c b/gcc/predict.c
index cc314ecad74..18b6b90814c 100644
--- a/gcc/predict.c
+++ b/gcc/predict.c
@@ -76,7 +76,6 @@ static void dump_prediction (FILE *, enum br_predictor, int, basic_block, int);
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);
@@ -1705,7 +1704,7 @@ estimate_loops_at_level (struct loop *first_loop)
/* 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;
diff --git a/gcc/predict.h b/gcc/predict.h
index 16817f9b5b6..77198118f08 100644
--- a/gcc/predict.h
+++ b/gcc/predict.h
@@ -41,5 +41,6 @@ enum prediction
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 */
diff --git a/gcc/profile.c b/gcc/profile.c
index 7b04bfdf12f..3f48be623d2 100644
--- a/gcc/profile.c
+++ b/gcc/profile.c
@@ -590,6 +590,7 @@ compute_branch_probabilities (void)
num_branches++, num_never_executed;
}
}
+ counts_to_freqs ();
if (dump_file)
{
diff --git a/gcc/tree-profile.c b/gcc/tree-profile.c
index 29299e53cca..00c36e233ec 100644
--- a/gcc/tree-profile.c
+++ b/gcc/tree-profile.c
@@ -160,12 +160,14 @@ tree_gen_const_delta_profiler (histogram_value value ATTRIBUTE_UNUSED,
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. */