This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Allow passmanager to switch between IPA and local passes


> On Fri, Jun 17, 2005 at 11:13:01AM +0200, Jan Hubicka wrote:
> > Hmm, I guess I get it.  You want me to have separate
> > execute_ipa_pass_list that will do the same as execute_pass_list
> > and will be called from ipa_passes, right?
> 
> Yes.  There appears to be more different than the same 
> between the two operations.

Well, we might end up doing both execute_ipa_pass_list (simple recursion
or walk of all nodes and call to execute_pass_list if we will get
subpasses of IPA passes eventually), but it is definitly better
bookkeeping tham the cfun hack I had.
Does this look fine?

2005-06-17  Jan Hubicka  <jh@suse.cz>
	* tree-optimize.c (execute_ipa_pass_list): New.
	(ipa_passes): Use it.
Index: tree-optimize.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/tree-optimize.c,v
retrieving revision 2.107
diff -c -3 -p -r2.107 tree-optimize.c
*** tree-optimize.c	9 Jun 2005 13:05:36 -0000	2.107
--- tree-optimize.c	17 Jun 2005 09:16:30 -0000
*************** execute_pass_list (struct tree_opt_pass 
*** 665,671 ****
    do
      {
        if (execute_one_pass (pass) && pass->sub)
! 	execute_pass_list (pass->sub);
        pass = pass->next;
      }
    while (pass);
--- 664,698 ----
    do
      {
        if (execute_one_pass (pass) && pass->sub)
!         execute_pass_list (pass->sub);
!       pass = pass->next;
!     }
!   while (pass);
! }
! 
! /* Same as execute_pass_list but assume that subpasses of IPA passes
!    are local passes.  */
! static void
! execute_ipa_pass_list (struct tree_opt_pass *pass)
! {
!   do
!     {
!       if (execute_one_pass (pass) && pass->sub)
! 	{
! 	  struct cgraph_node *node;
! 	  for (node = cgraph_nodes; node; node = node->next)
! 	    if (node->analyzed)
! 	      {
! 		push_cfun (DECL_STRUCT_FUNCTION (node->decl));
! 		current_function_decl = node->decl;
! 		execute_pass_list (pass);
! 		free_dominance_info (CDI_DOMINATORS);
! 		free_dominance_info (CDI_POST_DOMINATORS);
! 		current_function_decl = NULL;
! 		pop_cfun ();
! 		ggc_collect ();
! 	      }
! 	}
        pass = pass->next;
      }
    while (pass);
*************** tree_lowering_passes (tree fn)
*** 692,699 ****
  void
  ipa_passes (void)
  {
    bitmap_obstack_initialize (NULL);
!   execute_pass_list (all_ipa_passes);
    bitmap_obstack_release (NULL);
  }
  
--- 719,728 ----
  void
  ipa_passes (void)
  {
+   cfun = NULL;
+   tree_register_cfg_hooks ();
    bitmap_obstack_initialize (NULL);
!   execute_ipa_pass_list (all_ipa_passes);
    bitmap_obstack_release (NULL);
  }
  


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]