public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [lto][patch] Move calls to execute_one_ipa_transform_pass
@ 2008-10-22 20:19 Rafael Espindola
  2008-10-22 20:46 ` Diego Novillo
  0 siblings, 1 reply; 2+ messages in thread
From: Rafael Espindola @ 2008-10-22 20:19 UTC (permalink / raw)
  To: gcc-patches; +Cc: Diego Novillo

[-- Attachment #1: Type: text/plain, Size: 636 bytes --]

This moves the call of execute_one_ipa_transform_pass out of the pass
manager. I still have to move things a bit more to be able to fully
run IPA and then regenerate the summaries.

2008-10-22 Rafael Espindola  <espindola@google.com>

	* passes.c (execute_all_ipa_transforms): New.
	(execute_one_pass): Don't call execute_one_ipa_transform_pass.
	* tree-optimize.c (tree_rest_of_compilation): Call
	execute_all_ipa_transforms.
	* tree-pass.h (execute_all_ipa_transforms): New.

Cheers,
-- 
Rafael Avila de Espindola

Google | Gordon House | Barrow Street | Dublin 4 | Ireland
Registered in Dublin, Ireland | Registration Number: 368047

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: apply.patch --]
[-- Type: text/x-diff; name=apply.patch, Size: 2613 bytes --]

diff --git a/gcc/passes.c b/gcc/passes.c
index 8fb3ca5..730cf76 100644
--- a/gcc/passes.c
+++ b/gcc/passes.c
@@ -1233,19 +1233,9 @@ execute_one_ipa_transform_pass (struct cgraph_node *node,
   current_pass = NULL;
 }
 
-static bool
-execute_one_pass (struct opt_pass *pass)
+void
+execute_all_ipa_transforms (void)
 {
-  bool initializing_dump;
-  unsigned int todo_after = 0;
-
-  /* IPA passes are executed on whole program, so cfun should be NULL.
-     Other passes need function context set.  */
-  if (pass->type == SIMPLE_IPA_PASS || pass->type == IPA_PASS)
-    gcc_assert (!cfun && !current_function_decl);
-  else
-    gcc_assert (cfun && current_function_decl);
-
   if (cfun && cfun->ipa_transforms_to_apply)
     {
       unsigned int i;
@@ -1254,12 +1244,26 @@ execute_one_pass (struct opt_pass *pass)
       for (i = 0; i < VEC_length (ipa_opt_pass, cfun->ipa_transforms_to_apply);
 	   i++)
 	execute_one_ipa_transform_pass (node,
-				        VEC_index (ipa_opt_pass,
+					VEC_index (ipa_opt_pass,
 						   cfun->ipa_transforms_to_apply,
 						   i));
       VEC_free (ipa_opt_pass, heap, cfun->ipa_transforms_to_apply);
       cfun->ipa_transforms_to_apply = NULL;
     }
+}
+
+static bool
+execute_one_pass (struct opt_pass *pass)
+{
+  bool initializing_dump;
+  unsigned int todo_after = 0;
+
+  /* IPA passes are executed on whole program, so cfun should be NULL.
+     Other passes need function context set.  */
+  if (pass->type == SIMPLE_IPA_PASS || pass->type == IPA_PASS)
+    gcc_assert (!cfun && !current_function_decl);
+  else
+    gcc_assert (cfun && current_function_decl);
 
   current_pass = pass;
 
diff --git a/gcc/tree-optimize.c b/gcc/tree-optimize.c
index ea12dda..18ccf21 100644
--- a/gcc/tree-optimize.c
+++ b/gcc/tree-optimize.c
@@ -414,6 +414,10 @@ tree_rest_of_compilation (tree fndecl)
   gimple_register_cfg_hooks ();
 
   bitmap_obstack_initialize (&reg_obstack); /* FIXME, only at RTL generation*/
+
+
+  execute_all_ipa_transforms ();
+
   /* Perform all tree transforms and optimizations.  */
   execute_pass_list (all_passes);
   
diff --git a/gcc/tree-pass.h b/gcc/tree-pass.h
index f4caffd..d49708b 100644
--- a/gcc/tree-pass.h
+++ b/gcc/tree-pass.h
@@ -532,6 +532,8 @@ extern struct opt_pass * get_pass_for_id (int);
 extern void execute_pass_list (struct opt_pass *);
 extern void execute_ipa_pass_list (struct opt_pass *);
 extern void execute_regular_ipa_pass_list (struct opt_pass *);
+extern void execute_all_ipa_transforms (void);
+
 extern void print_current_pass (FILE *);
 extern void debug_pass (void);
 extern void ipa_write_summaries (void);

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [lto][patch] Move calls to execute_one_ipa_transform_pass
  2008-10-22 20:19 [lto][patch] Move calls to execute_one_ipa_transform_pass Rafael Espindola
@ 2008-10-22 20:46 ` Diego Novillo
  0 siblings, 0 replies; 2+ messages in thread
From: Diego Novillo @ 2008-10-22 20:46 UTC (permalink / raw)
  To: Rafael Espindola; +Cc: gcc-patches

On Wed, Oct 22, 2008 at 14:54, Rafael Espindola <espindola@google.com> wrote:
> 2008-10-22 Rafael Espindola  <espindola@google.com>
>
>        * passes.c (execute_all_ipa_transforms): New.
>        (execute_one_pass): Don't call execute_one_ipa_transform_pass.
>        * tree-optimize.c (tree_rest_of_compilation): Call
>        execute_all_ipa_transforms.
>        * tree-pass.h (execute_all_ipa_transforms): New.

> +}
> +
> +static bool
> +execute_one_pass (struct opt_pass *pass)
> +{

Since you're here, could you add a comment?

OK otherwise.


Diego.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2008-10-22 19:41 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-10-22 20:19 [lto][patch] Move calls to execute_one_ipa_transform_pass Rafael Espindola
2008-10-22 20:46 ` Diego Novillo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).