===================================================================
@@ -428,7 +428,10 @@ cgraph_node::create_clone (tree new_decl
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. */