diff mbox series

lto: fix usage of timer in materialize_cgraph

Message ID ac22ef05-6313-23fc-5972-e97b380601fe@suse.cz
State New
Headers show
Series lto: fix usage of timer in materialize_cgraph | expand

Commit Message

Martin Liška Nov. 23, 2022, 9:40 a.m. UTC
Pretty obvious change.

Ready to be installed?
Thanks,
Martin

	PR lto/107829

gcc/lto/ChangeLog:

	* lto.cc (materialize_cgraph): Call timevar_push before
	materialization starts.
---
 gcc/lto/lto.cc | 14 ++++++--------
 1 file changed, 6 insertions(+), 8 deletions(-)

Comments

Martin Liška Nov. 25, 2022, 9:48 a.m. UTC | #1
On 11/23/22 10:40, Martin Liška wrote:
> Pretty obvious change.
> 
> Ready to be installed?

Pushed as obvious.

Martin

> Thanks,
> Martin
> 
> 	PR lto/107829
> 
> gcc/lto/ChangeLog:
> 
> 	* lto.cc (materialize_cgraph): Call timevar_push before
> 	materialization starts.
> ---
>  gcc/lto/lto.cc | 14 ++++++--------
>  1 file changed, 6 insertions(+), 8 deletions(-)
> 
> diff --git a/gcc/lto/lto.cc b/gcc/lto/lto.cc
> index 3a9147b01b5..3265a1d07bc 100644
> --- a/gcc/lto/lto.cc
> +++ b/gcc/lto/lto.cc
> @@ -137,6 +137,12 @@ materialize_cgraph (void)
>      fprintf (stderr,
>  	     flag_wpa ? "Materializing decls:" : "Reading function bodies:");
>  
> +  /* Start the appropriate timer depending on the mode that we are
> +     operating in.  */
> +  lto_timer = (flag_wpa) ? TV_WHOPR_WPA
> +	      : (flag_ltrans) ? TV_WHOPR_LTRANS
> +	      : TV_LTO;
> +  timevar_push (lto_timer);
>  
>    FOR_EACH_FUNCTION (node)
>      {
> @@ -147,14 +153,6 @@ materialize_cgraph (void)
>  	}
>      }
>  
> -
> -  /* Start the appropriate timer depending on the mode that we are
> -     operating in.  */
> -  lto_timer = (flag_wpa) ? TV_WHOPR_WPA
> -	      : (flag_ltrans) ? TV_WHOPR_LTRANS
> -	      : TV_LTO;
> -  timevar_push (lto_timer);
> -
>    current_function_decl = NULL;
>    set_cfun (NULL);
>
diff mbox series

Patch

diff --git a/gcc/lto/lto.cc b/gcc/lto/lto.cc
index 3a9147b01b5..3265a1d07bc 100644
--- a/gcc/lto/lto.cc
+++ b/gcc/lto/lto.cc
@@ -137,6 +137,12 @@  materialize_cgraph (void)
     fprintf (stderr,
 	     flag_wpa ? "Materializing decls:" : "Reading function bodies:");
 
+  /* Start the appropriate timer depending on the mode that we are
+     operating in.  */
+  lto_timer = (flag_wpa) ? TV_WHOPR_WPA
+	      : (flag_ltrans) ? TV_WHOPR_LTRANS
+	      : TV_LTO;
+  timevar_push (lto_timer);
 
   FOR_EACH_FUNCTION (node)
     {
@@ -147,14 +153,6 @@  materialize_cgraph (void)
 	}
     }
 
-
-  /* Start the appropriate timer depending on the mode that we are
-     operating in.  */
-  lto_timer = (flag_wpa) ? TV_WHOPR_WPA
-	      : (flag_ltrans) ? TV_WHOPR_LTRANS
-	      : TV_LTO;
-  timevar_push (lto_timer);
-
   current_function_decl = NULL;
   set_cfun (NULL);