bb-reorder.c (connect_traces): Allow copying of blocks within single partition.
authorJan Hubicka <hubicka@ucw.cz>
Thu, 20 Jul 2017 14:27:41 +0000 (16:27 +0200)
committerJan Hubicka <hubicka@gcc.gnu.org>
Thu, 20 Jul 2017 14:27:41 +0000 (14:27 +0000)
* bb-reorder.c (connect_traces): Allow copying of blocks within
single partition.

From-SVN: r250390

gcc/ChangeLog
gcc/bb-reorder.c

index ff8417971bcc03bc03ddaf5eb71e3d074038e766..d489138e2c20c6788f08c78c4bf69292387554c8 100644 (file)
@@ -1,3 +1,8 @@
+2017-07-18  Jan Hubicka  <hubicka@ucw.cz>
+
+       * bb-reorder.c (connect_traces): Allow copying of blocks within
+       single partition.
+
 2017-07-20  Richard Biener  <rguenther@suse.de>
 
        * gimple.h (gimple_phi_result): Add gphi * overload.
index 17a1ea3ed8d8057e52d4f245869b84875a9e0b96..3b7278f2be1243ba35c477601915105e75c3e64d 100644 (file)
@@ -1302,16 +1302,15 @@ connect_traces (int n_traces, struct trace *traces)
                      }
                  }
 
-             if (crtl->has_bb_partition)
-               try_copy = false;
-
              /* Copy tiny blocks always; copy larger blocks only when the
                 edge is traversed frequently enough.  */
              if (try_copy
+                 && BB_PARTITION (best->src) == BB_PARTITION (best->dest)
                  && copy_bb_p (best->dest,
                                optimize_edge_for_speed_p (best)
                                && EDGE_FREQUENCY (best) >= freq_threshold
-                               && best->count >= count_threshold))
+                               && (!best->count.initialized_p ()
+                                   || best->count >= count_threshold)))
                {
                  basic_block new_bb;