From 23ff8c05804c2d3fc6e9179d2e9c2940ae53d592 Mon Sep 17 00:00:00 2001 From: Jan Hubicka Date: Sat, 16 Nov 2019 10:51:09 +0100 Subject: [PATCH] Fix nonspec_time when there is no cached value. * ipa-inline.h (do_estimate_edge_time): Add nonspec_time parameter. (estimate_edge_time): Use it. * ipa-inline-analysis.c (do_estimate_edge_time): Add ret_nonspec_time parameter. From-SVN: r278333 --- gcc/ChangeLog | 8 ++++++++ gcc/ipa-inline-analysis.c | 4 +++- gcc/ipa-inline.h | 4 ++-- 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index ef62b5dee44..db51b839b54 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,11 @@ +2019-11-15 Jan Hubicka + + * ipa-inline.h (do_estimate_edge_time): Add nonspec_time + parameter. + (estimate_edge_time): Use it. + * ipa-inline-analysis.c (do_estimate_edge_time): Add + ret_nonspec_time parameter. + 2019-11-15 Szabolcs Nagy * config/m68k/linux.h (MUSL_DYNAMIC_LINKER): Define. diff --git a/gcc/ipa-inline-analysis.c b/gcc/ipa-inline-analysis.c index 1e124fd6ca9..d550d30dc20 100644 --- a/gcc/ipa-inline-analysis.c +++ b/gcc/ipa-inline-analysis.c @@ -179,7 +179,7 @@ simple_edge_hints (struct cgraph_edge *edge) size, since we always need both metrics eventually. */ sreal -do_estimate_edge_time (struct cgraph_edge *edge) +do_estimate_edge_time (struct cgraph_edge *edge, sreal *ret_nonspec_time) { sreal time, nonspec_time; int size; @@ -275,6 +275,8 @@ do_estimate_edge_time (struct cgraph_edge *edge) hints |= simple_edge_hints (edge); entry->hints = hints + 1; } + if (ret_nonspec_time) + *ret_nonspec_time = nonspec_time; return time; } diff --git a/gcc/ipa-inline.h b/gcc/ipa-inline.h index f650b0e83fa..626f264d5d0 100644 --- a/gcc/ipa-inline.h +++ b/gcc/ipa-inline.h @@ -46,7 +46,7 @@ int estimate_size_after_inlining (struct cgraph_node *, struct cgraph_edge *); int estimate_growth (struct cgraph_node *); bool growth_positive_p (struct cgraph_node *, struct cgraph_edge *, int); int do_estimate_edge_size (struct cgraph_edge *edge); -sreal do_estimate_edge_time (struct cgraph_edge *edge); +sreal do_estimate_edge_time (struct cgraph_edge *edge, sreal *nonspec_time = NULL); ipa_hints do_estimate_edge_hints (struct cgraph_edge *edge); void reset_node_cache (struct cgraph_node *node); void initialize_growth_caches (); @@ -99,7 +99,7 @@ estimate_edge_time (struct cgraph_edge *edge, sreal *nonspec_time = NULL) if (edge_growth_cache == NULL || (entry = edge_growth_cache->get (edge)) == NULL || entry->time == 0) - return do_estimate_edge_time (edge); + return do_estimate_edge_time (edge, nonspec_time); if (nonspec_time) *nonspec_time = edge_growth_cache->get (edge)->nonspec_time; return entry->time; -- 2.30.2