mirror of
git://gcc.gnu.org/git/gcc.git
synced 2025-02-25 17:26:24 +08:00
tree-pass.h (pass_split_functions): Declare.
* tree-pass.h (pass_split_functions): Declare. * opts.c (decode_options): Enable function splitting at -O2 * timevar.def (TV_IPA_FNSPLIT): New macro. * ipa-split.c: New file. * common.opt (-fpartial-inlining): New flag. * Makefile.in (ipa-split.o): New object file. * passes.c (init_optimization_passes): Add ipa-split. * params.def (max-inline-insns-auto): Reduce max-inline-insns-auto to 40. (partial-inlining-entry-probability): New parameters. * doc/invoke.texi (-fpartial-inlining): New. * testsuite/gcc.dg/tree-ssa/ipa-split.c From-SVN: r161382
This commit is contained in:
parent
129473197d
commit
3e485f6245
@ -1,3 +1,15 @@
|
||||
2010-06-25 Jan Hubicka <jh@suse.cz>
|
||||
|
||||
* tree-pass.h (pass_split_functions): Declare.
|
||||
* opts.c (decode_options): Enable function splitting at -O2
|
||||
* timevar.def (TV_IPA_FNSPLIT): New macro.
|
||||
* ipa-split.c: New file.
|
||||
* common.opt (-fpartial-inlining): New flag.
|
||||
* Makefile.in (ipa-split.o): New object file.
|
||||
* passes.c (init_optimization_passes): Add ipa-split.
|
||||
* params.def (partial-inlining-entry-probability): New parameters.
|
||||
* doc/invoke.texi (-fpartial-inlining): New.
|
||||
|
||||
2010-06-25 Manuel López-Ibáñez <manu@gcc.gnu.org>
|
||||
|
||||
PR 44665
|
||||
|
@ -1441,6 +1441,7 @@ OBJS-archive = \
|
||||
cppdefault.o \
|
||||
incpath.o \
|
||||
ipa-cp.o \
|
||||
ipa-split.o \
|
||||
ipa-inline.o \
|
||||
ipa-prop.o \
|
||||
ipa-pure-const.o \
|
||||
@ -3003,6 +3004,10 @@ ipa-cp.o : ipa-cp.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \
|
||||
$(TREE_H) $(TARGET_H) $(CGRAPH_H) $(IPA_PROP_H) $(TREE_FLOW_H) \
|
||||
$(TREE_PASS_H) $(FLAGS_H) $(TIMEVAR_H) $(DIAGNOSTIC_H) $(TREE_DUMP_H) \
|
||||
$(TREE_INLINE_H) $(FIBHEAP_H) $(PARAMS_H) tree-pretty-print.h
|
||||
ipa-split.o : ipa-split.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \
|
||||
$(TREE_H) $(TARGET_H) $(CGRAPH_H) $(IPA_PROP_H) $(TREE_FLOW_H) \
|
||||
$(TREE_PASS_H) $(FLAGS_H) $(TIMEVAR_H) $(DIAGNOSTIC_H) $(TREE_DUMP_H) \
|
||||
$(TREE_INLINE_H) $(FIBHEAP_H) $(PARAMS_H)
|
||||
matrix-reorg.o : matrix-reorg.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \
|
||||
$(TM_H) $(TREE_H) $(RTL_H) $(TREE_INLINE_H) $(TREE_FLOW_H) \
|
||||
tree-flow-inline.h langhooks.h $(HASHTAB_H) $(TOPLEV_H) $(FLAGS_H) $(GGC_H) \
|
||||
|
@ -884,6 +884,10 @@ foptimize-sibling-calls
|
||||
Common Report Var(flag_optimize_sibling_calls) Optimization
|
||||
Optimize sibling and tail recursive calls
|
||||
|
||||
fpartial-inlining
|
||||
Common Report Var(flag_partial_inlining)
|
||||
Perform partial inlining
|
||||
|
||||
fpre-ipa-mem-report
|
||||
Common Report Var(pre_ipa_mem_report)
|
||||
Report on memory allocation before interprocedural optimization
|
||||
|
@ -362,7 +362,7 @@ Objective-C and Objective-C++ Dialects}.
|
||||
-fno-sched-interblock -fno-sched-spec -fno-signed-zeros @gol
|
||||
-fno-toplevel-reorder -fno-trapping-math -fno-zero-initialized-in-bss @gol
|
||||
-fomit-frame-pointer -foptimize-register-move -foptimize-sibling-calls @gol
|
||||
-fpeel-loops -fpredictive-commoning -fprefetch-loop-arrays @gol
|
||||
-fpartial-inlining -fpeel-loops -fpredictive-commoning -fprefetch-loop-arrays @gol
|
||||
-fprofile-correction -fprofile-dir=@var{path} -fprofile-generate @gol
|
||||
-fprofile-generate=@var{path} @gol
|
||||
-fprofile-use -fprofile-use=@var{path} -fprofile-values @gol
|
||||
@ -5870,6 +5870,7 @@ also turns on the following optimization flags:
|
||||
-findirect-inlining @gol
|
||||
-fipa-sra @gol
|
||||
-foptimize-sibling-calls @gol
|
||||
-fpartial-inlining @gol
|
||||
-fpeephole2 @gol
|
||||
-fregmove @gol
|
||||
-freorder-blocks -freorder-functions @gol
|
||||
@ -7027,6 +7028,14 @@ This optimization is enabled by default.
|
||||
With this option, the compiler will create multiple copies of some
|
||||
local variables when unrolling a loop which can result in superior code.
|
||||
|
||||
@item -fpartial-inlining
|
||||
@opindex fpartial-inlining
|
||||
Inline parts of functions. This option has any effect only
|
||||
when inlining itself is turned on by the @option{-finline-functions}
|
||||
or @option{-finline-small-functions} options.
|
||||
|
||||
Enabled at level @option{-O2}.
|
||||
|
||||
@item -fpredictive-commoning
|
||||
@opindex fpredictive-commoning
|
||||
Perform predictive commoning optimization, i.e., reusing computations
|
||||
|
1070
gcc/ipa-split.c
1070
gcc/ipa-split.c
File diff suppressed because it is too large
Load Diff
@ -825,6 +825,7 @@ decode_options (unsigned int argc, const char **argv,
|
||||
opt2 = (optimize >= 2);
|
||||
flag_inline_small_functions = opt2;
|
||||
flag_indirect_inlining = opt2;
|
||||
flag_partial_inlining = opt2;
|
||||
flag_thread_jumps = opt2;
|
||||
flag_crossjumping = opt2;
|
||||
flag_optimize_sibling_calls = opt2;
|
||||
|
@ -117,6 +117,12 @@ DEFPARAM (PARAM_EARLY_INLINER_MAX_ITERATIONS,
|
||||
"The maximum number of nested indirect inlining performed by early inliner",
|
||||
10, 0, 0)
|
||||
|
||||
/* Limit on probability of entry BB. */
|
||||
DEFPARAM (PARAM_PARTIAL_INLINING_ENTRY_PROBABILITY,
|
||||
"partial-inlining-entry-probability",
|
||||
"Maximum probability of the entry BB of split region (in percent relative to entry BB of the function) to make partial inlining happen",
|
||||
70, 0, 0)
|
||||
|
||||
/* Limit the number of expansions created by the variable expansion
|
||||
optimization to avoid register pressure. */
|
||||
DEFPARAM (PARAM_MAX_VARIABLE_EXPANSIONS,
|
||||
|
@ -795,6 +795,10 @@ init_optimization_passes (void)
|
||||
NEXT_PASS (pass_cleanup_eh);
|
||||
NEXT_PASS (pass_profile);
|
||||
NEXT_PASS (pass_local_pure_const);
|
||||
/* Split functions creates parts that are not run through
|
||||
early optimizations again. It is thus good idea to do this
|
||||
late. */
|
||||
NEXT_PASS (pass_split_functions);
|
||||
}
|
||||
NEXT_PASS (pass_release_ssa_names);
|
||||
NEXT_PASS (pass_rebuild_cgraph_edges);
|
||||
|
@ -1,3 +1,7 @@
|
||||
2010-06-25 Jan Hubicka <jh@suse.cz>
|
||||
|
||||
* testsuite/gcc.dg/tree-ssa/ipa-split-1.c
|
||||
|
||||
2010-06-25 Martin Jambor <mjambor@suse.cz>
|
||||
|
||||
* g++.dg/ipa/iinline-2.C: New test.
|
||||
|
29
gcc/testsuite/gcc.dg/tree-ssa/ipa-split-1.c
Normal file
29
gcc/testsuite/gcc.dg/tree-ssa/ipa-split-1.c
Normal file
@ -0,0 +1,29 @@
|
||||
/* { dg-do compile } */
|
||||
/* { dg-options "-O3 -fdump-tree-fnsplit" } */
|
||||
int test2(a)
|
||||
{
|
||||
if (a<100)
|
||||
return 1;
|
||||
do_something_big ();
|
||||
do_something_big ();
|
||||
do_something_big ();
|
||||
do_something_big ();
|
||||
do_something_big ();
|
||||
do_something_big ();
|
||||
do_something_big ();
|
||||
do_something_big ();
|
||||
do_something_big ();
|
||||
do_something_big ();
|
||||
do_something_big ();
|
||||
do_something_big ();
|
||||
do_something_big ();
|
||||
return 0;
|
||||
}
|
||||
|
||||
test()
|
||||
{
|
||||
test2(10);
|
||||
test2(20);
|
||||
}
|
||||
/* { dg-final { scan-tree-dump-times "Splitting function" 1 "fnsplit"} } */
|
||||
/* { dg-final { cleanup-tree-dump "fnsplit" } } */
|
@ -52,6 +52,7 @@ DEFTIMEVAR (TV_CGRAPH , "callgraph construction")
|
||||
DEFTIMEVAR (TV_CGRAPHOPT , "callgraph optimization")
|
||||
DEFTIMEVAR (TV_VARPOOL , "varpool construction")
|
||||
DEFTIMEVAR (TV_IPA_CONSTANT_PROP , "ipa cp")
|
||||
DEFTIMEVAR (TV_IPA_FNSPLIT , "ipa function splitting")
|
||||
DEFTIMEVAR (TV_IPA_LTO_GIMPLE_IO , "ipa lto gimple I/O")
|
||||
DEFTIMEVAR (TV_IPA_LTO_DECL_IO , "ipa lto decl I/O")
|
||||
DEFTIMEVAR (TV_IPA_LTO_DECL_INIT_IO , "ipa lto decl init I/O")
|
||||
|
@ -442,6 +442,7 @@ extern struct gimple_opt_pass pass_build_cgraph_edges;
|
||||
extern struct gimple_opt_pass pass_local_pure_const;
|
||||
extern struct gimple_opt_pass pass_tracer;
|
||||
extern struct gimple_opt_pass pass_warn_unused_result;
|
||||
extern struct gimple_opt_pass pass_split_functions;
|
||||
|
||||
/* IPA Passes */
|
||||
extern struct simple_ipa_opt_pass pass_ipa_function_and_variable_visibility;
|
||||
|
Loading…
Reference in New Issue
Block a user