* tree-ssa-sink.c (select_best_block): Do not use frequencies.
authorJan Hubicka <hubicka@ucw.cz>
Mon, 13 Nov 2017 17:27:13 +0000 (18:27 +0100)
committerJan Hubicka <hubicka@gcc.gnu.org>
Mon, 13 Nov 2017 17:27:13 +0000 (17:27 +0000)
From-SVN: r254698

gcc/ChangeLog
gcc/tree-ssa-sink.c

index 241e9ca6ab1e7bfe5503affc0693d2a8973a00b7..beb406a94568a4bc512f2ecf8e271b9a490c5fa6 100644 (file)
@@ -1,3 +1,7 @@
+2017-11-13  Jan Hubicka  <hubicka@ucw.cz>
+
+       * tree-ssa-sink.c (select_best_block): Do not use frequencies.
+
 2017-11-13  Eric Botcazou  <ebotcazou@adacore.com>
 
        PR lto/81351
index 1c5d7dd7556172e8913581bf4c8bf5fb9d1e01d4..5d801d35921e4466d3d1a5bc595330dad5671d61 100644 (file)
@@ -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