This is the mail archive of the 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: [tree-ssa]: PATCH: hookize profiling

On Feb 12, 2004, at 12:58 AM, Jan Hubicka wrote:
On Feb 11, 2004, at 3:28 PM, Jan Hubicka wrote:
 /* Initialization of functions specific to the rtl IR.  */
*************** void
*** 45,50 ****
--- 48,55 ----
 cfg_layout_rtl_register_cfg_hooks (void)
   cfg_hooks = &cfg_layout_rtl_cfg_hooks;
+   rtl_register_value_prof_hooks ();
+   rtl_register_profile_hooks ();

If we move into multiple CFGs at a time, we will have each CFG object to have local copy of hook pointers, so I would rather not add new ones. I think it would be better to simply register these hooks just before profiling code is called in rest_of_handle_* and branch_prob.

I thought about this, the trouble is that the profiling code calls into
CFG manipulation code in a number of places, and that is sensitive
to the setting of the cfg_hooks. (It also references ir_type directly,

Yes, you need to have right set of hooks depending on IR type you are operating on. Since profiling code is called just from two places (and we should not need to add more entry points), I don't quite see how it can bring problems. In the case we want to keep the modules at least partly separated, I would preffer instrumentation code to use CFG API, but not vice versa.

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
about this: I put the profiling hook registration where you suggest, and
have it call the cfg hook registration. Does that work for you?

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