Commit 852e4bd2 by Jan Hubicka Committed by Jan Hubicka

invoke.texi (-flto-partition, [...]): Document.


	* doc/invoke.texi (-flto-partition, lto-partitions, lto-minpartition):
	Document.
	* opts.c (decode_options): Handle lto partitions.
	* common.opt (flto-partition=1to1, flto-partition=balanced): New.
	* params.def (PARAM_LTO_PARTITIONS, MIN_PARTITION_SIZE): New.

	* lto.c:  Include params.h.
	(add_cgraph_node_to_partition, add_varpool_node_to_partition): Do
	refcounting in aux field.
	(undo_partition, partition_cgraph_node_p, partition_varpool_node_p):
	New functions.
	(lto_1_to_1_map): Simplify.
	(lto_balanced_map): New function.
	(do_whole_program_analysis): Chose proper partitioning alg.
	* Make-lang.in (lto.o): Add dependency on params.h

From-SVN: r164995
parent 5806d9ac
2010-09-29 Jan Hubicka <jh@suse.cz>
2010-10-05 Jan Hubicka <jh@suse.cz>
* doc/invoke.texi (-flto-partition, lto-partitions, lto-minpartition):
Document.
* opts.c (decode_options): Handle lto partitions.
* common.opt (flto-partition=1to1, flto-partition=balanced): New.
* params.def (PARAM_LTO_PARTITIONS, MIN_PARTITION_SIZE): New.
2010-10-05 Jan Hubicka <jh@suse.cz>
* cgraphunit.c (assemble_function): Output thunks and aliases before
the function itself.
......@@ -1049,6 +1049,14 @@ flto
Common Var(flag_lto)
Enable link-time optimization.
flto-partition=1to1
Common Var(flag_lto_partition_1to1)
Partition functions and vars at linktime based on object files they originate from
flto-partition=balanced
Common Var(flag_lto_partition_balanced)
Partition functions and vars at linktime into approximately same sized buckets
; The initial value of -1 comes from Z_DEFAULT_COMPRESSION in zlib.h.
flto-compression-level=
Common Joined RejectNegative UInteger Var(flag_lto_compression_level) Init(-1)
......
......@@ -354,10 +354,10 @@ Objective-C and Objective-C++ Dialects}.
-fno-ira-share-spill-slots -fira-verbose=@var{n} @gol
-fivopts -fkeep-inline-functions -fkeep-static-consts @gol
-floop-block -floop-flatten -floop-interchange -floop-strip-mine @gol
-floop-parallelize-all -flto -flto-compression-level -flto-report @gol
-fltrans -fltrans-output-list -fmerge-all-constants -fmerge-constants @gol
-fmodulo-sched -fmodulo-sched-allow-regmoves -fmove-loop-invariants @gol
-fmudflap -fmudflapir -fmudflapth -fno-branch-count-reg @gol
-floop-parallelize-all -flto -flto-compression-level -flto-partition=@var{alg} @gol
-flto-report -fltrans -fltrans-output-list -fmerge-all-constants @gol
-fmerge-constants -fmodulo-sched -fmodulo-sched-allow-regmoves @gol
-fmove-loop-invariants fmudflap -fmudflapir -fmudflapth -fno-branch-count-reg @gol
-fno-default-inline @gol
-fno-defer-pop -fno-function-cse -fno-guess-branch-probability @gol
-fno-inline -fno-math-errno -fno-peephole -fno-peephole2 @gol
......@@ -7596,6 +7596,13 @@ GNU make.
Disabled by default.
@item -flto-partition=@var{alg}
@opindex flto-partition
Specify partitioning algorithm used by @option{-fwhopr} mode. The value is
either @code{1to1} to specify partitioning corresponding to source files
or @code{balanced} to specify partitioning into, if possible, equally sized
chunks. The default value is @code{balanced}.
@item -fwpa
@opindex fwpa
This is an internal option used by GCC when compiling with
......@@ -8789,6 +8796,16 @@ parameter in order to perform devirtualization.
@option{devirt-type-list-size} is the maximum number of types it
stores per a single formal parameter of a function.
@item lto-partitions
Specify desired nuber of partitions produced during WHOPR copmilation.
Number of partitions should exceed number of CPUs used for compilatoin.
Default value is 32.
@item lto-minpartition
Size of minimal paritition for WHOPR (in estimated instructions).
This prevents expenses of splitting very small programs into too many
partitions.
@end table
@end table
......
2010-10-05 Jan Hubicka <jh@suse.cz>
* lto.c: Include params.h.
(add_cgraph_node_to_partition, add_varpool_node_to_partition): Do
refcounting in aux field.
(undo_partition, partition_cgraph_node_p, partition_varpool_node_p):
New functions.
(lto_1_to_1_map): Simplify.
(lto_balanced_map): New function.
(do_whole_program_analysis): Chose proper partitioning alg.
* Make-lang.in (lto.o): Add dependency on params.h
2010-10-04 Andi Kleen <ak@linux.intel.com>
* Make-lang.in (lto1): Add + to build rule.
......
......@@ -85,7 +85,7 @@ lto/lto.o: lto/lto.c $(CONFIG_H) $(SYSTEM_H) coretypes.h opts.h \
$(CGRAPH_H) $(GGC_H) tree-ssa-operands.h $(TREE_PASS_H) \
langhooks.h $(VEC_H) $(BITMAP_H) pointer-set.h $(IPA_PROP_H) \
$(COMMON_H) debug.h $(TIMEVAR_H) $(GIMPLE_H) $(LTO_H) $(LTO_TREE_H) \
$(LTO_TAGS_H) $(LTO_STREAMER_H) $(SPLAY_TREE_H) gt-lto-lto.h
$(LTO_TAGS_H) $(LTO_STREAMER_H) $(SPLAY_TREE_H) gt-lto-lto.h $(PARAMS_H)
lto/lto-elf.o: lto/lto-elf.c $(CONFIG_H) coretypes.h $(SYSTEM_H) \
toplev.h $(LTO_H) $(TM_H) $(LIBIBERTY_H) $(GGC_H) $(LTO_STREAMER_H)
lto/lto-coff.o: lto/lto-coff.c $(CONFIG_H) coretypes.h $(SYSTEM_H) \
......
......@@ -1081,6 +1081,13 @@ decode_options (unsigned int argc, const char **argv,
error ("LTO support has not been enabled in this configuration");
#endif
}
if (flag_lto_partition_balanced || flag_lto_partition_1to1)
{
if (flag_lto_partition_balanced && flag_lto_partition_1to1)
error ("Only one -flto-partitoin value can be specified");
if (!flag_whopr)
error ("-flto-partitoin has effect only with -fwhopr");
}
/* Reconcile -flto and -fwhopr. Set additional flags as appropriate and
check option consistency. */
......
......@@ -838,6 +838,17 @@ DEFPARAM (PARAM_DEVIRT_TYPE_LIST_SIZE,
"devirtualization",
8, 0, 0)
/* WHOPR partitioning configuration. */
DEFPARAM (PARAM_LTO_PARTITIONS,
"lto-partitions",
"Number of paritions program should be split to",
32, 0, 0)
DEFPARAM (MIN_PARTITION_SIZE,
"lto-min-partition",
"Size of minimal paritition for WHOPR (in estimated instructions)",
1000, 0, 0)
/*
Local variables:
mode:c
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment