aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/ipa-inline-analysis.c
diff options
context:
space:
mode:
authorRong Xu <xur@google.com>2014-07-21 16:47:22 -0700
committerRong Xu <xur@google.com>2014-07-29 15:31:03 -0700
commit38a8aecfb882072900434499696b5c32a2274515 (patch)
tree2aac97f0ae24b03cd98c1a06e989c031c173f889 /gcc-4.9/gcc/ipa-inline-analysis.c
parentc231900e5dcc14d8296bd9f62b45997a49d4d5e7 (diff)
downloadtoolchain_gcc-38a8aecfb882072900434499696b5c32a2274515.tar.gz
toolchain_gcc-38a8aecfb882072900434499696b5c32a2274515.tar.bz2
toolchain_gcc-38a8aecfb882072900434499696b5c32a2274515.zip
[4.9] Switch gcc-4.9 to use google/gcc-4_9 branch.
This source drop uses svn version r212828 of google/gcc-4.9 branch. We also cherry-picked r213062, r213063 and r213064 to fix windows build issues. All gcc-4.9 patches before July 3rd are ported to google/gcc-4.9. The following prior commits has not been merged to google branch yet. (They are included in this commit). e7af147f979e657fe2df00808e5b4319b0e088c6, baf87df3cb2683649ba7e9872362a7e721117c23, and c231900e5dcc14d8296bd9f62b45997a49d4d5e7. Change-Id: I4bea3ea470387ff751c2be4cb0d4a12059b9299b
Diffstat (limited to 'gcc-4.9/gcc/ipa-inline-analysis.c')
-rw-r--r--gcc-4.9/gcc/ipa-inline-analysis.c27
1 files changed, 10 insertions, 17 deletions
diff --git a/gcc-4.9/gcc/ipa-inline-analysis.c b/gcc-4.9/gcc/ipa-inline-analysis.c
index 8e0f5dd89..49c905859 100644
--- a/gcc-4.9/gcc/ipa-inline-analysis.c
+++ b/gcc-4.9/gcc/ipa-inline-analysis.c
@@ -1007,7 +1007,6 @@ reset_inline_summary (struct cgraph_node *node)
info->self_size = info->self_time = 0;
info->estimated_stack_size = 0;
info->estimated_self_stack_size = 0;
- info->stack_frame_offset = 0;
info->size = 0;
info->time = 0;
info->growth = 0;
@@ -1351,10 +1350,9 @@ dump_inline_edge_summary (FILE *f, int indent, struct cgraph_node *node,
}
if (!edge->inline_failed)
{
- fprintf (f, "%*sStack frame offset %i, callee self size %i,"
+ fprintf (f, "%*sCallee self size %i,"
" callee size %i\n",
indent + 2, "",
- (int) inline_summary (callee)->stack_frame_offset,
(int) inline_summary (callee)->estimated_self_stack_size,
(int) inline_summary (callee)->estimated_stack_size);
dump_inline_edge_summary (f, indent + 2, callee, info);
@@ -2436,7 +2434,8 @@ estimate_function_body_sizes (struct cgraph_node *node, bool early)
{
gcov_type time = 0;
/* Estimate static overhead for function prologue/epilogue and alignment. */
- int size = 2;
+ int overhead = PARAM_VALUE (PARAM_INLINE_FUNCTION_OVERHEAD_SIZE);
+ int size = overhead;
/* Benefits are scaled by probability of elimination that is in range
<0,2>. */
basic_block bb;
@@ -2478,7 +2477,7 @@ estimate_function_body_sizes (struct cgraph_node *node, bool early)
account_size_time (info, 0, 0, &bb_predicate);
bb_predicate = not_inlined_predicate ();
- account_size_time (info, 2 * INLINE_SIZE_SCALE, 0, &bb_predicate);
+ account_size_time (info, overhead * INLINE_SIZE_SCALE, 0, &bb_predicate);
gcc_assert (my_function && my_function->cfg);
if (parms_info)
@@ -2850,7 +2849,6 @@ compute_inline_parameters (struct cgraph_node *node, bool early)
self_stack_size = optimize ? estimated_stack_frame_size (node) : 0;
info->estimated_self_stack_size = self_stack_size;
info->estimated_stack_size = self_stack_size;
- info->stack_frame_offset = 0;
/* Can this function be inlined at all? */
if (!optimize && !lookup_attribute ("always_inline",
@@ -2892,7 +2890,6 @@ compute_inline_parameters (struct cgraph_node *node, bool early)
/* Inlining characteristics are maintained by the cgraph_mark_inline. */
info->time = info->self_time;
info->size = info->self_size;
- info->stack_frame_offset = 0;
info->estimated_stack_size = info->estimated_self_stack_size;
#ifdef ENABLE_CHECKING
inline_update_overall_summary (node);
@@ -3317,16 +3314,12 @@ inline_update_callee_summaries (struct cgraph_node *node, int depth)
{
struct cgraph_edge *e;
struct inline_summary *callee_info = inline_summary (node);
- struct inline_summary *caller_info = inline_summary (node->callers->caller);
- HOST_WIDE_INT peak;
-
- callee_info->stack_frame_offset
- = caller_info->stack_frame_offset
- + caller_info->estimated_self_stack_size;
- peak = callee_info->stack_frame_offset
- + callee_info->estimated_self_stack_size;
- if (inline_summary (node->global.inlined_to)->estimated_stack_size < peak)
- inline_summary (node->global.inlined_to)->estimated_stack_size = peak;
+
+ /* Pessimistically assume no sharing of stack space. That is, the
+ frame size of a function is estimated as the original frame size
+ plus the sum of the frame sizes of all inlined callees. */
+ inline_summary (node->global.inlined_to)->estimated_stack_size +=
+ callee_info->estimated_self_stack_size;
ipa_propagate_frequency (node);
for (e = node->callees; e; e = e->next_callee)
{