Commit 10a5dd5d by Jan Hubicka Committed by Jan Hubicka

cgraph.c (dump_cgraph_node): Do not dump inline summaries.


	* cgraph.c (dump_cgraph_node): Do not dump inline summaries.
	* cgraph.h (struct inline_summary): Move to ipa-inline.h
	(cgraph_local_info): Remove inline_summary.
	* ipa-cp.c: Include ipa-inline.h.
	(ipcp_cloning_candidate_p, ipcp_estimate_growth,
	ipcp_estimate_cloning_cost, ipcp_insert_stage): Use inline_summary
	accesor.
	* lto-cgraph.c (lto_output_node): Do not stream inline summary.
	(input_overwrite_node): Do not set inline summary.
	(input_node): Do not stream inline summary.
	* ipa-inline.c (cgraph_decide_inlining): Dump inline summaries.
	(cgraph_decide_inlining_incrementally): Do not try to estimate overall
	growth; we do not have inline parameters computed for that anyway.
	(cgraph_early_inlining): After inlining compute call_stmt_sizes.
	* ipa-inline.h (struct inline_summary): Move here from ipa-inline.h
	(inline_summary_t): New type and VECtor.
	(debug_inline_summary, dump_inline_summaries): Declare.
	(inline_summary): Use VOCtor.
	(estimate_edge_growth): Kill hack computing call stmt size directly.
	* lto-section-in.c (lto_section_name): Add inline section.
	* ipa-inline-analysis.c: Include lto-streamer.h
	(node_removal_hook_holder, node_duplication_hook_holder): New holders
	(inline_node_removal_hook, inline_node_duplication_hook): New functions.
	(inline_summary_vec): Define.
	(inline_summary_alloc, dump_inline_summary, debug_inline_summary,
	dump_inline_summaries): New functions.
	(estimate_function_body_sizes): Properly compute size/time of outgoing calls.
	(compute_inline_parameters): Alloc inline_summary; do not compute size/time
	of incomming calls.
	(estimate_edge_time): Avoid missing time summary hack.
	(inline_read_summary): Read inline summary info.
	(inline_write_summary): Write inline summary info.
	(inline_free_summary): Free all hooks and inline summary vector.
	* lto-streamer.h: Add LTO_section_inline_summary section.
	* Makefile.in (ipa-cp.o, ipa-inline-analysis.o): Update dependencies.
	* ipa.c (cgraph_remove_unreachable_nodes): Fix dump file formating.

	* lto.c: Include ipa-inline.h
	(add_cgraph_node_to_partition, undo_partition): Use inline_summary accessor.
	(ipa_node_duplication_hook): Fix declaration.
	* Make-lang.in (lto.o): Update dependencies.

From-SVN: r172430
parent b602d918
2011-04-14 Jan Hubicka <jh@suse.cz>
* cgraph.c (dump_cgraph_node): Do not dump inline summaries.
* cgraph.h (struct inline_summary): Move to ipa-inline.h
(cgraph_local_info): Remove inline_summary.
* ipa-cp.c: Include ipa-inline.h.
(ipcp_cloning_candidate_p, ipcp_estimate_growth,
ipcp_estimate_cloning_cost, ipcp_insert_stage): Use inline_summary
accesor.
* lto-cgraph.c (lto_output_node): Do not stream inline summary.
(input_overwrite_node): Do not set inline summary.
(input_node): Do not stream inline summary.
* ipa-inline.c (cgraph_decide_inlining): Dump inline summaries.
(cgraph_decide_inlining_incrementally): Do not try to estimate overall
growth; we do not have inline parameters computed for that anyway.
(cgraph_early_inlining): After inlining compute call_stmt_sizes.
* ipa-inline.h (struct inline_summary): Move here from ipa-inline.h
(inline_summary_t): New type and VECtor.
(debug_inline_summary, dump_inline_summaries): Declare.
(inline_summary): Use VOCtor.
(estimate_edge_growth): Kill hack computing call stmt size directly.
* lto-section-in.c (lto_section_name): Add inline section.
* ipa-inline-analysis.c: Include lto-streamer.h
(node_removal_hook_holder, node_duplication_hook_holder): New holders
(inline_node_removal_hook, inline_node_duplication_hook): New functions.
(inline_summary_vec): Define.
(inline_summary_alloc, dump_inline_summary, debug_inline_summary,
dump_inline_summaries): New functions.
(estimate_function_body_sizes): Properly compute size/time of outgoing calls.
(compute_inline_parameters): Alloc inline_summary; do not compute size/time
of incomming calls.
(estimate_edge_time): Avoid missing time summary hack.
(inline_read_summary): Read inline summary info.
(inline_write_summary): Write inline summary info.
(inline_free_summary): Free all hooks and inline summary vector.
* lto-streamer.h: Add LTO_section_inline_summary section.
* Makefile.in (ipa-cp.o, ipa-inline-analysis.o): Update dependencies.
* ipa.c (cgraph_remove_unreachable_nodes): Fix dump file formating.
2011-04-14 Richard Sandiford <richard.sandiford@linaro.org> 2011-04-14 Richard Sandiford <richard.sandiford@linaro.org>
* tree-vectorizer.h (vect_strided_store_supported): Add a * tree-vectorizer.h (vect_strided_store_supported): Add a
......
...@@ -3011,7 +3011,7 @@ ipa-ref.o : ipa-ref.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \ ...@@ -3011,7 +3011,7 @@ ipa-ref.o : ipa-ref.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \
ipa-cp.o : ipa-cp.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \ ipa-cp.o : ipa-cp.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \
$(TREE_H) $(TARGET_H) $(GIMPLE_H) $(CGRAPH_H) $(IPA_PROP_H) $(TREE_FLOW_H) \ $(TREE_H) $(TARGET_H) $(GIMPLE_H) $(CGRAPH_H) $(IPA_PROP_H) $(TREE_FLOW_H) \
$(TREE_PASS_H) $(FLAGS_H) $(TIMEVAR_H) $(DIAGNOSTIC_H) $(TREE_DUMP_H) \ $(TREE_PASS_H) $(FLAGS_H) $(TIMEVAR_H) $(DIAGNOSTIC_H) $(TREE_DUMP_H) \
$(TREE_INLINE_H) $(FIBHEAP_H) $(PARAMS_H) tree-pretty-print.h $(TREE_INLINE_H) $(FIBHEAP_H) $(PARAMS_H) tree-pretty-print.h ipa-inline.h
ipa-split.o : ipa-split.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \ ipa-split.o : ipa-split.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \
$(TREE_H) $(TARGET_H) $(CGRAPH_H) $(IPA_PROP_H) $(TREE_FLOW_H) \ $(TREE_H) $(TARGET_H) $(CGRAPH_H) $(IPA_PROP_H) $(TREE_FLOW_H) \
$(TREE_PASS_H) $(FLAGS_H) $(TIMEVAR_H) $(DIAGNOSTIC_H) $(TREE_DUMP_H) \ $(TREE_PASS_H) $(FLAGS_H) $(TIMEVAR_H) $(DIAGNOSTIC_H) $(TREE_DUMP_H) \
...@@ -3032,7 +3032,7 @@ ipa-inline-analysis.o : ipa-inline-analysis.c $(CONFIG_H) $(SYSTEM_H) coretypes. ...@@ -3032,7 +3032,7 @@ ipa-inline-analysis.o : ipa-inline-analysis.c $(CONFIG_H) $(SYSTEM_H) coretypes.
$(TREE_H) langhooks.h $(TREE_INLINE_H) $(FLAGS_H) $(CGRAPH_H) intl.h \ $(TREE_H) langhooks.h $(TREE_INLINE_H) $(FLAGS_H) $(CGRAPH_H) intl.h \
$(DIAGNOSTIC_H) $(PARAMS_H) $(TIMEVAR_H) $(TREE_PASS_H) \ $(DIAGNOSTIC_H) $(PARAMS_H) $(TIMEVAR_H) $(TREE_PASS_H) \
$(HASHTAB_H) $(COVERAGE_H) $(GGC_H) $(TREE_FLOW_H) $(IPA_PROP_H) \ $(HASHTAB_H) $(COVERAGE_H) $(GGC_H) $(TREE_FLOW_H) $(IPA_PROP_H) \
gimple-pretty-print.h ipa-inline.h gimple-pretty-print.h ipa-inline.h $(LTO_STREAMER_H)
ipa-utils.o : ipa-utils.c $(IPA_UTILS_H) $(CONFIG_H) $(SYSTEM_H) \ ipa-utils.o : ipa-utils.c $(IPA_UTILS_H) $(CONFIG_H) $(SYSTEM_H) \
coretypes.h $(TM_H) $(TREE_H) $(TREE_FLOW_H) $(TREE_INLINE_H) langhooks.h \ coretypes.h $(TM_H) $(TREE_H) $(TREE_FLOW_H) $(TREE_INLINE_H) langhooks.h \
pointer-set.h $(GGC_H) $(GIMPLE_H) $(SPLAY_TREE_H) \ pointer-set.h $(GGC_H) $(GIMPLE_H) $(SPLAY_TREE_H) \
......
...@@ -1876,22 +1876,6 @@ dump_cgraph_node (FILE *f, struct cgraph_node *node) ...@@ -1876,22 +1876,6 @@ dump_cgraph_node (FILE *f, struct cgraph_node *node)
if (node->count) if (node->count)
fprintf (f, " executed "HOST_WIDEST_INT_PRINT_DEC"x", fprintf (f, " executed "HOST_WIDEST_INT_PRINT_DEC"x",
(HOST_WIDEST_INT)node->count); (HOST_WIDEST_INT)node->count);
if (node->local.inline_summary.self_time)
fprintf (f, " %i time, %i benefit", node->local.inline_summary.self_time,
node->local.inline_summary.time_inlining_benefit);
if (node->global.time && node->global.time
!= node->local.inline_summary.self_time)
fprintf (f, " (%i after inlining)", node->global.time);
if (node->local.inline_summary.self_size)
fprintf (f, " %i size, %i benefit", node->local.inline_summary.self_size,
node->local.inline_summary.size_inlining_benefit);
if (node->global.size && node->global.size
!= node->local.inline_summary.self_size)
fprintf (f, " (%i after inlining)", node->global.size);
if (node->local.inline_summary.estimated_self_stack_size)
fprintf (f, " %i bytes stack usage", (int)node->local.inline_summary.estimated_self_stack_size);
if (node->global.estimated_stack_size != node->local.inline_summary.estimated_self_stack_size)
fprintf (f, " %i bytes after inlining", (int)node->global.estimated_stack_size);
if (node->origin) if (node->origin)
fprintf (f, " nested in: %s", cgraph_node_name (node->origin)); fprintf (f, " nested in: %s", cgraph_node_name (node->origin));
if (node->needed) if (node->needed)
......
...@@ -58,23 +58,6 @@ struct lto_file_decl_data; ...@@ -58,23 +58,6 @@ struct lto_file_decl_data;
extern const char * const cgraph_availability_names[]; extern const char * const cgraph_availability_names[];
extern const char * const ld_plugin_symbol_resolution_names[]; extern const char * const ld_plugin_symbol_resolution_names[];
/* Function inlining information. */
struct GTY(()) inline_summary
{
/* Estimated stack frame consumption by the function. */
HOST_WIDE_INT estimated_self_stack_size;
/* Size of the function body. */
int self_size;
/* How many instructions are likely going to disappear after inlining. */
int size_inlining_benefit;
/* Estimated time spent executing the function body. */
int self_time;
/* How much time is going to be saved by inlining. */
int time_inlining_benefit;
};
/* Information about thunk, used only for same body aliases. */ /* Information about thunk, used only for same body aliases. */
struct GTY(()) cgraph_thunk_info { struct GTY(()) cgraph_thunk_info {
...@@ -95,8 +78,6 @@ struct GTY(()) cgraph_local_info { ...@@ -95,8 +78,6 @@ struct GTY(()) cgraph_local_info {
/* File stream where this node is being written to. */ /* File stream where this node is being written to. */
struct lto_file_decl_data * lto_file_data; struct lto_file_decl_data * lto_file_data;
struct inline_summary inline_summary;
/* Set when function function is visible in current compilation unit only /* Set when function function is visible in current compilation unit only
and its address is never taken. */ and its address is never taken. */
unsigned local : 1; unsigned local : 1;
......
...@@ -148,6 +148,7 @@ along with GCC; see the file COPYING3. If not see ...@@ -148,6 +148,7 @@ along with GCC; see the file COPYING3. If not see
#include "tree-inline.h" #include "tree-inline.h"
#include "fibheap.h" #include "fibheap.h"
#include "params.h" #include "params.h"
#include "ipa-inline.h"
/* Number of functions identified as candidates for cloning. When not cloning /* Number of functions identified as candidates for cloning. When not cloning
we can simplify iterate stage not forcing it to go through the decision we can simplify iterate stage not forcing it to go through the decision
...@@ -495,7 +496,7 @@ ipcp_cloning_candidate_p (struct cgraph_node *node) ...@@ -495,7 +496,7 @@ ipcp_cloning_candidate_p (struct cgraph_node *node)
cgraph_node_name (node)); cgraph_node_name (node));
return false; return false;
} }
if (node->local.inline_summary.self_size < n_calls) if (inline_summary (node)->self_size < n_calls)
{ {
if (dump_file) if (dump_file)
fprintf (dump_file, "Considering %s for cloning; code would shrink.\n", fprintf (dump_file, "Considering %s for cloning; code would shrink.\n",
...@@ -1189,7 +1190,7 @@ ipcp_estimate_growth (struct cgraph_node *node) ...@@ -1189,7 +1190,7 @@ ipcp_estimate_growth (struct cgraph_node *node)
call site. Precise cost is difficult to get, as our size metric counts call site. Precise cost is difficult to get, as our size metric counts
constants and moves as free. Generally we are looking for cases that constants and moves as free. Generally we are looking for cases that
small function is called very many times. */ small function is called very many times. */
growth = node->local.inline_summary.self_size growth = inline_summary (node)->self_size
- removable_args * redirectable_node_callers; - removable_args * redirectable_node_callers;
if (growth < 0) if (growth < 0)
return 0; return 0;
...@@ -1229,7 +1230,7 @@ ipcp_estimate_cloning_cost (struct cgraph_node *node) ...@@ -1229,7 +1230,7 @@ ipcp_estimate_cloning_cost (struct cgraph_node *node)
cost /= freq_sum * 1000 / REG_BR_PROB_BASE + 1; cost /= freq_sum * 1000 / REG_BR_PROB_BASE + 1;
if (dump_file) if (dump_file)
fprintf (dump_file, "Cost of versioning %s is %i, (size: %i, freq: %i)\n", fprintf (dump_file, "Cost of versioning %s is %i, (size: %i, freq: %i)\n",
cgraph_node_name (node), cost, node->local.inline_summary.self_size, cgraph_node_name (node), cost, inline_summary (node)->self_size,
freq_sum); freq_sum);
return cost + 1; return cost + 1;
} }
...@@ -1364,7 +1365,7 @@ ipcp_insert_stage (void) ...@@ -1364,7 +1365,7 @@ ipcp_insert_stage (void)
{ {
if (node->count > max_count) if (node->count > max_count)
max_count = node->count; max_count = node->count;
overall_size += node->local.inline_summary.self_size; overall_size += inline_summary (node)->self_size;
} }
max_new_size = overall_size; max_new_size = overall_size;
......
...@@ -1301,6 +1301,9 @@ cgraph_decide_inlining (void) ...@@ -1301,6 +1301,9 @@ cgraph_decide_inlining (void)
max_benefit = benefit; max_benefit = benefit;
} }
} }
if (dump_file)
dump_inline_summaries (dump_file);
gcc_assert (in_lto_p gcc_assert (in_lto_p
|| !max_count || !max_count
|| (profile_info && flag_branch_probabilities)); || (profile_info && flag_branch_probabilities));
...@@ -1415,7 +1418,9 @@ cgraph_decide_inlining (void) ...@@ -1415,7 +1418,9 @@ cgraph_decide_inlining (void)
ncalls_inlined, nfunctions_inlined, initial_size, ncalls_inlined, nfunctions_inlined, initial_size,
overall_size); overall_size);
free (order); free (order);
inline_free_summary (); /* In WPA we use inline summaries for partitioning process. */
if (!flag_wpa)
inline_free_summary ();
return 0; return 0;
} }
...@@ -1558,8 +1563,7 @@ cgraph_decide_inlining_incrementally (struct cgraph_node *node) ...@@ -1558,8 +1563,7 @@ cgraph_decide_inlining_incrementally (struct cgraph_node *node)
/* When the function body would grow and inlining the function /* When the function body would grow and inlining the function
won't eliminate the need for offline copy of the function, won't eliminate the need for offline copy of the function,
don't inline. */ don't inline. */
if (estimate_edge_growth (e) > allowed_growth if (estimate_edge_growth (e) > allowed_growth)
&& estimate_growth (e->callee) > allowed_growth)
{ {
if (dump_file) if (dump_file)
fprintf (dump_file, fprintf (dump_file,
...@@ -1601,6 +1605,7 @@ static unsigned int ...@@ -1601,6 +1605,7 @@ static unsigned int
cgraph_early_inlining (void) cgraph_early_inlining (void)
{ {
struct cgraph_node *node = cgraph_get_node (current_function_decl); struct cgraph_node *node = cgraph_get_node (current_function_decl);
struct cgraph_edge *edge;
unsigned int todo = 0; unsigned int todo = 0;
int iterations = 0; int iterations = 0;
bool inlined = false; bool inlined = false;
...@@ -1652,6 +1657,19 @@ cgraph_early_inlining (void) ...@@ -1652,6 +1657,19 @@ cgraph_early_inlining (void)
{ {
timevar_push (TV_INTEGRATION); timevar_push (TV_INTEGRATION);
todo |= optimize_inline_calls (current_function_decl); todo |= optimize_inline_calls (current_function_decl);
/* Technically we ought to recompute inline parameters so the new iteration of
early inliner works as expected. We however have values approximately right
and thus we only need to update edge info that might be cleared out for
newly discovered edges. */
for (edge = node->callees; edge; edge = edge->next_callee)
{
edge->call_stmt_size
= estimate_num_insns (edge->call_stmt, &eni_size_weights);
edge->call_stmt_time
= estimate_num_insns (edge->call_stmt, &eni_time_weights);
}
timevar_pop (TV_INTEGRATION); timevar_pop (TV_INTEGRATION);
} }
......
...@@ -19,6 +19,30 @@ You should have received a copy of the GNU General Public License ...@@ -19,6 +19,30 @@ You should have received a copy of the GNU General Public License
along with GCC; see the file COPYING3. If not see along with GCC; see the file COPYING3. If not see
<http://www.gnu.org/licenses/>. */ <http://www.gnu.org/licenses/>. */
/* Function inlining information. */
struct inline_summary
{
/* Estimated stack frame consumption by the function. */
HOST_WIDE_INT estimated_self_stack_size;
/* Size of the function body. */
int self_size;
/* How many instructions are likely going to disappear after inlining. */
int size_inlining_benefit;
/* Estimated time spent executing the function body. */
int self_time;
/* How much time is going to be saved by inlining. */
int time_inlining_benefit;
};
typedef struct inline_summary inline_summary_t;
DEF_VEC_O(inline_summary_t);
DEF_VEC_ALLOC_O(inline_summary_t,heap);
extern VEC(inline_summary_t,heap) *inline_summary_vec;
void debug_inline_summary (struct cgraph_node *);
void dump_inline_summaries (FILE *f);
void inline_generate_summary (void); void inline_generate_summary (void);
void inline_read_summary (void); void inline_read_summary (void);
void inline_write_summary (cgraph_node_set, varpool_node_set); void inline_write_summary (cgraph_node_set, varpool_node_set);
...@@ -30,7 +54,7 @@ int estimate_growth (struct cgraph_node *); ...@@ -30,7 +54,7 @@ int estimate_growth (struct cgraph_node *);
static inline struct inline_summary * static inline struct inline_summary *
inline_summary (struct cgraph_node *node) inline_summary (struct cgraph_node *node)
{ {
return &node->local.inline_summary; return VEC_index (inline_summary_t, inline_summary_vec, node->uid);
} }
/* Estimate the growth of the caller when inlining EDGE. */ /* Estimate the growth of the caller when inlining EDGE. */
...@@ -39,12 +63,8 @@ static inline int ...@@ -39,12 +63,8 @@ static inline int
estimate_edge_growth (struct cgraph_edge *edge) estimate_edge_growth (struct cgraph_edge *edge)
{ {
int call_stmt_size; int call_stmt_size;
/* ??? We throw away cgraph edges all the time so the information call_stmt_size = edge->call_stmt_size;
we store in edges doesn't persist for early inlining. Ugh. */ gcc_checking_assert (call_stmt_size);
if (!edge->call_stmt)
call_stmt_size = edge->call_stmt_size;
else
call_stmt_size = estimate_num_insns (edge->call_stmt, &eni_size_weights);
return (edge->callee->global.size return (edge->callee->global.size
- inline_summary (edge->callee)->size_inlining_benefit - inline_summary (edge->callee)->size_inlining_benefit
- call_stmt_size); - call_stmt_size);
......
...@@ -1998,7 +1998,7 @@ ipa_edge_duplication_hook (struct cgraph_edge *src, struct cgraph_edge *dst, ...@@ -1998,7 +1998,7 @@ ipa_edge_duplication_hook (struct cgraph_edge *src, struct cgraph_edge *dst,
static void static void
ipa_node_duplication_hook (struct cgraph_node *src, struct cgraph_node *dst, ipa_node_duplication_hook (struct cgraph_node *src, struct cgraph_node *dst,
__attribute__((unused)) void *data) ATTRIBUTE_UNUSED void *data)
{ {
struct ipa_node_params *old_info, *new_info; struct ipa_node_params *old_info, *new_info;
int param_count, i; int param_count, i;
......
...@@ -517,6 +517,8 @@ cgraph_remove_unreachable_nodes (bool before_inlining_p, FILE *file) ...@@ -517,6 +517,8 @@ cgraph_remove_unreachable_nodes (bool before_inlining_p, FILE *file)
} }
} }
} }
if (file)
fprintf (file, "\n");
#ifdef ENABLE_CHECKING #ifdef ENABLE_CHECKING
verify_cgraph (); verify_cgraph ();
......
...@@ -465,16 +465,6 @@ lto_output_node (struct lto_simple_output_block *ob, struct cgraph_node *node, ...@@ -465,16 +465,6 @@ lto_output_node (struct lto_simple_output_block *ob, struct cgraph_node *node,
if (tag == LTO_cgraph_analyzed_node) if (tag == LTO_cgraph_analyzed_node)
{ {
lto_output_sleb128_stream (ob->main_stream,
node->local.inline_summary.estimated_self_stack_size);
lto_output_sleb128_stream (ob->main_stream,
node->local.inline_summary.self_size);
lto_output_sleb128_stream (ob->main_stream,
node->local.inline_summary.size_inlining_benefit);
lto_output_sleb128_stream (ob->main_stream,
node->local.inline_summary.self_time);
lto_output_sleb128_stream (ob->main_stream,
node->local.inline_summary.time_inlining_benefit);
if (node->global.inlined_to) if (node->global.inlined_to)
{ {
ref = lto_cgraph_encoder_lookup (encoder, node->global.inlined_to); ref = lto_cgraph_encoder_lookup (encoder, node->global.inlined_to);
...@@ -930,23 +920,9 @@ input_overwrite_node (struct lto_file_decl_data *file_data, ...@@ -930,23 +920,9 @@ input_overwrite_node (struct lto_file_decl_data *file_data,
struct cgraph_node *node, struct cgraph_node *node,
enum LTO_cgraph_tags tag, enum LTO_cgraph_tags tag,
struct bitpack_d *bp, struct bitpack_d *bp,
unsigned int stack_size,
unsigned int self_time,
unsigned int time_inlining_benefit,
unsigned int self_size,
unsigned int size_inlining_benefit,
enum ld_plugin_symbol_resolution resolution) enum ld_plugin_symbol_resolution resolution)
{ {
node->aux = (void *) tag; node->aux = (void *) tag;
node->local.inline_summary.estimated_self_stack_size = stack_size;
node->local.inline_summary.self_time = self_time;
node->local.inline_summary.time_inlining_benefit = time_inlining_benefit;
node->local.inline_summary.self_size = self_size;
node->local.inline_summary.size_inlining_benefit = size_inlining_benefit;
node->global.time = self_time;
node->global.size = self_size;
node->global.estimated_stack_size = stack_size;
node->global.estimated_growth = INT_MIN;
node->local.lto_file_data = file_data; node->local.lto_file_data = file_data;
node->local.local = bp_unpack_value (bp, 1); node->local.local = bp_unpack_value (bp, 1);
...@@ -1023,13 +999,8 @@ input_node (struct lto_file_decl_data *file_data, ...@@ -1023,13 +999,8 @@ input_node (struct lto_file_decl_data *file_data,
tree fn_decl; tree fn_decl;
struct cgraph_node *node; struct cgraph_node *node;
struct bitpack_d bp; struct bitpack_d bp;
int stack_size = 0;
unsigned decl_index; unsigned decl_index;
int ref = LCC_NOT_FOUND, ref2 = LCC_NOT_FOUND; int ref = LCC_NOT_FOUND, ref2 = LCC_NOT_FOUND;
int self_time = 0;
int self_size = 0;
int time_inlining_benefit = 0;
int size_inlining_benefit = 0;
unsigned long same_body_count = 0; unsigned long same_body_count = 0;
int clone_ref; int clone_ref;
enum ld_plugin_symbol_resolution resolution; enum ld_plugin_symbol_resolution resolution;
...@@ -1051,15 +1022,7 @@ input_node (struct lto_file_decl_data *file_data, ...@@ -1051,15 +1022,7 @@ input_node (struct lto_file_decl_data *file_data,
node->count_materialization_scale = lto_input_sleb128 (ib); node->count_materialization_scale = lto_input_sleb128 (ib);
if (tag == LTO_cgraph_analyzed_node) if (tag == LTO_cgraph_analyzed_node)
{ ref = lto_input_sleb128 (ib);
stack_size = lto_input_sleb128 (ib);
self_size = lto_input_sleb128 (ib);
size_inlining_benefit = lto_input_sleb128 (ib);
self_time = lto_input_sleb128 (ib);
time_inlining_benefit = lto_input_sleb128 (ib);
ref = lto_input_sleb128 (ib);
}
ref2 = lto_input_sleb128 (ib); ref2 = lto_input_sleb128 (ib);
...@@ -1073,9 +1036,7 @@ input_node (struct lto_file_decl_data *file_data, ...@@ -1073,9 +1036,7 @@ input_node (struct lto_file_decl_data *file_data,
bp = lto_input_bitpack (ib); bp = lto_input_bitpack (ib);
resolution = (enum ld_plugin_symbol_resolution)lto_input_uleb128 (ib); resolution = (enum ld_plugin_symbol_resolution)lto_input_uleb128 (ib);
input_overwrite_node (file_data, node, tag, &bp, stack_size, self_time, input_overwrite_node (file_data, node, tag, &bp, resolution);
time_inlining_benefit, self_size,
size_inlining_benefit, resolution);
/* Store a reference for now, and fix up later to be a pointer. */ /* Store a reference for now, and fix up later to be a pointer. */
node->global.inlined_to = (cgraph_node_ptr) (intptr_t) ref; node->global.inlined_to = (cgraph_node_ptr) (intptr_t) ref;
......
...@@ -58,7 +58,8 @@ const char *lto_section_name[LTO_N_SECTION_TYPES] = ...@@ -58,7 +58,8 @@ const char *lto_section_name[LTO_N_SECTION_TYPES] =
"reference", "reference",
"symtab", "symtab",
"opts", "opts",
"cgraphopt" "cgraphopt",
"inline"
}; };
unsigned char unsigned char
......
...@@ -264,6 +264,7 @@ enum lto_section_type ...@@ -264,6 +264,7 @@ enum lto_section_type
LTO_section_symtab, LTO_section_symtab,
LTO_section_opts, LTO_section_opts,
LTO_section_cgraph_opt_sum, LTO_section_cgraph_opt_sum,
LTO_section_inline_summary,
LTO_N_SECTION_TYPES /* Must be last. */ LTO_N_SECTION_TYPES /* Must be last. */
}; };
......
2011-04-14 Jan Hubicka <jh@suse.cz>
* lto.c: Include ipa-inline.h
(add_cgraph_node_to_partition, undo_partition): Use inline_summary accessor.
(ipa_node_duplication_hook): Fix declaration.
* Make-lang.in (lto.o): Update dependencies.
2011-04-12 Nathan Froyd <froydnj@codesourcery.com> 2011-04-12 Nathan Froyd <froydnj@codesourcery.com>
* lto-tree.h (union lang_tree_node): Check for TS_COMMON before * lto-tree.h (union lang_tree_node): Check for TS_COMMON before
......
...@@ -85,7 +85,8 @@ lto/lto.o: lto/lto.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(OPTS_H) \ ...@@ -85,7 +85,8 @@ lto/lto.o: lto/lto.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(OPTS_H) \
$(CGRAPH_H) $(GGC_H) tree-ssa-operands.h $(TREE_PASS_H) \ $(CGRAPH_H) $(GGC_H) tree-ssa-operands.h $(TREE_PASS_H) \
langhooks.h $(VEC_H) $(BITMAP_H) pointer-set.h $(IPA_PROP_H) \ langhooks.h $(VEC_H) $(BITMAP_H) pointer-set.h $(IPA_PROP_H) \
$(COMMON_H) debug.h $(TIMEVAR_H) $(GIMPLE_H) $(LTO_H) $(LTO_TREE_H) \ $(COMMON_H) debug.h $(TIMEVAR_H) $(GIMPLE_H) $(LTO_H) $(LTO_TREE_H) \
$(LTO_TAGS_H) $(LTO_STREAMER_H) $(SPLAY_TREE_H) gt-lto-lto.h $(PARAMS_H) $(LTO_TAGS_H) $(LTO_STREAMER_H) $(SPLAY_TREE_H) gt-lto-lto.h $(PARAMS_H) \
ipa-inline.h
lto/lto-object.o: lto/lto-object.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \ lto/lto-object.o: lto/lto-object.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \
$(DIAGNOSTIC_CORE_H) $(LTO_H) $(TM_H) $(LTO_STREAMER_H) \ $(DIAGNOSTIC_CORE_H) $(LTO_H) $(TM_H) $(LTO_STREAMER_H) \
../include/simple-object.h ../include/simple-object.h
......
...@@ -44,6 +44,7 @@ along with GCC; see the file COPYING3. If not see ...@@ -44,6 +44,7 @@ along with GCC; see the file COPYING3. If not see
#include "lto-streamer.h" #include "lto-streamer.h"
#include "splay-tree.h" #include "splay-tree.h"
#include "params.h" #include "params.h"
#include "ipa-inline.h"
static GTY(()) tree first_personality_decl; static GTY(()) tree first_personality_decl;
...@@ -750,7 +751,7 @@ add_cgraph_node_to_partition (ltrans_partition part, struct cgraph_node *node) ...@@ -750,7 +751,7 @@ add_cgraph_node_to_partition (ltrans_partition part, struct cgraph_node *node)
{ {
struct cgraph_edge *e; struct cgraph_edge *e;
part->insns += node->local.inline_summary.self_size; part->insns += inline_summary (node)->self_size;
if (node->aux) if (node->aux)
{ {
...@@ -811,7 +812,7 @@ undo_partition (ltrans_partition partition, unsigned int n_cgraph_nodes, ...@@ -811,7 +812,7 @@ undo_partition (ltrans_partition partition, unsigned int n_cgraph_nodes,
struct cgraph_node *node = VEC_index (cgraph_node_ptr, struct cgraph_node *node = VEC_index (cgraph_node_ptr,
partition->cgraph_set->nodes, partition->cgraph_set->nodes,
n_cgraph_nodes); n_cgraph_nodes);
partition->insns -= node->local.inline_summary.self_size; partition->insns -= inline_summary (node)->self_size;
cgraph_node_set_remove (partition->cgraph_set, node); cgraph_node_set_remove (partition->cgraph_set, node);
node->aux = (void *)((size_t)node->aux - 1); node->aux = (void *)((size_t)node->aux - 1);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment