aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan Hubicka <hubicka@ucw.cz>2019-11-28 14:16:29 +0000
committerJan Hubicka <hubicka@ucw.cz>2019-11-28 14:16:29 +0000
commitae7484f263eb1d68267cb5bab1218e5995c98fad (patch)
tree1b369fe4ab34e8c32e7a5d12359071914699caa1
parent8cad591797fe7767e37096fbe772b6551b94a332 (diff)
* ipa-cp.c (update_profiling_info): Fix scaling.
git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@278808 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/ChangeLog4
-rw-r--r--gcc/ipa-cp.c10
2 files changed, 12 insertions, 2 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index fe76b3e2b4a..9897c0e604e 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,7 @@
+2019-11-28 Jan Hubicka <hubicka@ucw.cz>
+
+ * ipa-cp.c (update_profiling_info): Fix scaling.
+
2019-11-28 Richard Biener <rguenther@suse.de>
PR tree-optimization/92645
diff --git a/gcc/ipa-cp.c b/gcc/ipa-cp.c
index 31a98a3d98a..b13322827b6 100644
--- a/gcc/ipa-cp.c
+++ b/gcc/ipa-cp.c
@@ -4091,6 +4091,7 @@ update_profiling_info (struct cgraph_node *orig_node,
struct caller_statistics stats;
profile_count new_sum, orig_sum;
profile_count remainder, orig_node_count = orig_node->count;
+ profile_count orig_new_node_count = new_node->count;
if (!(orig_node_count.ipa () > profile_count::zero ()))
return;
@@ -4128,15 +4129,20 @@ update_profiling_info (struct cgraph_node *orig_node,
remainder = orig_node_count.combine_with_ipa_count (orig_node_count.ipa ()
- new_sum.ipa ());
new_sum = orig_node_count.combine_with_ipa_count (new_sum);
+ new_node->count = new_sum;
orig_node->count = remainder;
- profile_count::adjust_for_ipa_scaling (&new_sum, &orig_node_count);
+ profile_count::adjust_for_ipa_scaling (&new_sum, &orig_new_node_count);
for (cs = new_node->callees; cs; cs = cs->next_callee)
- cs->count = cs->count.apply_scale (new_sum, orig_node_count);
+ cs->count = cs->count.apply_scale (new_sum, orig_new_node_count);
+ for (cs = new_node->indirect_calls; cs; cs = cs->next_callee)
+ cs->count = cs->count.apply_scale (new_sum, orig_new_node_count);
profile_count::adjust_for_ipa_scaling (&remainder, &orig_node_count);
for (cs = orig_node->callees; cs; cs = cs->next_callee)
cs->count = cs->count.apply_scale (remainder, orig_node_count);
+ for (cs = orig_node->indirect_calls; cs; cs = cs->next_callee)
+ cs->count = cs->count.apply_scale (remainder, orig_node_count);
if (dump_file)
dump_profile_updates (orig_node, new_node);