]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Backport f48c6014133c8989702458f9082e34ba6dd326d4
authorMartin Liska <mliska@suse.cz>
Mon, 20 Jan 2020 11:11:20 +0000 (12:11 +0100)
committerMartin Liska <mliska@suse.cz>
Mon, 20 Jan 2020 11:11:20 +0000 (12:11 +0100)
Backport from mainline
2020-01-16  Martin Liska  <mliska@suse.cz>

* lto-partition.c (lto_balanced_map): Remember
best_noreorder_pos and then restore to it
when we revert.

gcc/lto/ChangeLog
gcc/lto/lto-partition.c

index e381db79f1703d01195894372230dab2cdbe2c8d..8c715129c11f772c45a631f63c2b5138099b495a 100644 (file)
@@ -1,3 +1,12 @@
+2020-01-20  Martin Liska  <mliska@suse.cz>
+
+       Backport from mainline
+       2020-01-16  Martin Liska  <mliska@suse.cz>
+
+       * lto-partition.c (lto_balanced_map): Remember
+       best_noreorder_pos and then restore to it
+       when we revert.
+
 2019-11-08  Jakub Jelinek  <jakub@redhat.com>
 
        Backported from mainline
index 6972e6e9ef3bab0b9434ede1e9f56d8200cdb409..e4860c746244c04494c0dfbdef6b04cfd2d028b0 100644 (file)
@@ -501,6 +501,7 @@ void
 lto_balanced_map (int n_lto_partitions, int max_partition_size)
 {
   int n_varpool_nodes = 0, varpool_pos = 0, best_varpool_pos = 0;
+  int best_noreorder_pos = 0;
   auto_vec <cgraph_node *> order (symtab->cgraph_count);
   auto_vec<cgraph_node *> noreorder;
   auto_vec<varpool_node *> varpool_order;
@@ -762,6 +763,7 @@ lto_balanced_map (int n_lto_partitions, int max_partition_size)
          best_i = i;
          best_n_nodes = lto_symtab_encoder_size (partition->encoder);
          best_varpool_pos = varpool_pos;
+         best_noreorder_pos = noreorder_pos;
        }
       if (dump_file)
        fprintf (dump_file, "Step %i: added %s/%i, size %i, "
@@ -782,6 +784,7 @@ lto_balanced_map (int n_lto_partitions, int max_partition_size)
                         i - best_i, best_i);
              undo_partition (partition, best_n_nodes);
              varpool_pos = best_varpool_pos;
+             noreorder_pos = best_noreorder_pos;
            }
          gcc_assert (best_size == partition->insns);
          i = best_i;