From cbd7f5a00aba19d118dcc101792eadc82462da26 Mon Sep 17 00:00:00 2001 From: hubicka Date: Sat, 16 Apr 2011 09:13:08 +0000 Subject: * cgraphbuild.c: Include ipa-inline.h. (reset_inline_failed): Use initialize_inline_failed. * cgraph.c: Include ipa-inline.h. (cgraph_create_node_1): Do not initialize estimated_growth. (initialize_inline_failed): More to ipa-inline-analysis.c (dump_cgraph_node): Do not dump inline flags. * cgraph.h (cgraph_local_info): Remove inlineable, versionable and disregard_inline_limits flags. (cgrpah_global_info): Remove estimated_stack_size, stack_frame_offset, time, size, estimated_growth. * ipa-cp.c (ipcp_versionable_function_p, ipcp_generate_summary): Update. * cgraphunit.c (cgraph_decide_is_function_needed): Use DECL_DISREGARD_INLINE_LIMITS. (cgraph_analyze_function): Do not initialize node->local.disregard_inline_limits. * lto-cgraph.c (lto_output_node, input_overwrite_node): Do not stream inlinable, versionable and disregard_inline_limits. * ipa-inline.c (cgraph_clone_inlined_nodes, cgraph_mark_inline_edge, cgraph_check_inline_limits, cgraph_default_inline_p, cgraph_edge_badness, update_caller_keys, update_callee_keys, add_new_edges_to_heap): Update. (cgraph_decide_inlining_of_small_function): Update; set CIF_FUNCTION_NOT_INLINABLE for uninlinable functions. (cgraph_decide_inlining, cgraph_edge_early_inlinable_p, cgraph_decide_inlining_incrementally): Update. * ipa-inline.h (inline_summary): Add inlinable, versionable, disregard_inline_limits, estimated_stack_size, stack_frame_offset, time, size and estimated_growth parameters. (estimate_edge_growth): Update. (initialize_inline_failed): Declare. * ipa-split.c: Include ipa-inline.h (execute_split_functions): Update. * ipa.c (cgraph_postorder): Use DECL_DISREGARD_INLINE_LIMITS. (cgraph_remove_unreachable_nodes): Do not clear inlinable flag. (record_cdtor_fn): Use DECL_DISREGARD_INLINE_LIMITS. * ipa-inline-analysis.c (inline_node_removal_hook): Update; set estimated_growth to INT_MIN. (inline_node_duplication_hook): Likewise. (dump_inline_summary): Dump new fields. (compute_inline_parameters): Update. (estimate_edge_time, estimate_time_after_inlining, estimate_size_after_inlining, estimate_growth, inline_read_summary, inline_write_summary): (initialize_inline_failed): Move here from cgraph.c. * tree-sra.c: Include ipa-inline.h. (ipa_sra_preliminary_function_checks): Update. * lto/lto.c (lto_balanced_map): Update. Update. * Makefile.in: (cgraph.o, cgraphbuild.o): Add dependency on ipa-inline.h git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@172581 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/ipa-inline.h | 33 +++++++++++++++++++++++++++++---- 1 file changed, 29 insertions(+), 4 deletions(-) (limited to 'gcc/ipa-inline.h') diff --git a/gcc/ipa-inline.h b/gcc/ipa-inline.h index e9a7db21043..58bcdd968b9 100644 --- a/gcc/ipa-inline.h +++ b/gcc/ipa-inline.h @@ -23,9 +23,10 @@ along with GCC; see the file COPYING3. If not see struct inline_summary { + /* Information about the function body itself. */ + /* 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. */ @@ -34,6 +35,29 @@ struct inline_summary int self_time; /* How much time is going to be saved by inlining. */ int time_inlining_benefit; + + /* False when there something makes inlining impossible (such as va_arg). */ + unsigned inlinable : 1; + /* False when there something makes versioning impossible. + Currently computed and used only by ipa-cp. */ + unsigned versionable : 1; + /* True when function should be inlined independently on its size. */ + unsigned disregard_inline_limits : 1; + + /* Information about function that will result after applying all the + inline decisions present in the callgraph. Generally kept up to + date only for functions that are not inline clones. */ + + /* Estimated stack frame consumption by the function. */ + HOST_WIDE_INT estimated_stack_size; + /* Expected offset of the stack frame of inlined function. */ + HOST_WIDE_INT stack_frame_offset; + /* Estimated size of the function after inlining. */ + int time; + int size; + /* Cached estimated growth after inlining. + INT_MIN if not computed. */ + int estimated_growth; }; typedef struct inline_summary inline_summary_t; @@ -47,6 +71,7 @@ void inline_generate_summary (void); void inline_read_summary (void); void inline_write_summary (cgraph_node_set, varpool_node_set); void inline_free_summary (void); +void initialize_inline_failed (struct cgraph_edge *); int estimate_time_after_inlining (struct cgraph_node *, struct cgraph_edge *); int estimate_size_after_inlining (struct cgraph_node *, struct cgraph_edge *); int estimate_growth (struct cgraph_node *); @@ -63,10 +88,10 @@ static inline int estimate_edge_growth (struct cgraph_edge *edge) { int call_stmt_size; + struct inline_summary *info = inline_summary (edge->callee); call_stmt_size = edge->call_stmt_size; gcc_checking_assert (call_stmt_size); - return (edge->callee->global.size - - inline_summary (edge->callee)->size_inlining_benefit + return (info->size + - info->size_inlining_benefit - call_stmt_size); } - -- cgit v1.2.1