summaryrefslogtreecommitdiff
path: root/gcc/ipa-inline.h
diff options
context:
space:
mode:
authorhubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4>2011-04-14 13:26:44 +0000
committerhubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4>2011-04-14 13:26:44 +0000
commitc7b2cc59a01b620dacfe495f7092b9c95f4773ff (patch)
treeeb6e4c913e14b3874133c0765b5a7b51b8c55868 /gcc/ipa-inline.h
parent481fc47427d3ea2d912d3db0b21d31aacd829328 (diff)
downloadgcc-c7b2cc59a01b620dacfe495f7092b9c95f4773ff.tar.gz
* 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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@172430 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ipa-inline.h')
-rw-r--r--gcc/ipa-inline.h34
1 files changed, 27 insertions, 7 deletions
diff --git a/gcc/ipa-inline.h b/gcc/ipa-inline.h
index d76a492a1d2..e9a7db21043 100644
--- a/gcc/ipa-inline.h
+++ b/gcc/ipa-inline.h
@@ -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
<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_read_summary (void);
void inline_write_summary (cgraph_node_set, varpool_node_set);
@@ -30,7 +54,7 @@ int estimate_growth (struct cgraph_node *);
static inline struct inline_summary *
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. */
@@ -39,12 +63,8 @@ static inline int
estimate_edge_growth (struct cgraph_edge *edge)
{
int call_stmt_size;
- /* ??? We throw away cgraph edges all the time so the information
- we store in edges doesn't persist for early inlining. Ugh. */
- if (!edge->call_stmt)
- call_stmt_size = edge->call_stmt_size;
- else
- call_stmt_size = estimate_num_insns (edge->call_stmt, &eni_size_weights);
+ 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
- call_stmt_size);