aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-cfg.c
diff options
context:
space:
mode:
authorJan Hubicka <hubicka@ucw.cz>2017-11-17 18:41:10 +0100
committerJan Hubicka <hubicka@gcc.gnu.org>2017-11-17 17:41:10 +0000
commit35cd23ebb6d05e1325bd165679be44192f51ba05 (patch)
tree32b8e14f5ff1f5c5cd92e3e8003cc598ed02cc51 /gcc/tree-cfg.c
parent6566b0fb86addb5c28d3ff8b2631f7f9516d4054 (diff)
downloadgcc-35cd23ebb6d05e1325bd165679be44192f51ba05.zip
gcc-35cd23ebb6d05e1325bd165679be44192f51ba05.tar.gz
gcc-35cd23ebb6d05e1325bd165679be44192f51ba05.tar.bz2
ipa-cp.c (update_profiling_info): Handle conversion to local profile.
* ipa-cp.c (update_profiling_info): Handle conversion to local profile. * tree-cfg.c (execute_fixup_cfg): Do fixup same way as inliner does. From-SVN: r254885
Diffstat (limited to 'gcc/tree-cfg.c')
-rw-r--r--gcc/tree-cfg.c17
1 files changed, 4 insertions, 13 deletions
diff --git a/gcc/tree-cfg.c b/gcc/tree-cfg.c
index f448550..491ac05 100644
--- a/gcc/tree-cfg.c
+++ b/gcc/tree-cfg.c
@@ -9227,14 +9227,13 @@ execute_fixup_cfg (void)
gimple_stmt_iterator gsi;
int todo = 0;
cgraph_node *node = cgraph_node::get (current_function_decl);
- profile_count num = node->count.ipa ();
+ profile_count num = node->count;
profile_count den = ENTRY_BLOCK_PTR_FOR_FN (cfun)->count;
- bool scale = num.initialized_p () && den.ipa_p ()
- && (den.nonzero_p () || num == profile_count::zero ())
- && !(num == den.ipa ());
+ bool scale = num.initialized_p () && !(num == den);
if (scale)
{
+ profile_count::adjust_for_ipa_scaling (&num, &den);
ENTRY_BLOCK_PTR_FOR_FN (cfun)->count = node->count;
EXIT_BLOCK_PTR_FOR_FN (cfun)->count
= EXIT_BLOCK_PTR_FOR_FN (cfun)->count.apply_scale (num, den);
@@ -9243,15 +9242,7 @@ execute_fixup_cfg (void)
FOR_EACH_BB_FN (bb, cfun)
{
if (scale)
- {
- if (num == profile_count::zero ())
- {
- if (!(bb->count == profile_count::zero ()))
- bb->count = bb->count.global0 ();
- }
- else
- bb->count = bb->count.apply_scale (num, den);
- }
+ bb->count = bb->count.apply_scale (num, den);
for (gsi = gsi_start_bb (bb); !gsi_end_p (gsi);)
{
gimple *stmt = gsi_stmt (gsi);