summaryrefslogtreecommitdiff
path: root/gcc/tree-profile.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/tree-profile.c')
-rw-r--r--gcc/tree-profile.c27
1 files changed, 27 insertions, 0 deletions
diff --git a/gcc/tree-profile.c b/gcc/tree-profile.c
index 0f73e3cf4cb..a19e3a42ad1 100644
--- a/gcc/tree-profile.c
+++ b/gcc/tree-profile.c
@@ -273,6 +273,33 @@ struct tree_opt_pass pass_tree_profile =
0 /* letter */
};
+/* Return 1 if tree-based profiling is in effect, else 0.
+ If it is, set up hooks for tree-based profiling.
+ Gate for pass_tree_profile. */
+
+static bool
+do_early_tree_profiling (void)
+{
+ return (do_tree_profiling () && (!flag_unit_at_a_time || !optimize));
+}
+
+struct tree_opt_pass pass_early_tree_profile =
+{
+ "early_tree_profile", /* name */
+ do_early_tree_profiling, /* gate */
+ tree_profiling, /* execute */
+ NULL, /* sub */
+ NULL, /* next */
+ 0, /* static_pass_number */
+ TV_BRANCH_PROB, /* tv_id */
+ PROP_gimple_leh | PROP_cfg, /* properties_required */
+ PROP_gimple_leh | PROP_cfg, /* properties_provided */
+ 0, /* properties_destroyed */
+ 0, /* todo_flags_start */
+ TODO_verify_stmts, /* todo_flags_finish */
+ 0 /* letter */
+};
+
struct profile_hooks tree_profile_hooks =
{
tree_init_edge_profiler, /* init_edge_profiler */