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: IPA merge 3: passmanager tweeks


> Jan Hubicka wrote on 12/02/06 09:50:
> 
> >This patch also makes working stuff like TODO_dump_function at the end of 
> >IPA
> >pass and hopefully brings us closer to plan of using pass manager instead 
> >of
> >all the current funny interaction in between cgraphunit, passes and
> >tree-optimize.
> >
> Yes, that's sorely needed.

Ineed it is.  The most ugly part of the whole thing is that we still
need the expand_function hook.  This is used (probably among others)
by C++ frontend to produce thunks. Other related major issue is that
inliner is called by C++ clonning code.
I tried to cleanup this at least twice, once by forcing gimplification
early within the frontend and doing clonning at gimple level that failed
by ugly iteractions (but should be doable with above changes to PM a lot
easier now) second time by tring to turn this into inlining that sort of
failed for variadic constructors.

While problems above can definitly be solved that way, just would need
more care, what about trying to bite the bullet and implement the
multiple entry point stuff?

In the past part of that work was done by RH I believe for aligned x86
stack frames, I rescuresced part of it for x86 PIC GOT pointer loading
code optimization (so function would have alternative entry point
assuming that GOT pointer is already load).  If there is interest, I can
try to update that patches and see how far we can get.
The x86 PIC GOT pointer stuff is interesting optimization at it's own
anyway.

Thanks a lot for review!
Honza
> 
> >Bootstrapped/regtested i686-linux, OK?
> >
> >	* omp-low.c (expand_omp_parallel): Set function properties.
> >	* function.h (struct function): Add curr_properties and 
> >	last_verified.
> >	* passes.c (register_dump_files): Do not set TODO_set_props for the
> >	first pass
> >	(init_optimization_passes): Set it here; reorder initialization so 
> >	the
> >	dump files appear in more logic order.
> s/logic/logical/
> 
> >	(last_verified, curr_properties): Kill.
> >	(do_per_function): New function.
> >	(execute_function_todo): Break out from ...
> >	(execute_todo): ... here; handle per-function flags.
> >	(clear_last_verified, verify_curr_properties,
> >	update_properties_after_pass): New functions.
> >	(execute_one_pass): Handle per-function properties.
> >	(execute_ipa_pass_list): Use do_per_function; sanity check that cfun
> >	and current_function_decls are cleared out.
> >	* ipa-cp.c (constant_val_insert): Clear cfun/current_function_decl
> >	after use.
> >        cgraph_add_new_function (child_fn);
> >
> OK, with some revisions.
> 
> >+   /* Properties used by the passmanager.  */
> s/passmanager/pass manager/
> 
> >! /* Call CALLBACK for every function if current function is not set
> >!    (ie we do IPA) and for current function otehrwise.  */
> >
> Rephrase.  Maybe
> 
> /* If we are in IPA mode (i.e., current_function_decl is NULL), call
>   function CALLBACK for every function in the call graph.  Otherwise,
>   call CALLBACK on the current function.  */
> 
> >! /* Perform all TODO actions that ought to be done at function basis.  */
> >! static void
> >
> Vertical spacing after comment.  What did you mean with 'at function
> basis'?  Did you mean 'on every function'?
> 
> >! /* Clear the last verified flag.  */
> >! static void
> >
> Vertical spacing after comment.
> 
> >! clear_last_verified (void *data ATTRIBUTE_UNUSED)
> >! {
> >!   cfun->last_verified = 0;
> >! }
> >  
> >! /* Helper function. Verify that the properties has been turn into the
> >!    properties expected by the pass.  */
> >! static void
> >
> Likewise.
> 
> >! /* After executing the pass, apply expected changes to the function 
> >properties.
> >!    */
> >
> Watch wrapping.


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