aboutsummaryrefslogtreecommitdiff
path: root/gcc/ipa-inline-analysis.c
diff options
context:
space:
mode:
authorJan Hubicka <hubicka@ucw.cz>2017-04-28 15:04:48 +0200
committerJan Hubicka <hubicka@gcc.gnu.org>2017-04-28 13:04:48 +0000
commitab38481ceff08c995ade3e88eccee6ab92914a44 (patch)
tree605e718598b0f75578b041856d9df7946d8b7787 /gcc/ipa-inline-analysis.c
parentb26f45f0694604745bbb3d269cacecefd28b4faf (diff)
downloadgcc-ab38481ceff08c995ade3e88eccee6ab92914a44.zip
gcc-ab38481ceff08c995ade3e88eccee6ab92914a44.tar.gz
gcc-ab38481ceff08c995ade3e88eccee6ab92914a44.tar.bz2
ipa-cp.c (perform_estimation_of_a_value): Turn time to sreal.
* ipa-cp.c (perform_estimation_of_a_value): Turn time to sreal. (estimate_local_effects): Likewise. * ipa-inline.c (compute_inlined_call_time, want_inline_small_function_p, edge_badness, inline_small_functions, dump_overall_stats): LIkewise. * ipa-inline.h (edge_growth_cache_entry, estimate_time_after_inlining, estimate_ipcp_clone_size_and_time, do_estimate_edge_time, do_estimate_edge_time, estimate_edge_time): Likewise. * ipa-inline-analysis.c (estimate_node_size_and_time, estimate_ipcp_clone_size_and_time, do_estimate_edge_time): Likewise. (estimate_time_after_inlining): Remove. From-SVN: r247380
Diffstat (limited to 'gcc/ipa-inline-analysis.c')
-rw-r--r--gcc/ipa-inline-analysis.c34
1 files changed, 7 insertions, 27 deletions
diff --git a/gcc/ipa-inline-analysis.c b/gcc/ipa-inline-analysis.c
index 2cf5944..e211d32 100644
--- a/gcc/ipa-inline-analysis.c
+++ b/gcc/ipa-inline-analysis.c
@@ -3260,7 +3260,7 @@ estimate_node_size_and_time (struct cgraph_node *node,
vec<tree> known_vals,
vec<ipa_polymorphic_call_context> known_contexts,
vec<ipa_agg_jump_function_p> known_aggs,
- int *ret_size, int *ret_min_size, int *ret_time,
+ int *ret_size, int *ret_min_size, sreal *ret_time,
inline_hints *ret_hints,
vec<inline_param_summary>
inline_param_summary)
@@ -3336,14 +3336,14 @@ estimate_node_size_and_time (struct cgraph_node *node,
known_vals, known_contexts, known_aggs);
gcc_checking_assert (size >= 0);
gcc_checking_assert (time >= 0);
- time = RDIV (time, INLINE_TIME_SCALE);
+ time = time / INLINE_TIME_SCALE;
size = RDIV (size, INLINE_SIZE_SCALE);
min_size = RDIV (min_size, INLINE_SIZE_SCALE);
if (dump_file && (dump_flags & TDF_DETAILS))
fprintf (dump_file, "\n size:%i time:%f\n", (int) size, time.to_double ());
if (ret_time)
- *ret_time = time.to_int ();
+ *ret_time = time;
if (ret_size)
*ret_size = size;
if (ret_min_size)
@@ -3365,7 +3365,7 @@ estimate_ipcp_clone_size_and_time (struct cgraph_node *node,
vec<ipa_polymorphic_call_context>
known_contexts,
vec<ipa_agg_jump_function_p> known_aggs,
- int *ret_size, int *ret_time,
+ int *ret_size, sreal *ret_time,
inline_hints *hints)
{
clause_t clause;
@@ -3800,10 +3800,10 @@ simple_edge_hints (struct cgraph_edge *edge)
When caching, also update the cache entry. Compute both time and
size, since we always need both metrics eventually. */
-int
+sreal
do_estimate_edge_time (struct cgraph_edge *edge)
{
- int time;
+ sreal time;
int size;
inline_hints hints;
struct cgraph_node *callee;
@@ -3845,7 +3845,7 @@ do_estimate_edge_time (struct cgraph_edge *edge)
inline_summaries->get (edge->callee)->min_size = min_size;
if ((int) edge_growth_cache.length () <= edge->uid)
edge_growth_cache.safe_grow_cleared (symtab->edges_max_uid);
- edge_growth_cache[edge->uid].time = time + (time >= 0);
+ edge_growth_cache[edge->uid].time = time;
edge_growth_cache[edge->uid].size = size + (size >= 0);
hints |= simple_edge_hints (edge);
@@ -3933,26 +3933,6 @@ do_estimate_edge_hints (struct cgraph_edge *edge)
return hints;
}
-
-/* Estimate self time of the function NODE after inlining EDGE. */
-
-int
-estimate_time_after_inlining (struct cgraph_node *node,
- struct cgraph_edge *edge)
-{
- struct inline_edge_summary *es = inline_edge_summary (edge);
- if (!es->predicate || !false_predicate_p (es->predicate))
- {
- sreal time =
- inline_summaries->get (node)->time + estimate_edge_time (edge);
- if (time < 0)
- time = 0;
- return time.to_int ();
- }
- return inline_summaries->get (node)->time.to_int ();
-}
-
-
/* Estimate the size of NODE after inlining EDGE which should be an
edge to either NODE or a call inlined into NODE. */