Do not update SSA in lto-stremaer-in

Message ID 20191203140939.3fylcf3hvhans5qh@kam.mff.cuni.cz
State New
Headers show
Series
  • Do not update SSA in lto-stremaer-in
Related show

Commit Message

Jan Hubicka Dec. 3, 2019, 2:09 p.m.
Hi,
input_functions ends with building virtual SSA which is unnecesary
excercise when function is only loaded to be inlined, compared by
ipa-icf or its profile merged.

This patch moves the SSA update later before we start working on the
function body.

lto-bootstrapped/regtested x86_64-linux, OK?

Honza

	* cgraph.c: Inlcude tree-into-ssa.h
	(cgraph_node::get_body): Update SSA.
	* cgraphunit.c (cgraph_node::expand): Likewise.
	* lto-streamer-in.c (input_function): Do not update SSA.

Comments

Richard Biener Dec. 3, 2019, 2:42 p.m. | #1
On Tue, 3 Dec 2019, Jan Hubicka wrote:

> Hi,

> input_functions ends with building virtual SSA which is unnecesary

> excercise when function is only loaded to be inlined, compared by

> ipa-icf or its profile merged.

> 

> This patch moves the SSA update later before we start working on the

> function body.

> 

> lto-bootstrapped/regtested x86_64-linux, OK?


OK I guess, but please put the update_ssa call _after_
gimple_register_cfg_hooks () and obstrack register, right before
IPA transform execution in ::expand?



> Honza

> 

> 	* cgraph.c: Inlcude tree-into-ssa.h

> 	(cgraph_node::get_body): Update SSA.

> 	* cgraphunit.c (cgraph_node::expand): Likewise.

> 	* lto-streamer-in.c (input_function): Do not update SSA.

> Index: cgraph.c

> ===================================================================

> --- cgraph.c	(revision 278904)

> +++ cgraph.c	(working copy)

> @@ -62,6 +62,7 @@ along with GCC; see the file COPYING3.

>  #include "stringpool.h"

>  #include "attribs.h"

>  #include "selftest.h"

> +#include "tree-into-ssa.h"

>  

>  /* FIXME: Only for PROP_loops, but cgraph shouldn't have to know about this.  */

>  #include "tree-pass.h"

> @@ -3599,6 +3605,8 @@ cgraph_node::get_body (void)

>        set_dump_file (NULL);

>  

>        push_cfun (DECL_STRUCT_FUNCTION (decl));

> +

> +      update_ssa (TODO_update_ssa_only_virtuals);

>        execute_all_ipa_transforms (true);

>        cgraph_edge::rebuild_edges ();

>        free_dominance_info (CDI_DOMINATORS);

> Index: cgraphunit.c

> ===================================================================

> --- cgraphunit.c	(revision 278904)

> +++ cgraphunit.c	(working copy)

> @@ -2268,6 +2268,7 @@ cgraph_node::expand (void)

>  

>    gcc_assert (DECL_STRUCT_FUNCTION (decl));

>    push_cfun (DECL_STRUCT_FUNCTION (decl));

> +  update_ssa (TODO_update_ssa_only_virtuals);

>    init_function_start (decl);

>  

>    gimple_register_cfg_hooks ();

> Index: lto-streamer-in.c

> ===================================================================

> --- lto-streamer-in.c	(revision 278904)

> +++ lto-streamer-in.c	(working copy)

> @@ -1223,7 +1223,6 @@ input_function (tree fn_decl, class data

>    fixup_call_stmt_edges (node, stmts);

>    execute_all_ipa_stmt_fixups (node, stmts);

>  

> -  update_ssa (TODO_update_ssa_only_virtuals);

>    free_dominance_info (CDI_DOMINATORS);

>    free_dominance_info (CDI_POST_DOMINATORS);

>    free (stmts);

> 


-- 
Richard Biener <rguenther@suse.de>
SUSE Software Solutions Germany GmbH, Maxfeldstrasse 5, 90409 Nuernberg,
Germany; GF: Felix Imendörffer; HRB 36809 (AG Nuernberg)

Patch

Index: cgraph.c
===================================================================
--- cgraph.c	(revision 278904)
+++ cgraph.c	(working copy)
@@ -62,6 +62,7 @@  along with GCC; see the file COPYING3.
 #include "stringpool.h"
 #include "attribs.h"
 #include "selftest.h"
+#include "tree-into-ssa.h"
 
 /* FIXME: Only for PROP_loops, but cgraph shouldn't have to know about this.  */
 #include "tree-pass.h"
@@ -3599,6 +3605,8 @@  cgraph_node::get_body (void)
       set_dump_file (NULL);
 
       push_cfun (DECL_STRUCT_FUNCTION (decl));
+
+      update_ssa (TODO_update_ssa_only_virtuals);
       execute_all_ipa_transforms (true);
       cgraph_edge::rebuild_edges ();
       free_dominance_info (CDI_DOMINATORS);
Index: cgraphunit.c
===================================================================
--- cgraphunit.c	(revision 278904)
+++ cgraphunit.c	(working copy)
@@ -2268,6 +2268,7 @@  cgraph_node::expand (void)
 
   gcc_assert (DECL_STRUCT_FUNCTION (decl));
   push_cfun (DECL_STRUCT_FUNCTION (decl));
+  update_ssa (TODO_update_ssa_only_virtuals);
   init_function_start (decl);
 
   gimple_register_cfg_hooks ();
Index: lto-streamer-in.c
===================================================================
--- lto-streamer-in.c	(revision 278904)
+++ lto-streamer-in.c	(working copy)
@@ -1223,7 +1223,6 @@  input_function (tree fn_decl, class data
   fixup_call_stmt_edges (node, stmts);
   execute_all_ipa_stmt_fixups (node, stmts);
 
-  update_ssa (TODO_update_ssa_only_virtuals);
   free_dominance_info (CDI_DOMINATORS);
   free_dominance_info (CDI_POST_DOMINATORS);
   free (stmts);