diff options
author | matz <matz@138bc75d-0d04-0410-961f-82ee72b054a4> | 2011-04-03 11:21:06 +0000 |
---|---|---|
committer | matz <matz@138bc75d-0d04-0410-961f-82ee72b054a4> | 2011-04-03 11:21:06 +0000 |
commit | 5cd33168f40b65c96dfa1769c689ba65000f1c1d (patch) | |
tree | 1e63a8bdd37fbff2c65aec3206ef1005c2481cd1 /gcc/ipa-inline.c | |
parent | a464988454e792146712dbdfd91047c94dcc5cca (diff) | |
download | gcc-5cd33168f40b65c96dfa1769c689ba65000f1c1d.tar.gz |
* lto-streamer.h (struct lto_streamer_cache_d): Remove offsets
and next_slot members.
(lto_streamer_cache_insert, lto_streamer_cache_insert_at,
lto_streamer_cache_lookup, lto_streamer_cache_get): Adjust prototypes.
(lto_streamer_cache_append): Declare.
* lto-streamer.c (lto_streamer_cache_add_to_node_array): Use
unsigned index, remove offset parameter, ensure that we append
or update existing entries.
(lto_streamer_cache_insert_1): Use unsigned index, remove offset_p
parameter, update next_slot for append.
(lto_streamer_cache_insert): Use unsigned index, remove offset_p
parameter.
(lto_streamer_cache_insert_at): Likewise.
(lto_streamer_cache_append): New function.
(lto_streamer_cache_lookup): Use unsigned index.
(lto_streamer_cache_get): Likewise.
(lto_record_common_node): Don't test tree_node_can_be_shared.
(preload_common_node): Adjust call to lto_streamer_cache_insert.
(lto_streamer_cache_delete): Don't free offsets member.
* lto-streamer-out.c (eq_string_slot_node): Use memcmp.
(lto_output_string_with_length): Use lto_output_data_stream.
(lto_output_tree_header): Remove ix parameter, don't write it.
(lto_output_builtin_tree): Likewise.
(lto_write_tree): Adjust callers to above, don't track and write
offset, write unsigned index.
(output_unreferenced_globals): Don't emit all global vars.
(write_global_references): Use unsigned indices.
(lto_output_decl_state_refs): Likewise.
(write_symbol): Likewise.
* lto-streamer-in.c (lto_input_chain): Move earlier.
(input_function): Use unsigned index.
(input_alias_pairs): Don't read and then ignore all global vars.
(lto_materialize_tree): Remove ix_p parameter, don't read index,
don't pass it back, use lto_streamer_cache_append.
(lto_register_var_decl_in_symtab): Use unsigned index.
(lto_register_function_decl_in_symtab): Likewise.
(lto_get_pickled_tree): Don't read in or handle offset, read unsigned
index.
(lto_get_builtin_tree): Don't read index, use
lto_streamer_cache_append.
(lto_read_tree): Adjust call to lto_materialize_tree.
* ipa-inline.c (cgraph_edge_badness): Move growth calculaton,
don't use function calls in arguments to MIN.
* varasm.c (decl_binds_to_current_def_p): Don't check TREE_PUBLIC
twice.
* gimple.c (gimple_type_leader_entry): Mark deletable.
lto/
* lto.c (lto_materialize_function): Don't read and then discard
sections in WPA mode.
(lto_read_in_decl_state): Adjust call to lto_streamer_cache_get.
* lto-lang.c (registered_builtin_fndecls): Remove.
(lto_getdecls): Return NULL_TREE.
(lto_builtin_function): Don't remember in registered_builtin_fndecls.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@171906 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ipa-inline.c')
-rw-r--r-- | gcc/ipa-inline.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/gcc/ipa-inline.c b/gcc/ipa-inline.c index 7ae5f96dc7c..77ab17e64e5 100644 --- a/gcc/ipa-inline.c +++ b/gcc/ipa-inline.c @@ -519,13 +519,15 @@ static int cgraph_edge_badness (struct cgraph_edge *edge, bool dump) { gcov_type badness; - int growth = - (cgraph_estimate_size_after_inlining (edge->caller, edge->callee) - - edge->caller->global.size); + int growth; if (edge->callee->local.disregard_inline_limits) return INT_MIN; + growth = + (cgraph_estimate_size_after_inlining (edge->caller, edge->callee) + - edge->caller->global.size); + if (dump) { fprintf (dump_file, " Badness calculation for %s -> %s\n", @@ -584,11 +586,11 @@ cgraph_edge_badness (struct cgraph_edge *edge, bool dump) int growth_for_all; badness = growth * 10000; benefitperc = - MIN (100 * inline_summary (edge->callee)->time_inlining_benefit / - (edge->callee->global.time + 1) +1, 100); + 100 * inline_summary (edge->callee)->time_inlining_benefit + / (edge->callee->global.time + 1) +1; + benefitperc = MIN (benefitperc, 100); div *= benefitperc; - /* Decrease badness if call is nested. */ /* Compress the range so we don't overflow. */ if (div > 10000) |