bb-reorer.c (find_rarely_executed_basic_blocks_and_crossin_edges): trust precise...
authorJan Hubicka <jh@suse.cz>
Sun, 2 Dec 2018 15:39:45 +0000 (16:39 +0100)
committerJan Hubicka <hubicka@gcc.gnu.org>
Sun, 2 Dec 2018 15:39:45 +0000 (15:39 +0000)
* bb-reorer.c (find_rarely_executed_basic_blocks_and_crossin_edges):
trust precise profiles.

From-SVN: r266726

gcc/ChangeLog
gcc/bb-reorder.c

index a724451eb55a15706d18930f2479c3a2c04c2c0e..c143ee13a486a0228fc30bdda2d9c68ce449bd2f 100644 (file)
@@ -1,3 +1,8 @@
+2018-12-02  Jan Hubicka  <jh@suse.cz>
+
+       * bb-reorer.c (find_rarely_executed_basic_blocks_and_crossin_edges):
+       trust precise profiles.
+
 2018-12-02  Jakub Jelinek  <jakub@redhat.com>
 
        * tree-nested.c (convert_nonlocal_omp_clauses,
index e20df1607233a6cbb4e6452d4e32ea4e43c60214..aaea525b69e50c0789483bfb522fb243555b24e3 100644 (file)
@@ -1663,17 +1663,19 @@ find_rarely_executed_basic_blocks_and_crossing_edges (void)
 
       if (probably_never_executed_bb_p (cfun, bb))
         {
+          cold_bb = true;
+
           /* Handle profile insanities created by upstream optimizations
              by also checking the incoming edge weights. If there is a non-cold
              incoming edge, conservatively prevent this block from being split
              into the cold section.  */
-          cold_bb = true;
-          FOR_EACH_EDGE (e, ei, bb->preds)
-            if (!probably_never_executed_edge_p (cfun, e))
-              {
-                cold_bb = false;
-                break;
-              }
+         if (!bb->count.precise_p ())
+           FOR_EACH_EDGE (e, ei, bb->preds)
+             if (!probably_never_executed_edge_p (cfun, e))
+               {
+                 cold_bb = false;
+                 break;
+               }
         }
       if (cold_bb)
         {