diff options
author | Jan Hubicka <jh@suse.cz> | 2007-02-09 23:49:30 +0100 |
---|---|---|
committer | Jan Hubicka <hubicka@gcc.gnu.org> | 2007-02-09 22:49:30 +0000 |
commit | 45a80bb9e800503749c797d4c57a4b6829ca9bf7 (patch) | |
tree | dd0cf0d6f5ee79e534f85b6bf4b3b2f75372bd8c /gcc/cgraph.h | |
parent | f2477b062c9c639e5354ef705022a47dcb61e213 (diff) | |
download | gcc-45a80bb9e800503749c797d4c57a4b6829ca9bf7.zip gcc-45a80bb9e800503749c797d4c57a4b6829ca9bf7.tar.gz gcc-45a80bb9e800503749c797d4c57a4b6829ca9bf7.tar.bz2 |
Makefile.in (passes.o, [...]): Add dependencies.
* Makefile.in (passes.o, ipa-inline.o): Add dependencies.
* cgraphbuild.c (build_cgraph_edges): Compute frequencies.
(rebuild_cgraph_edges): Likewise.
* cgraph.c (cgraph_set_call_stmt): Add new argument frequency.
(dump_cgraph_node): Dump frequencies.
(cgraph_clone_edge): Add frequency scales.
(cgraph_clone_node): Add freuqnecy.
* cgraph.h (cgraph_edge): Add freuqnecy argument.
(CGRAPH_FREQ_BASE, CGRAPH_FREQ_MAX): New constants.
(cgraph_create_edge, cgraph_clone_edge, cgraph_clone_node): Update.
* tree-pass.h (TODO_rebuild_frequencies): New constant.
* cgraphunit.c (verify_cgraph_node): Verify frequencies.
(cgraph_copy_node_for_versioning): Update call of cgraph_clone_edge.
(save_inline_function_body): Likewise.
* ipa-inline.c: inluce rtl.h
(cgraph_clone_inlined_nods): Update call of cgraph_clone_node.
(cgraph_edge_badness): Use frequencies.
(cgraph_decide_recursive_inlining): Update clonning.
(cgraph_decide_inlining_of_small_function): Dump frequency.
* predict.c (estimate_bb_frequencies): Export.
* predict.h (estimate_bb_frequencies): Declare.
* tree-inline.c (copy_bb): Watch overflows.
(expand_call_inline): Update call of cgraph_create_edge.
(optimize_inline_calls): Use TODO flags to update frequnecies.
* passes.h: Include predict.h
(init_optimization_passes): Move profile ahead.
(execute_function_todo): Handle TODO_rebuild_frequencies.
From-SVN: r121780
Diffstat (limited to 'gcc/cgraph.h')
-rw-r--r-- | gcc/cgraph.h | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/gcc/cgraph.h b/gcc/cgraph.h index 179a5f1..b905bfd 100644 --- a/gcc/cgraph.h +++ b/gcc/cgraph.h @@ -201,10 +201,17 @@ struct cgraph_edge GTY((chain_next ("%h.next_caller"), chain_prev ("%h.prev_call const char *inline_failed; /* Expected number of executions: calculated in profile.c. */ gcov_type count; + /* Expected frequency of executions within the function. + When set to CGRAPH_FREQ_BASE, the edge is expected to be called once + per function call. The range is 0 to CGRAPH_FREQ_MAX. */ + int frequency; /* Depth of loop nest, 1 means no loop nest. */ int loop_nest; }; +#define CGRAPH_FREQ_BASE 1000 +#define CGRAPH_FREQ_MAX 100000 + typedef struct cgraph_edge *cgraph_edge_p; DEF_VEC_P(cgraph_edge_p); @@ -290,7 +297,7 @@ void cgraph_release_function_body (struct cgraph_node *); void cgraph_node_remove_callees (struct cgraph_node *node); struct cgraph_edge *cgraph_create_edge (struct cgraph_node *, struct cgraph_node *, - tree, gcov_type, int); + tree, gcov_type, int, int); struct cgraph_node *cgraph_node (tree); struct cgraph_node *cgraph_node_for_asm (tree asmname); struct cgraph_edge *cgraph_edge (struct cgraph_node *, tree); @@ -301,8 +308,8 @@ struct cgraph_rtl_info *cgraph_rtl_info (tree); const char * cgraph_node_name (struct cgraph_node *); struct cgraph_edge * cgraph_clone_edge (struct cgraph_edge *, struct cgraph_node *, - tree, gcov_type, int, bool); -struct cgraph_node * cgraph_clone_node (struct cgraph_node *, gcov_type, + tree, gcov_type, int, int, bool); +struct cgraph_node * cgraph_clone_node (struct cgraph_node *, gcov_type, int, int, bool); void cgraph_redirect_edge_callee (struct cgraph_edge *, struct cgraph_node *); |