diff options
author | Tomas Bily <tbily@suse.cz> | 2007-01-19 19:34:02 +0100 |
---|---|---|
committer | Jan Hubicka <hubicka@gcc.gnu.org> | 2007-01-19 18:34:02 +0000 |
commit | 6bad26173df0462c3d7391d58d55fa132bb44102 (patch) | |
tree | 41def031b05732ddcfbc26eac41ed55f2a54dc07 /gcc/cgraph.c | |
parent | b7c75af4b5b275047cb622ae85f98839cf6299a1 (diff) | |
download | gcc-6bad26173df0462c3d7391d58d55fa132bb44102.zip gcc-6bad26173df0462c3d7391d58d55fa132bb44102.tar.gz gcc-6bad26173df0462c3d7391d58d55fa132bb44102.tar.bz2 |
Patch by Tomas Bily <tbily@suse.cz>
Patch by Tomas Bily <tbily@suse.cz>
* cgraphunit.c (cgraph_finalize_function): Updating of pid
* tree-profile.c:
(tree_init_ic_make_global_vars): New function
(tree_init_edge_profiler): call of tree_init_ic_make_global_vars
(tree_gen_ic_profiler): New function
(tree_gen_ic_func_profiler): New function
(tree_profiling): Added calling of tree_gen_ic_func_profiler
(tree_profile_hooks): Added hook for indirec/virtual calls
* value-prof.c (tree_find_values_to_profile): New case for
indirect calls
(tree_values_to_profile): Call for determining indirect/virtual
counters
(tree_indirect_call_to_profile): New function
(tree_ic_transform): New function
(tree_ic): New function
(find_func_by_pid): New function
(init_pid_map): New function
(tree_value_profile_transformations): Added check for
indirect/virtual call transformation
* value-prof.h (enum hist_type): New counter type for
indirect/virtual calls
(profile_hooks): Added new hook for profiling indirect/virtual
calls
* profile.c (instrument_values): New case for indirect/virtual
call added
* gcov-io.h (GCOV_LAST_VALUE_COUNTER): Changed to 6
(GCOV_COUNTER_V_INDIR): New counter type
(GCOV_COUNTER_NAMES): New name of counter "indirect" added
(GCOV_MERGE_FUNCTIONS): New merge function for indirect/virtual
call added
* cgraph.c: Definition of cgraph_max_pid
(cgraph_create_node): Default init of pid attribute
* cgraph.h: Declaration of cgraph_max_pid
(struct cgraph_node): Added pid attribute
* libgcov.c (__gcov_indirect_call_profiler): New function
(__gcov_one_value_profiler_body): New function
(__gcov_one_value_profiler): Body was moved to
__gcov_one_value_profiler_body and calls it
gcc.dg/tree-prof/indir-call-prof.c: New.
g++.dg/dg.exp: Add tree-prof subdirectory.
g++.dg/tree-prof/indir-call-prof.C: New.
g++.dg/tree-prof/tree-prof.exp: New.
From-SVN: r120975
Diffstat (limited to 'gcc/cgraph.c')
-rw-r--r-- | gcc/cgraph.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/gcc/cgraph.c b/gcc/cgraph.c index 1f7f0ad..13b7fcd 100644 --- a/gcc/cgraph.c +++ b/gcc/cgraph.c @@ -109,6 +109,9 @@ int cgraph_n_nodes; /* Maximal uid used in cgraph nodes. */ int cgraph_max_uid; +/* Maximal pid used for profiling */ +int cgraph_max_pid; + /* Set when whole unit has been analyzed so we can access global info. */ bool cgraph_global_info_ready = false; @@ -161,6 +164,7 @@ cgraph_create_node (void) node = GGC_CNEW (struct cgraph_node); node->next = cgraph_nodes; node->uid = cgraph_max_uid++; + node->pid = -1; node->order = cgraph_order++; if (cgraph_nodes) cgraph_nodes->previous = node; @@ -655,7 +659,7 @@ void dump_cgraph_node (FILE *f, struct cgraph_node *node) { struct cgraph_edge *edge; - fprintf (f, "%s/%i:", cgraph_node_name (node), node->uid); + fprintf (f, "%s/%i(%i):", cgraph_node_name (node), node->uid, node->pid); if (node->global.inlined_to) fprintf (f, " (inline copy in %s/%i)", cgraph_node_name (node->global.inlined_to), |