diff options
Diffstat (limited to 'gcc/ipa-inline.c')
-rw-r--r-- | gcc/ipa-inline.c | 25 |
1 files changed, 12 insertions, 13 deletions
diff --git a/gcc/ipa-inline.c b/gcc/ipa-inline.c index 534b330..5c97815 100644 --- a/gcc/ipa-inline.c +++ b/gcc/ipa-inline.c @@ -962,29 +962,28 @@ edge_badness (struct cgraph_edge *edge, bool dump) else if (max_count) { - sreal tmp, relbenefit_real, growth_real; int relbenefit = relative_time_benefit (callee_info, edge, edge_time); /* Capping edge->count to max_count. edge->count can be larger than max_count if an inline adds new edges which increase max_count after max_count is computed. */ gcov_type edge_count = edge->count > max_count ? max_count : edge->count; - sreal_init (&relbenefit_real, relbenefit, 0); - sreal_init (&growth_real, growth, 0); + sreal relbenefit_real (relbenefit, 0); + sreal growth_real (growth, 0); /* relative_edge_count. */ - sreal_init (&tmp, edge_count, 0); - sreal_div (&tmp, &tmp, &max_count_real); + sreal tmp (edge_count, 0); + tmp /= max_count_real; /* relative_time_benefit. */ - sreal_mul (&tmp, &tmp, &relbenefit_real); - sreal_div (&tmp, &tmp, &max_relbenefit_real); + tmp *= relbenefit_real; + tmp /= max_relbenefit_real; /* growth_f_caller. */ - sreal_mul (&tmp, &tmp, &half_int_min_real); - sreal_div (&tmp, &tmp, &growth_real); + tmp *= half_int_min_real; + tmp /= growth_real; - badness = -1 * sreal_to_int (&tmp); + badness = -1 * tmp.to_int (); if (dump) { @@ -1627,9 +1626,9 @@ inline_small_functions (void) if (max_count < edge->count) max_count = edge->count; } - sreal_init (&max_count_real, max_count, 0); - sreal_init (&max_relbenefit_real, RELATIVE_TIME_BENEFIT_RANGE, 0); - sreal_init (&half_int_min_real, INT_MAX / 2, 0); + max_count_real = sreal (max_count, 0); + max_relbenefit_real = sreal (RELATIVE_TIME_BENEFIT_RANGE, 0); + half_int_min_real = sreal (INT_MAX / 2, 0); ipa_free_postorder_info (); initialize_growth_caches (); |