From 6bad26173df0462c3d7391d58d55fa132bb44102 Mon Sep 17 00:00:00 2001 From: Tomas Bily Date: Fri, 19 Jan 2007 19:34:02 +0100 Subject: Patch by Tomas Bily Patch by Tomas Bily * 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 --- gcc/value-prof.h | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'gcc/value-prof.h') diff --git a/gcc/value-prof.h b/gcc/value-prof.h index 33670da..78c9e88 100644 --- a/gcc/value-prof.h +++ b/gcc/value-prof.h @@ -29,8 +29,10 @@ enum hist_type HIST_TYPE_POW2, /* Histogram of power of 2 values. */ HIST_TYPE_SINGLE_VALUE, /* Tries to identify the value that is (almost) always constant. */ - HIST_TYPE_CONST_DELTA /* Tries to identify the (almost) always constant + HIST_TYPE_CONST_DELTA, /* Tries to identify the (almost) always constant difference between two evaluations of a value. */ + HIST_TYPE_INDIR_CALL /* Tries to identify the function that is (almost) + called in indirect call */ }; #define COUNTER_FOR_HIST_TYPE(TYPE) ((int) (TYPE) + GCOV_FIRST_VALUE_COUNTER) @@ -94,6 +96,9 @@ struct profile_hooks { /* Insert code to find the most common value of a difference between two evaluations of an expression. */ void (*gen_const_delta_profiler) (histogram_value, unsigned, unsigned); + + /* Insert code to find the most common indirect call */ + void (*gen_ic_profiler) (histogram_value, unsigned, unsigned); }; histogram_value gimple_histogram_value (struct function *, tree); -- cgit v1.1