This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [tree-ssa]: PATCH: hookize profiling
>
> On Feb 12, 2004, at 10:53 AM, Jan Hubicka wrote:
>
> >>>We can just invent rtl_register_hooks, cfg_register_hooks that will
> >>>call
> >>>all three functions, but I don't see how much it will buy us and it
> >>>will
> >>>make it neccesary to store all three pointers in the CFG structure.
> >>>Also the CFG expansion code is switching the hooks back and forth so
> >>>it
> >>>is better to not make it more expensive. (but none of these is big
> >>>deal
> >>>either, so if you see some stronger argument other way, just tell :)
> >>
> >>The profiling hooks and cfg hooks are not really independent; things
> >>don't
> >>work if the setting don't match. So it seems to me that being able to
> >>set
> >>them independently can only introduce bugs, not help anything. How
> >
> >I am mostly concerned about the interfaces. I don't quite like the
> >idea
> >of exposing something internal to profiler to cfg code.
> >It also save some memory if we move to the multiple cfgs existing at
> >once. None of these are big deals tought. Whats about ...
> >>about this: I put the profiling hook registration where you suggest,
> >>and
> >>have it call the cfg hook registration. Does that work for you?
> >
> >Perhaps you can just add an sanity check to the registering function
> >ensuring that the cfghooks are set the right way.
> >That would ensure that hooks are right and calling tree pass with RTL
> >hooks or RTL pass with SSA hooks is crazy idea anyway.
>
> That sounds reasonable. OK, here is a revised version. I haven't
> fixed the
> ChangeLog entry yet but I think this has everything else.
The patch looks fine now except...
> Index: cfghooks.c
> ===================================================================
> RCS file: /cvs/gcc/gcc/gcc/cfghooks.c,v
> retrieving revision 1.1.2.8
> diff -u -d -b -w -c -3 -p -r1.1.2.8 cfghooks.c
> *** cfghooks.c 18 Jan 2004 00:13:26 -0000 1.1.2.8
> --- cfghooks.c 12 Feb 2004 21:42:32 -0000
> *************** Boston, MA 02111-1307, USA. */
> *** 29,34 ****
> --- 29,35 ----
> #include "tree-flow.h"
> #include "timevar.h"
> #include "toplev.h"
> + #include "value-prof.h"
I believe you can drop this include.
Thank you!
Honza