ipa-fnsummary.c (analyze_function_body): Accumulate time consistently in sreal.
* ipa-fnsummary.c (analyze_function_body): Accumulate time consistently in sreal. * gcc.dg/ipa/ipcp-2.c: Lower threshold. From-SVN: r254834
This commit is contained in:
parent
913f8c088e
commit
b71289b1ef
@ -1,3 +1,8 @@
|
|||||||
|
2017-11-16 Jan Hubicka <hubicka@ucw.cz>
|
||||||
|
|
||||||
|
* ipa-fnsummary.c (analyze_function_body): Accumulate time consistently
|
||||||
|
in sreal.
|
||||||
|
|
||||||
2017-11-16 Jan Hubicka <hubicka@ucw.cz>
|
2017-11-16 Jan Hubicka <hubicka@ucw.cz>
|
||||||
|
|
||||||
* predict.c (combine_predictions_for_bb): Preserve zero predicted
|
* predict.c (combine_predictions_for_bb): Preserve zero predicted
|
||||||
|
@ -1986,7 +1986,7 @@ analyze_function_body (struct cgraph_node *node, bool early)
|
|||||||
<0,2>. */
|
<0,2>. */
|
||||||
basic_block bb;
|
basic_block bb;
|
||||||
struct function *my_function = DECL_STRUCT_FUNCTION (node->decl);
|
struct function *my_function = DECL_STRUCT_FUNCTION (node->decl);
|
||||||
int freq;
|
sreal freq;
|
||||||
struct ipa_fn_summary *info = ipa_fn_summaries->get (node);
|
struct ipa_fn_summary *info = ipa_fn_summaries->get (node);
|
||||||
predicate bb_predicate;
|
predicate bb_predicate;
|
||||||
struct ipa_func_body_info fbi;
|
struct ipa_func_body_info fbi;
|
||||||
@ -2052,7 +2052,7 @@ analyze_function_body (struct cgraph_node *node, bool early)
|
|||||||
for (n = 0; n < nblocks; n++)
|
for (n = 0; n < nblocks; n++)
|
||||||
{
|
{
|
||||||
bb = BASIC_BLOCK_FOR_FN (cfun, order[n]);
|
bb = BASIC_BLOCK_FOR_FN (cfun, order[n]);
|
||||||
freq = compute_call_stmt_bb_frequency (node->decl, bb);
|
freq = bb->count.to_sreal_scale (ENTRY_BLOCK_PTR_FOR_FN (cfun)->count);
|
||||||
if (clobber_only_eh_bb_p (bb))
|
if (clobber_only_eh_bb_p (bb))
|
||||||
{
|
{
|
||||||
if (dump_file && (dump_flags & TDF_DETAILS))
|
if (dump_file && (dump_flags & TDF_DETAILS))
|
||||||
@ -2127,7 +2127,7 @@ analyze_function_body (struct cgraph_node *node, bool early)
|
|||||||
fprintf (dump_file, " ");
|
fprintf (dump_file, " ");
|
||||||
print_gimple_stmt (dump_file, stmt, 0);
|
print_gimple_stmt (dump_file, stmt, 0);
|
||||||
fprintf (dump_file, "\t\tfreq:%3.2f size:%3i time:%3i\n",
|
fprintf (dump_file, "\t\tfreq:%3.2f size:%3i time:%3i\n",
|
||||||
((double) freq) / CGRAPH_FREQ_BASE, this_size,
|
freq.to_double (), this_size,
|
||||||
this_time);
|
this_time);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2201,7 +2201,7 @@ analyze_function_body (struct cgraph_node *node, bool early)
|
|||||||
will_be_nonconstant = true;
|
will_be_nonconstant = true;
|
||||||
if (this_time || this_size)
|
if (this_time || this_size)
|
||||||
{
|
{
|
||||||
this_time *= freq;
|
sreal final_time = (sreal)this_time * freq;
|
||||||
|
|
||||||
prob = eliminated_by_inlining_prob (stmt);
|
prob = eliminated_by_inlining_prob (stmt);
|
||||||
if (prob == 1 && dump_file && (dump_flags & TDF_DETAILS))
|
if (prob == 1 && dump_file && (dump_flags & TDF_DETAILS))
|
||||||
@ -2218,7 +2218,7 @@ analyze_function_body (struct cgraph_node *node, bool early)
|
|||||||
|
|
||||||
if (*(is_gimple_call (stmt) ? &bb_predicate : &p) != false)
|
if (*(is_gimple_call (stmt) ? &bb_predicate : &p) != false)
|
||||||
{
|
{
|
||||||
time += this_time;
|
time += final_time;
|
||||||
size += this_size;
|
size += this_size;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2231,14 +2231,12 @@ analyze_function_body (struct cgraph_node *node, bool early)
|
|||||||
{
|
{
|
||||||
predicate ip = bb_predicate & predicate::not_inlined ();
|
predicate ip = bb_predicate & predicate::not_inlined ();
|
||||||
info->account_size_time (this_size * prob,
|
info->account_size_time (this_size * prob,
|
||||||
(sreal)(this_time * prob)
|
(this_time * prob) / 2, ip,
|
||||||
/ (CGRAPH_FREQ_BASE * 2), ip,
|
|
||||||
p);
|
p);
|
||||||
}
|
}
|
||||||
if (prob != 2)
|
if (prob != 2)
|
||||||
info->account_size_time (this_size * (2 - prob),
|
info->account_size_time (this_size * (2 - prob),
|
||||||
(sreal)(this_time * (2 - prob))
|
(this_time * (2 - prob) / 2),
|
||||||
/ (CGRAPH_FREQ_BASE * 2),
|
|
||||||
bb_predicate,
|
bb_predicate,
|
||||||
p);
|
p);
|
||||||
}
|
}
|
||||||
@ -2256,7 +2254,6 @@ analyze_function_body (struct cgraph_node *node, bool early)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
set_hint_predicate (&ipa_fn_summaries->get (node)->array_index, array_index);
|
set_hint_predicate (&ipa_fn_summaries->get (node)->array_index, array_index);
|
||||||
time = time / CGRAPH_FREQ_BASE;
|
|
||||||
free (order);
|
free (order);
|
||||||
|
|
||||||
if (nonconstant_names.exists () && !early)
|
if (nonconstant_names.exists () && !early)
|
||||||
|
@ -1,3 +1,7 @@
|
|||||||
|
2017-11-16 Jan Hubicka <hubicka@ucw.cz>
|
||||||
|
|
||||||
|
* gcc.dg/ipa/ipcp-2.c: Lower threshold.
|
||||||
|
|
||||||
2017-11-16 Martin Sebor <msebor@redhat.com>
|
2017-11-16 Martin Sebor <msebor@redhat.com>
|
||||||
|
|
||||||
PR middle-end/63477
|
PR middle-end/63477
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/* { dg-do compile } */
|
/* { dg-do compile } */
|
||||||
/* { dg-options "-O3 -fipa-cp -fipa-cp-clone -fdump-ipa-cp -fno-early-inlining --param ipa-cp-eval-threshold=100" } */
|
/* { dg-options "-O3 -fipa-cp -fipa-cp-clone -fdump-ipa-cp -fno-early-inlining --param ipa-cp-eval-threshold=80" } */
|
||||||
/* { dg-add-options bind_pic_locally } */
|
/* { dg-add-options bind_pic_locally } */
|
||||||
|
|
||||||
extern int get_stuff (int);
|
extern int get_stuff (int);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user