diff options
Diffstat (limited to 'gcc/lto')
-rw-r--r-- | gcc/lto/ChangeLog | 9 | ||||
-rw-r--r-- | gcc/lto/lto-partition.c | 9 | ||||
-rw-r--r-- | gcc/lto/lto-partition.h | 2 | ||||
-rw-r--r-- | gcc/lto/lto.c | 11 |
4 files changed, 22 insertions, 9 deletions
diff --git a/gcc/lto/ChangeLog b/gcc/lto/ChangeLog index 4200a47..d0e14c1 100644 --- a/gcc/lto/ChangeLog +++ b/gcc/lto/ChangeLog @@ -1,3 +1,12 @@ +2014-04-15 Richard Biener <rguenther@suse.de> + + * lto.c: Include params.h. + (do_whole_program_analysis): Switch on flag_lto_partition value, + add support for LTO_PARTITION_ONE. + * lto-partition.h (lto_balanced_map): Adjust. + * lto-partition.c (lto_balanced_map): Get number of desired + partitions as argument to support -flto-partition=one. + 2014-04-14 Jan Hubicka <hubicka@ucw.cz> * lto/lto-symtab.c (lto_cgraph_replace_node): Don't re-merge diff --git a/gcc/lto/lto-partition.c b/gcc/lto/lto-partition.c index 1ee5fbb..bb59434 100644 --- a/gcc/lto/lto-partition.c +++ b/gcc/lto/lto-partition.c @@ -415,7 +415,7 @@ varpool_node_cmp (const void *pa, const void *pb) and in-partition calls was reached. */ void -lto_balanced_map (void) +lto_balanced_map (int n_lto_partitions) { int n_nodes = 0; int n_varpool_nodes = 0, varpool_pos = 0, best_varpool_pos = 0; @@ -472,7 +472,7 @@ lto_balanced_map (void) } /* Compute partition size and create the first partition. */ - partition_size = total_size / PARAM_VALUE (PARAM_LTO_PARTITIONS); + partition_size = total_size / n_lto_partitions; if (partition_size < PARAM_VALUE (MIN_PARTITION_SIZE)) partition_size = PARAM_VALUE (MIN_PARTITION_SIZE); npartitions = 1; @@ -699,9 +699,8 @@ lto_balanced_map (void) /* Since the size of partitions is just approximate, update the size after we finished current one. */ - if (npartitions < PARAM_VALUE (PARAM_LTO_PARTITIONS)) - partition_size = total_size - / (PARAM_VALUE (PARAM_LTO_PARTITIONS) - npartitions); + if (npartitions < n_lto_partitions) + partition_size = total_size / (n_lto_partitions - npartitions); else partition_size = INT_MAX; diff --git a/gcc/lto/lto-partition.h b/gcc/lto/lto-partition.h index 770111d..8db61b3 100644 --- a/gcc/lto/lto-partition.h +++ b/gcc/lto/lto-partition.h @@ -34,7 +34,7 @@ extern vec<ltrans_partition> ltrans_partitions; void lto_1_to_1_map (void); void lto_max_map (void); -void lto_balanced_map (void); +void lto_balanced_map (int); void lto_promote_cross_file_statics (void); void free_ltrans_partitions (void); void lto_promote_statics_nonwpa (void); diff --git a/gcc/lto/lto.c b/gcc/lto/lto.c index ee6a28a..ec711ce 100644 --- a/gcc/lto/lto.c +++ b/gcc/lto/lto.c @@ -50,6 +50,7 @@ along with GCC; see the file COPYING3. If not see #include "context.h" #include "pass_manager.h" #include "ipa-inline.h" +#include "params.h" /* Number of parallel tasks to run, -1 if we want to use GNU Make jobserver. */ @@ -3267,12 +3268,16 @@ do_whole_program_analysis (void) timevar_pop (TV_WHOPR_WPA); timevar_push (TV_WHOPR_PARTITIONING); - if (flag_lto_partition_1to1) + if (flag_lto_partition == LTO_PARTITION_1TO1) lto_1_to_1_map (); - else if (flag_lto_partition_max) + else if (flag_lto_partition == LTO_PARTITION_MAX) lto_max_map (); + else if (flag_lto_partition == LTO_PARTITION_ONE) + lto_balanced_map (1); + else if (flag_lto_partition == LTO_PARTITION_BALANCED) + lto_balanced_map (PARAM_VALUE (PARAM_LTO_PARTITIONS)); else - lto_balanced_map (); + gcc_unreachable (); /* Inline summaries are needed for balanced partitioning. Free them now so the memory can be used for streamer caches. */ |