From e01857197b5fbd660903fe8c0b4c6387780afe10 Mon Sep 17 00:00:00 2001 From: Jan Hubicka Date: Thu, 28 Nov 2019 14:50:19 +0000 Subject: Fix previous commit (that included unrelated changes) This patch fixes profile updates while cloning. When new clone is produced its global profile is subtracted from the original function. If the original function profile drops to 0 we want to switch from global profiles to global0 profiles which is implemented by combine_with_ipa_count_within. However this is done on all edges independnetly and it may happen that we end up combining global and globa0 profiles in one functions which is not a good idea. This implements profile_count::combine_with_ipa_count_within which is able to take into account that the counter is inside function with a given count. * profile-count.h (profile_count::combine_with_ipa_count_within): Declare. * profile-count.c (profile_count::combine_with_ipa_count_within): New. * cgraphclones.c (cgraph_edge::clone, cgraph_node::create_clone): Use it. From-SVN: r278811 --- gcc/cgraphclones.c | 7 ------- 1 file changed, 7 deletions(-) (limited to 'gcc/cgraphclones.c') diff --git a/gcc/cgraphclones.c b/gcc/cgraphclones.c index 64ff1c0..a79491e 100644 --- a/gcc/cgraphclones.c +++ b/gcc/cgraphclones.c @@ -80,11 +80,6 @@ along with GCC; see the file COPYING3. If not see #include "tree-inline.h" #include "dumpfile.h" #include "gimple-pretty-print.h" -#include "alloc-pool.h" -#include "symbol-summary.h" -#include "tree-vrp.h" -#include "ipa-prop.h" -#include "ipa-fnsummary.h" /* Create clone of edge in the node N represented by CALL_EXPR the callgraph. */ @@ -274,8 +269,6 @@ cgraph_node::expand_all_artificial_thunks () thunk->thunk.thunk_p = false; thunk->analyze (); } - ipa_analyze_node (thunk); - inline_analyze_function (thunk); thunk->expand_all_artificial_thunks (); } else -- cgit v1.1