diff options
author | Jan Hubicka <hubicka@ucw.cz> | 2017-11-23 16:52:50 +0100 |
---|---|---|
committer | Jan Hubicka <hubicka@gcc.gnu.org> | 2017-11-23 15:52:50 +0000 |
commit | 8f58dbd171388efd96d61408a1de7b99bd95f627 (patch) | |
tree | 22d72b62c0f87347a223e4d6090806461486ed92 /gcc/cgraphclones.c | |
parent | 120e92fc5e94fc7d18f6d5ff27a33291cc549b9a (diff) | |
download | gcc-8f58dbd171388efd96d61408a1de7b99bd95f627.zip gcc-8f58dbd171388efd96d61408a1de7b99bd95f627.tar.gz gcc-8f58dbd171388efd96d61408a1de7b99bd95f627.tar.bz2 |
cgraphclones.c (cgraph_node::create_clone): Fix updating of profile when inlining.
* cgraphclones.c (cgraph_node::create_clone): Fix updating of profile
when inlining.
From-SVN: r255102
Diffstat (limited to 'gcc/cgraphclones.c')
-rw-r--r-- | gcc/cgraphclones.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/gcc/cgraphclones.c b/gcc/cgraphclones.c index ef39d85..0e7e35b 100644 --- a/gcc/cgraphclones.c +++ b/gcc/cgraphclones.c @@ -428,7 +428,10 @@ cgraph_node::create_clone (tree new_decl, profile_count prof_count, if (new_inlined_to) dump_callgraph_transformation (this, new_inlined_to, "inlining to"); - prof_count = count.combine_with_ipa_count (prof_count); + /* When inlining we scale precisely to prof_count, when cloning we can + preserve local profile. */ + if (!new_inlined_to) + prof_count = count.combine_with_ipa_count (prof_count); new_node->count = prof_count; /* Update IPA profile. Local profiles need no updating in original. */ |