aboutsummaryrefslogtreecommitdiff
path: root/gcc/lto
diff options
context:
space:
mode:
authorPrathamesh Kulkarni <prathamesh.kulkarni@linaro.org>2016-04-27 10:46:16 +0000
committerPrathamesh Kulkarni <prathamesh3492@gcc.gnu.org>2016-04-27 10:46:16 +0000
commita2e76867ad58dd0d7b5e09b95533029ad0659202 (patch)
tree29c4c51dbc69ddde40d943dea16d9ac6289ef443 /gcc/lto
parent2b78f22152e0af0612433f2bdf1d9eae76bfd843 (diff)
downloadgcc-a2e76867ad58dd0d7b5e09b95533029ad0659202.zip
gcc-a2e76867ad58dd0d7b5e09b95533029ad0659202.tar.gz
gcc-a2e76867ad58dd0d7b5e09b95533029ad0659202.tar.bz2
params.def (MAX_PARTITION_SIZE): New param.
2016-04-27 Prathamesh Kulkarni <prathamesh.kulkarni@linaro.org> * params.def (MAX_PARTITION_SIZE): New param. * invoke.texi: Document lto-max-partition. lto/ * lto-partition.h (lto_balanced_map): New parameter. * lto-partition.c (lto_balanced_map): New parameter max_partition_size. Check if partition size is greater than max_partition_size. * lto.c (do_whole_program_analysis): Adjust calls to lto_balanced_map() to pass 2nd argument. From-SVN: r235478
Diffstat (limited to 'gcc/lto')
-rw-r--r--gcc/lto/ChangeLog9
-rw-r--r--gcc/lto/lto-partition.c8
-rw-r--r--gcc/lto/lto-partition.h2
-rw-r--r--gcc/lto/lto.c5
4 files changed, 19 insertions, 5 deletions
diff --git a/gcc/lto/ChangeLog b/gcc/lto/ChangeLog
index dbb69a2..b1421cb 100644
--- a/gcc/lto/ChangeLog
+++ b/gcc/lto/ChangeLog
@@ -1,3 +1,12 @@
+2016-04-27 Prathamesh Kulkarni <prathamesh.kulkarni@linaro.org>
+
+ * lto-partition.h (lto_balanced_map): New parameter.
+ * lto-partition.c (lto_balanced_map): New parameter
+ max_partition_size.
+ Check if partition size is greater than max_partition_size.
+ * lto.c (do_whole_program_analysis): Adjust calls to
+ lto_balanced_map() to pass 2nd argument.
+
2016-03-17 H.J. Lu <hongjiu.lu@intel.com>
PR lto/70258
diff --git a/gcc/lto/lto-partition.c b/gcc/lto/lto-partition.c
index 9eb63c2..c191d24 100644
--- a/gcc/lto/lto-partition.c
+++ b/gcc/lto/lto-partition.c
@@ -447,7 +447,7 @@ add_sorted_nodes (vec<symtab_node *> &next_nodes, ltrans_partition partition)
and in-partition calls was reached. */
void
-lto_balanced_map (int n_lto_partitions)
+lto_balanced_map (int n_lto_partitions, int max_partition_size)
{
int n_nodes = 0;
int n_varpool_nodes = 0, varpool_pos = 0, best_varpool_pos = 0;
@@ -511,6 +511,9 @@ lto_balanced_map (int n_lto_partitions)
varpool_order.qsort (varpool_node_cmp);
/* Compute partition size and create the first partition. */
+ if (PARAM_VALUE (MIN_PARTITION_SIZE) > max_partition_size)
+ fatal_error (input_location, "min partition size cannot be greater than max partition size");
+
partition_size = total_size / n_lto_partitions;
if (partition_size < PARAM_VALUE (MIN_PARTITION_SIZE))
partition_size = PARAM_VALUE (MIN_PARTITION_SIZE);
@@ -719,7 +722,8 @@ lto_balanced_map (int n_lto_partitions)
best_cost, best_internal, best_i);
/* Partition is too large, unwind into step when best cost was reached and
start new partition. */
- if (partition->insns > 2 * partition_size)
+ if (partition->insns > 2 * partition_size
+ || partition->insns > max_partition_size)
{
if (best_i != i)
{
diff --git a/gcc/lto/lto-partition.h b/gcc/lto/lto-partition.h
index 31e3764..f7abe62 100644
--- a/gcc/lto/lto-partition.h
+++ b/gcc/lto/lto-partition.h
@@ -35,7 +35,7 @@ extern vec<ltrans_partition> ltrans_partitions;
void lto_1_to_1_map (void);
void lto_max_map (void);
-void lto_balanced_map (int);
+void lto_balanced_map (int, 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 9dd513f..af735cb 100644
--- a/gcc/lto/lto.c
+++ b/gcc/lto/lto.c
@@ -3117,9 +3117,10 @@ do_whole_program_analysis (void)
else if (flag_lto_partition == LTO_PARTITION_MAX)
lto_max_map ();
else if (flag_lto_partition == LTO_PARTITION_ONE)
- lto_balanced_map (1);
+ lto_balanced_map (1, INT_MAX);
else if (flag_lto_partition == LTO_PARTITION_BALANCED)
- lto_balanced_map (PARAM_VALUE (PARAM_LTO_PARTITIONS));
+ lto_balanced_map (PARAM_VALUE (PARAM_LTO_PARTITIONS),
+ PARAM_VALUE (MAX_PARTITION_SIZE));
else
gcc_unreachable ();