From d4017fd365a9f56d98dd6a4287b447ae12c423db Mon Sep 17 00:00:00 2001 From: Jan Hubicka Date: Mon, 13 Nov 2017 18:27:13 +0100 Subject: [PATCH] * tree-ssa-sink.c (select_best_block): Do not use frequencies. From-SVN: r254698 --- gcc/ChangeLog | 4 ++++ gcc/tree-ssa-sink.c | 6 ++++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 241e9ca6ab1..beb406a9456 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,7 @@ +2017-11-13 Jan Hubicka + + * tree-ssa-sink.c (select_best_block): Do not use frequencies. + 2017-11-13 Eric Botcazou PR lto/81351 diff --git a/gcc/tree-ssa-sink.c b/gcc/tree-ssa-sink.c index 1c5d7dd7556..5d801d35921 100644 --- a/gcc/tree-ssa-sink.c +++ b/gcc/tree-ssa-sink.c @@ -226,8 +226,10 @@ select_best_block (basic_block early_bb, /* If BEST_BB is at the same nesting level, then require it to have significantly lower execution frequency to avoid gratutious movement. */ if (bb_loop_depth (best_bb) == bb_loop_depth (early_bb) - && best_bb->count.to_frequency (cfun) - < (early_bb->count.to_frequency (cfun) * threshold / 100.0)) + /* If result of comparsion is unknown, preffer EARLY_BB. + Thus use !(...>=..) rather than (...<...) */ + && !(best_bb->count.apply_scale (100, 1) + > (early_bb->count.apply_scale (threshold, 1)))) return best_bb; /* No better block found, so return EARLY_BB, which happens to be the -- 2.30.2