diff options
author | hubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4> | 2010-05-12 21:32:59 +0000 |
---|---|---|
committer | hubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4> | 2010-05-12 21:32:59 +0000 |
commit | f8b7e3ec43723c9f6bd4213794a33d6c57046103 (patch) | |
tree | d7aef00d4cbf971dd328d8e3e60c9fd6278373a2 /gcc/cgraphbuild.c | |
parent | a5b022e7af7b70507d5e5d54eef6cb0621399607 (diff) | |
download | gcc-f8b7e3ec43723c9f6bd4213794a33d6c57046103.tar.gz |
* cgraphbuild.c (build_cgraph_edges, rebuild_cgraph_edges): Build
indrect edges too.
* cgraph.c (cgraph_create_indirect_edge): Take ecf_flags argument.
(cgraph_clone_edge): Update.
(cgraph_node_remove_callees): Remove indirect calls too.
* cgraph.h (cgraph_indirect_call_info): Add ecf_flags.
(cgraph_create_indirect_edge): Update prototype.
* ipa-reference.c (has_proper_scope_for_analysis): Rename to
is_proper_for_analysis.
(add_new_function, visited_nodes, function_insertion_hook_holder,
get_local_reference_vars_info, mark_address_taken, mark_address,
mark_load, mark_store, check_asm_memory_clobber, check_call,
scan_stmt_for_static_refs, scan_initializer_for_static_refs): Remove.
(ipa_init): Do not initialize visited_nodes;
function_insertion_hook_holder.
(analyze_variable): Rewrite.
(analyze_function): Rewrite.
(copy_local_bitmap): Remove.
(duplicate_node_dat): Do not duplicate local info.
(generate_summary): Simplify to only walk cgraph.
(write_node_summary_p, ipa_reference_write_summary,
ipa_reference_read_summary): Remove.
(propagate): Do not remove function insertion;
generate summary.
(pass_ipa_reference): NULLify summary handling fields.
* lto-cgraph.c (lto_output_edge): Output ecf_flags.
(input_edge): Input ecf_flags.
* ipa-prop.c (ipa_note_parm_call): Expect edge to be around.
(update_indirect_edges_after_inlining): Ignore edges with unknown
param.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@159343 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cgraphbuild.c')
-rw-r--r-- | gcc/cgraphbuild.c | 42 |
1 files changed, 30 insertions, 12 deletions
diff --git a/gcc/cgraphbuild.c b/gcc/cgraphbuild.c index b09963d1c04..c63b5afc81c 100644 --- a/gcc/cgraphbuild.c +++ b/gcc/cgraphbuild.c @@ -339,12 +339,21 @@ build_cgraph_edges (void) gimple stmt = gsi_stmt (gsi); tree decl; - if (is_gimple_call (stmt) && (decl = gimple_call_fndecl (stmt))) - cgraph_create_edge (node, cgraph_node (decl), stmt, - bb->count, - compute_call_stmt_bb_frequency - (current_function_decl, bb), - bb->loop_depth); + if (is_gimple_call (stmt)) + { + int freq = compute_call_stmt_bb_frequency (current_function_decl, + bb); + decl = gimple_call_fndecl (stmt); + if (decl) + cgraph_create_edge (node, cgraph_node (decl), stmt, + bb->count, freq, + bb->loop_depth); + else + cgraph_create_indirect_edge (node, stmt, + gimple_call_flags (stmt), + bb->count, freq, + bb->loop_depth); + } walk_stmt_load_store_addr_ops (stmt, node, mark_load, mark_store, mark_address); if (gimple_code (stmt) == GIMPLE_OMP_PARALLEL @@ -443,12 +452,21 @@ rebuild_cgraph_edges (void) gimple stmt = gsi_stmt (gsi); tree decl; - if (is_gimple_call (stmt) && (decl = gimple_call_fndecl (stmt))) - cgraph_create_edge (node, cgraph_node (decl), stmt, - bb->count, - compute_call_stmt_bb_frequency - (current_function_decl, bb), - bb->loop_depth); + if (is_gimple_call (stmt)) + { + int freq = compute_call_stmt_bb_frequency (current_function_decl, + bb); + decl = gimple_call_fndecl (stmt); + if (decl) + cgraph_create_edge (node, cgraph_node (decl), stmt, + bb->count, freq, + bb->loop_depth); + else + cgraph_create_indirect_edge (node, stmt, + gimple_call_flags (stmt), + bb->count, freq, + bb->loop_depth); + } walk_stmt_load_store_addr_ops (stmt, node, mark_load, mark_store, mark_address); |