aboutsummaryrefslogtreecommitdiff
path: root/gcc/ipa-inline-transform.c
diff options
context:
space:
mode:
authorJan Hubicka <jh@suse.cz>2012-10-25 21:23:15 +0200
committerJan Hubicka <hubicka@gcc.gnu.org>2012-10-25 19:23:15 +0000
commit0f378cb5db23d1b2b95387ae8c2b3c8f3662cbb4 (patch)
tree81e2371d565ef985b588b64d19e5b6de88ca0df3 /gcc/ipa-inline-transform.c
parent0d198936b908bcf4aa4138ae86774955c9db6854 (diff)
downloadgcc-0f378cb5db23d1b2b95387ae8c2b3c8f3662cbb4.zip
gcc-0f378cb5db23d1b2b95387ae8c2b3c8f3662cbb4.tar.gz
gcc-0f378cb5db23d1b2b95387ae8c2b3c8f3662cbb4.tar.bz2
ipa-cp.c (ipcp_discover_new_direct_edges): If something was turned to direct call update the summary.
* ipa-cp.c (ipcp_discover_new_direct_edges): If something was turned to direct call update the summary. * ipa-inline-transform.c (inline_call): Sanity check that summaries match the predicted effect; fix updating of summary after edge redirection. * ipa-inline-analysis.c (inline_node_duplication_hook): Do not try to update the summary and recompute it instead. (estimate_function_body_sizes): Fix self size estimation; double check that it agrees with inline_update_overall_summary. (estimate_edge_size_and_time): Handle devirtualizaiton costs. (estimate_edge_devirt_benefit): Update to be called from estimate_edge_size_and_time. (estimate_calls_size_and_time): Update. (estimate_node_size_and_time): Watch overflows. (inline_merge_summary): Likewise. * ipa-prob.c: Include ipa-inline.h (ipa_make_edge_direct_to_target): After redirection update the summary. From-SVN: r192821
Diffstat (limited to 'gcc/ipa-inline-transform.c')
-rw-r--r--gcc/ipa-inline-transform.c23
1 files changed, 19 insertions, 4 deletions
diff --git a/gcc/ipa-inline-transform.c b/gcc/ipa-inline-transform.c
index 53c4687..60a2962 100644
--- a/gcc/ipa-inline-transform.c
+++ b/gcc/ipa-inline-transform.c
@@ -209,6 +209,12 @@ inline_call (struct cgraph_edge *e, bool update_original,
struct cgraph_node *to = NULL;
struct cgraph_edge *curr = e;
struct cgraph_node *callee = cgraph_function_or_thunk_node (e->callee, NULL);
+ bool new_edges_found = false;
+
+#ifdef ENABLE_CHECKING
+ int estimated_growth = estimate_edge_growth (e);
+ bool predicated = inline_edge_summary (e)->predicate != NULL;
+#endif
/* Don't inline inlined edges. */
gcc_assert (e->inline_failed);
@@ -248,19 +254,28 @@ inline_call (struct cgraph_edge *e, bool update_original,
old_size = inline_summary (to)->size;
inline_merge_summary (e);
+ if (optimize)
+ new_edges_found = ipa_propagate_indirect_call_infos (curr, new_edges);
if (update_overall_summary)
inline_update_overall_summary (to);
new_size = inline_summary (to)->size;
+#ifdef ENABLE_CHECKING
+ /* Verify that estimated growth match real growth. Allow off-by-one
+ error due to INLINE_SIZE_SCALE roudoff errors. */
+ gcc_assert (!update_overall_summary || !overall_size
+ || abs (estimated_growth - (new_size - old_size)) <= 1
+ /* FIXME: a hack. Edges with false predicate are accounted
+ wrong, we should remove them from callgraph. */
+ || predicated);
+#endif
+
if (overall_size)
*overall_size += new_size - old_size;
ncalls_inlined++;
/* This must happen after inline_merge_summary that rely on jump
functions of callee to not be updated. */
- if (optimize)
- return ipa_propagate_indirect_call_infos (curr, new_edges);
- else
- return false;
+ return new_edges_found;
}