aboutsummaryrefslogtreecommitdiff
path: root/gcc/ipa-inline-analysis.c
diff options
context:
space:
mode:
authorJan Hubicka <jh@suse.cz>2012-10-07 18:58:04 +0000
committerJan Hubicka <jh@suse.cz>2012-10-07 18:58:04 +0000
commit00d5d1fc0d1f07ebc8163f3841cc09ac51ae7359 (patch)
treefe7a69511297e157ec48839981853e440e96771d /gcc/ipa-inline-analysis.c
parentbda21c272e9690f9e9ff100710496d198fddd2d8 (diff)
* ipa-inline-analysis.c (do_estimate_edge_time): Return actual
time spent by the inlined sequence. (do_estimate_edge_growth): Rename to ... (do_estimate_edge_time): ... this one; return size of inlined sequence. * ipa-inline.h (do_estimate_edge_size): New. (do_estimate_edge_growth): Remove. (estimate_edge_size): New function. (estimate_edge_growth): Use it. git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@192185 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ipa-inline-analysis.c')
-rw-r--r--gcc/ipa-inline-analysis.c17
1 files changed, 6 insertions, 11 deletions
diff --git a/gcc/ipa-inline-analysis.c b/gcc/ipa-inline-analysis.c
index 31ecec9af99..6cea94225b0 100644
--- a/gcc/ipa-inline-analysis.c
+++ b/gcc/ipa-inline-analysis.c
@@ -3312,14 +3312,12 @@ do_estimate_edge_time (struct cgraph_edge *edge)
VEC_free (tree, heap, known_binfos);
VEC_free (ipa_agg_jump_function_p, heap, known_aggs);
- ret = (((gcov_type)time
- - es->call_stmt_time) * edge->frequency
- + CGRAPH_FREQ_BASE / 2) / CGRAPH_FREQ_BASE;
+ ret = RDIV ((gcov_type)time * edge->frequency,
+ CGRAPH_FREQ_BASE);
/* When caching, update the cache entry. */
if (edge_growth_cache)
{
- int ret_size;
if ((int)VEC_length (edge_growth_cache_entry, edge_growth_cache)
<= edge->uid)
VEC_safe_grow_cleared (edge_growth_cache_entry, heap, edge_growth_cache,
@@ -3327,10 +3325,8 @@ do_estimate_edge_time (struct cgraph_edge *edge)
VEC_index (edge_growth_cache_entry, edge_growth_cache, edge->uid).time
= ret + (ret >= 0);
- ret_size = size - es->call_stmt_size;
- gcc_checking_assert (es->call_stmt_size);
VEC_index (edge_growth_cache_entry, edge_growth_cache, edge->uid).size
- = ret_size + (ret_size >= 0);
+ = size + (size >= 0);
VEC_index (edge_growth_cache_entry, edge_growth_cache, edge->uid).hints
= hints + 1;
}
@@ -3338,11 +3334,11 @@ do_estimate_edge_time (struct cgraph_edge *edge)
}
-/* Estimate the growth of the caller when inlining EDGE.
+/* Return estimated callee growth after inlining EDGE.
Only to be called via estimate_edge_size. */
int
-do_estimate_edge_growth (struct cgraph_edge *edge)
+do_estimate_edge_size (struct cgraph_edge *edge)
{
int size;
struct cgraph_node *callee;
@@ -3375,8 +3371,7 @@ do_estimate_edge_growth (struct cgraph_edge *edge)
VEC_free (tree, heap, known_vals);
VEC_free (tree, heap, known_binfos);
VEC_free (ipa_agg_jump_function_p, heap, known_aggs);
- gcc_checking_assert (inline_edge_summary (edge)->call_stmt_size);
- return size - inline_edge_summary (edge)->call_stmt_size;
+ return size;
}