aboutsummaryrefslogtreecommitdiff
path: root/gcc/passes.c
diff options
context:
space:
mode:
authorRichard Biener <rguenther@suse.de>2016-08-12 07:38:24 +0000
committerRichard Biener <rguenth@gcc.gnu.org>2016-08-12 07:38:24 +0000
commit8df06bd0eb37240c40140bf2d2528ad6a665474a (patch)
treeec56bb1a6459b7d3c0776301373c8e2067935fae /gcc/passes.c
parent663eecfd13dbedddf6fccc1a857dd1728078040b (diff)
downloadgcc-8df06bd0eb37240c40140bf2d2528ad6a665474a.zip
gcc-8df06bd0eb37240c40140bf2d2528ad6a665474a.tar.gz
gcc-8df06bd0eb37240c40140bf2d2528ad6a665474a.tar.bz2
passes.c (execute_todo): Do not push/pop TV_TODO.
2016-08-12 Richard Biener <rguenther@suse.de> * passes.c (execute_todo): Do not push/pop TV_TODO. (execute_one_ipa_transform_pass): Move timevar push/pop TODO execution. (execute_one_pass): Likewise. * common.opt (ftime-report-details): New switch. * doc/invoke.texi (ftime-report-details): Document. * timevar.h (timer::print_row): Adjust signature. (timer::all_zero): New static helper. (timer::child_map_t): New typedef. (timer::time_var_def): Add children field. * timevar.c (timer::named_items::print): Adjust. (timer::~timer): Free timevar recorded children. (timer::pop_internal): When -ftime-report-details record time spent in sub-timevars. (timer::print_row): Adjust. (timer::print): Print sub-timevar stats, use all_zero. * timevar.def (TV_TODO): Remove. From-SVN: r239406
Diffstat (limited to 'gcc/passes.c')
-rw-r--r--gcc/passes.c39
1 files changed, 20 insertions, 19 deletions
diff --git a/gcc/passes.c b/gcc/passes.c
index 0565cfa..c7d7dbe 100644
--- a/gcc/passes.c
+++ b/gcc/passes.c
@@ -2008,8 +2008,6 @@ execute_todo (unsigned int flags)
&& need_ssa_update_p (cfun))
gcc_assert (flags & TODO_update_ssa_any);
- timevar_push (TV_TODO);
-
statistics_fini_pass ();
if (flags)
@@ -2043,8 +2041,6 @@ execute_todo (unsigned int flags)
df problems. */
if (flags & TODO_df_finish)
df_finish_pass ((flags & TODO_df_verify) != 0);
-
- timevar_pop (TV_TODO);
}
/* Verify invariants that should hold between passes. This is a place
@@ -2198,20 +2194,16 @@ execute_one_ipa_transform_pass (struct cgraph_node *node,
pass_init_dump_file (pass);
- /* Run pre-pass verification. */
- execute_todo (ipa_pass->function_transform_todo_flags_start);
-
/* If a timevar is present, start it. */
if (pass->tv_id != TV_NONE)
timevar_push (pass->tv_id);
+ /* Run pre-pass verification. */
+ execute_todo (ipa_pass->function_transform_todo_flags_start);
+
/* Do it! */
todo_after = ipa_pass->function_transform (node);
- /* Stop timevar. */
- if (pass->tv_id != TV_NONE)
- timevar_pop (pass->tv_id);
-
if (profile_report && cfun && (cfun->curr_properties & PROP_cfg))
check_profile_consistency (pass->static_pass_number, 0, true);
@@ -2221,6 +2213,10 @@ execute_one_ipa_transform_pass (struct cgraph_node *node,
if (profile_report && cfun && (cfun->curr_properties & PROP_cfg))
check_profile_consistency (pass->static_pass_number, 1, true);
+ /* Stop timevar. */
+ if (pass->tv_id != TV_NONE)
+ timevar_pop (pass->tv_id);
+
if (dump_file)
do_per_function (execute_function_dump, pass);
pass_fini_dump_file (pass);
@@ -2329,6 +2325,10 @@ execute_one_pass (opt_pass *pass)
pass_init_dump_file (pass);
+ /* If a timevar is present, start it. */
+ if (pass->tv_id != TV_NONE)
+ timevar_push (pass->tv_id);
+
/* Run pre-pass verification. */
execute_todo (pass->todo_flags_start);
@@ -2336,15 +2336,15 @@ execute_one_pass (opt_pass *pass)
do_per_function (verify_curr_properties,
(void *)(size_t)pass->properties_required);
- /* If a timevar is present, start it. */
- if (pass->tv_id != TV_NONE)
- timevar_push (pass->tv_id);
-
/* Do it! */
todo_after = pass->execute (cfun);
if (todo_after & TODO_discard_function)
{
+ /* Stop timevar. */
+ if (pass->tv_id != TV_NONE)
+ timevar_pop (pass->tv_id);
+
pass_fini_dump_file (pass);
gcc_assert (cfun);
@@ -2371,10 +2371,6 @@ execute_one_pass (opt_pass *pass)
do_per_function (clear_last_verified, NULL);
- /* Stop timevar. */
- if (pass->tv_id != TV_NONE)
- timevar_pop (pass->tv_id);
-
do_per_function (update_properties_after_pass, pass);
if (profile_report && cfun && (cfun->curr_properties & PROP_cfg))
@@ -2386,6 +2382,11 @@ execute_one_pass (opt_pass *pass)
check_profile_consistency (pass->static_pass_number, 1, true);
verify_interpass_invariants ();
+
+ /* Stop timevar. */
+ if (pass->tv_id != TV_NONE)
+ timevar_pop (pass->tv_id);
+
if (pass->type == IPA_PASS
&& ((ipa_opt_pass_d *)pass)->function_transform)
{