diff options
author | hubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4> | 2011-04-13 17:26:50 +0000 |
---|---|---|
committer | hubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4> | 2011-04-13 17:26:50 +0000 |
commit | 99c67f243f8b4e3b58cc421e64b1ca4094a3e231 (patch) | |
tree | 70e379a6f9ceffd51efd849ff820056e3148cba8 /gcc/ipa-inline.h | |
parent | dc360156c378b3d81df2e1751c3961c6ef70c4d3 (diff) | |
download | gcc-99c67f243f8b4e3b58cc421e64b1ca4094a3e231.tar.gz |
* ipa-inline.h: New file.
* ipa-inline-analysis.c: New file. Broken out of ...
* ipa-inline.c: ... this file; update toplevel comment;
include ipa-inline.h
(inline_summary): Move to ipa-inline.h
(cgraph_estimate_edge_time): Rename to estimate_edge_time; move to
ipa-inline-analysis.c.
(cgraph_estimate_time_after_inlining): Rename to estiamte_time_after_inlining;
move to ipa-inline-analysis.c
(cgraph_estimate_edge_growth): Move to ipa-inline-analysis.c; rename
to estimate_edge_growth.
(cgraph_estimate_size_after_inlining): Move to ipa-inline-analysis.c;
rename to estimate_size_after_inlining.
(cgraph_mark_inline_edge): Update for new naming convention.
(cgraph_check_inline_limits): Likewise.
(cgraph_edge_badness): Likewise.
(cgraph_decide_recursive_inlining): Likewise.
(cgraph_decide_inlining_of_small_functions): Likewise.
(cgraph_decide_inlining_incrementally): Likewise.
(cgraph_estimate_growth): Rename to estimate_growth; move to ipa-inline-analysis.c.
(eliminated_by_inlining_prob): Move to ipa-inline-analysis.c.
(estimate_function_body_sizes): Move to ipa-inline-analysis.c.
(compute_inline_parameters): Likewise.
(compute_inline_parameters_for_current): Likewise.
(pass_inline_parameters): Likewise.
(inline_indirect_intraprocedural_analysis): Likewise.
(analyze_function): Rename to inline_analyze_function; likewise.
(add_new_function): Move to ipa-inline-analysis.c.
(inline_generate_summary): Likewise.
(inline_read_summary): Likewise.
(inline_write_summary): Likewise.
* Makefile.in (ipa-inline-analysis.c): New file.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@172388 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ipa-inline.h')
-rw-r--r-- | gcc/ipa-inline.h | 52 |
1 files changed, 52 insertions, 0 deletions
diff --git a/gcc/ipa-inline.h b/gcc/ipa-inline.h new file mode 100644 index 00000000000..d76a492a1d2 --- /dev/null +++ b/gcc/ipa-inline.h @@ -0,0 +1,52 @@ +/* Inlining decision heuristics. + Copyright (C) 2003, 2004, 2007, 2008, 2009, 2010, 2011 + Free Software Foundation, Inc. + Contributed by Jan Hubicka + +This file is part of GCC. + +GCC is free software; you can redistribute it and/or modify it under +the terms of the GNU General Public License as published by the Free +Software Foundation; either version 3, or (at your option) any later +version. + +GCC is distributed in the hope that it will be useful, but WITHOUT ANY +WARRANTY; without even the implied warranty of MERCHANTABILITY or +FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +for more details. + +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/>. */ + +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); +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 *); + +static inline struct inline_summary * +inline_summary (struct cgraph_node *node) +{ + return &node->local.inline_summary; +} + +/* Estimate the growth of the caller when inlining EDGE. */ + +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); + return (edge->callee->global.size + - inline_summary (edge->callee)->size_inlining_benefit + - call_stmt_size); +} + |