diff options
Diffstat (limited to 'gcc/tree-inline.c')
-rw-r--r-- | gcc/tree-inline.c | 24 |
1 files changed, 2 insertions, 22 deletions
diff --git a/gcc/tree-inline.c b/gcc/tree-inline.c index 7ef1072..fc5d2c7 100644 --- a/gcc/tree-inline.c +++ b/gcc/tree-inline.c @@ -1771,17 +1771,7 @@ copy_bb (copy_body_data *id, basic_block bb, tree decl; basic_block prev; - /* We always must scale to be sure counters end up compatible. - If den is zero, just force it nonzero and hope for reasonable - approximation. - When num is forced nonzero, also update den, so we do not scale profile - to 0. */ - if (!(num == den) - && !(den.force_nonzero () == den)) - { - den = den.force_nonzero (); - num = num.force_nonzero (); - } + profile_count::adjust_for_ipa_scaling (&num, &den); /* Search for previous copied basic block. */ prev = bb->prev_bb; @@ -2698,17 +2688,7 @@ copy_cfg_body (copy_body_data * id, profile_count, profile_count den = ENTRY_BLOCK_PTR_FOR_FN (src_cfun)->count; profile_count num = entry_block_map->count; - /* We always must scale to be sure counters end up compatible. - If den is zero, just force it nonzero and hope for reasonable - approximation. - When num is forced nonzero, also update den, so we do not scale profile - to 0. */ - if (!(num == den) - && !(den.force_nonzero () == den)) - { - den = den.force_nonzero (); - num = num.force_nonzero (); - } + profile_count::adjust_for_ipa_scaling (&num, &den); cfun_to_copy = id->src_cfun = DECL_STRUCT_FUNCTION (callee_fndecl); |