summaryrefslogtreecommitdiff
path: root/gcc/cgraphunit.c
diff options
context:
space:
mode:
authorJan Hubicka <jh@suse.cz>2007-02-09 23:49:30 +0100
committerJan Hubicka <hubicka@gcc.gnu.org>2007-02-09 22:49:30 +0000
commit45a80bb9e800503749c797d4c57a4b6829ca9bf7 (patch)
treedd0cf0d6f5ee79e534f85b6bf4b3b2f75372bd8c /gcc/cgraphunit.c
parentf2477b062c9c639e5354ef705022a47dcb61e213 (diff)
downloadgcc-45a80bb9e800503749c797d4c57a4b6829ca9bf7.tar.gz
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/cgraphunit.c')
-rw-r--r--gcc/cgraphunit.c16
1 files changed, 14 insertions, 2 deletions
diff --git a/gcc/cgraphunit.c b/gcc/cgraphunit.c
index 892e952e238..2d1ecda64ac 100644
--- a/gcc/cgraphunit.c
+++ b/gcc/cgraphunit.c
@@ -519,6 +519,16 @@ verify_cgraph_node (struct cgraph_node *node)
error ("caller edge count is negative");
error_found = true;
}
+ if (e->frequency < 0)
+ {
+ error ("caller edge frequency is negative");
+ error_found = true;
+ }
+ if (e->frequency > CGRAPH_FREQ_MAX)
+ {
+ error ("caller edge frequency is too large");
+ error_found = true;
+ }
if (!e->inline_failed)
{
if (node->global.inlined_to
@@ -1412,7 +1422,8 @@ cgraph_copy_node_for_versioning (struct cgraph_node *old_version,
also cloned. */
for (e = old_version->callees;e; e=e->next_callee)
{
- new_e = cgraph_clone_edge (e, new_version, e->call_stmt, 0, e->loop_nest, true);
+ new_e = cgraph_clone_edge (e, new_version, e->call_stmt, 0, e->frequency,
+ e->loop_nest, true);
new_e->count = e->count;
}
/* Fix recursive calls.
@@ -1511,7 +1522,8 @@ save_inline_function_body (struct cgraph_node *node)
{
struct cgraph_edge *e;
- first_clone = cgraph_clone_node (node, node->count, 0, false);
+ first_clone = cgraph_clone_node (node, node->count, 0, CGRAPH_FREQ_BASE,
+ false);
first_clone->needed = 0;
first_clone->reachable = 1;
/* Recursively clone all bodies. */