Commit 96327cdc by Jan Hubicka Committed by Jan Hubicka

toplev.c (flag_loop_optimize, [...]): New static variables.

	* toplev.c (flag_loop_optimize, flag_crossjumping):
	New static variables.
	(rest_of_compilation): Conditionalize crossjumping and
	loop optimizer.
	(parse_options_and_default_flags): Default loop_optimize and
	crossjumping.
	(lang_independent_options): Add -fcrossjumping and -floop-optimize
	* invoke.texi (crossjumping, loop-optimize): Document.

From-SVN: r51175
parent bc185257
Fri Mar 22 16:30:42 CET 2002 Jan Hubicka <jh@suse.cz>
* toplev.c (flag_loop_optimize, flag_crossjumping):
New static variables.
(rest_of_compilation): Conditionalize crossjumping and
loop optimizer.
(parse_options_and_default_flags): Default loop_optimize and
crossjumping.
(lang_independent_options): Add -fcrossjumping and -floop-optimize
* invoke.texi (crossjumping, loop-optimize): Document.
2002-03-22 Richard Sandiford <rsandifo@redhat.com> 2002-03-22 Richard Sandiford <rsandifo@redhat.com>
* real.c (eiisneg): Move outside #ifdef NANS. * real.c (eiisneg): Move outside #ifdef NANS.
......
...@@ -266,7 +266,7 @@ in the following sections. ...@@ -266,7 +266,7 @@ in the following sections.
-fdelayed-branch -fdelete-null-pointer-checks @gol -fdelayed-branch -fdelete-null-pointer-checks @gol
-fexpensive-optimizations -ffast-math -ffloat-store @gol -fexpensive-optimizations -ffast-math -ffloat-store @gol
-fforce-addr -fforce-mem -ffunction-sections @gol -fforce-addr -fforce-mem -ffunction-sections @gol
-fgcse -fgcse-lm -fgcse-sm @gol -fgcse -fgcse-lm -fgcse-sm -floop-optimize -fcrossjumping @gol
-finline-functions -finline-limit=@var{n} -fkeep-inline-functions @gol -finline-functions -finline-limit=@var{n} -fkeep-inline-functions @gol
-fkeep-static-consts -fmerge-constants -fmerge-all-constants @gol -fkeep-static-consts -fmerge-constants -fmerge-all-constants @gol
-fmove-all-movables -fno-default-inline -fno-defer-pop @gol -fmove-all-movables -fno-default-inline -fno-defer-pop @gol
...@@ -3495,6 +3495,17 @@ subexpression elimination. This pass will attempt to move stores out of loops. ...@@ -3495,6 +3495,17 @@ subexpression elimination. This pass will attempt to move stores out of loops.
When used in conjunction with @option{-fgcse-lm}, loops containing a load/store sequence When used in conjunction with @option{-fgcse-lm}, loops containing a load/store sequence
can be changed to a load before the loop and a store after the loop. can be changed to a load before the loop and a store after the loop.
@item -floop-optimize
@opindex floop-optimize
Perform loop optimizations: move constant expressions out of loops, simplify
exit test conditions and optionally do strength-reduction and loop unrolling as
well.
@item -fcrossjumping
@opindex crossjumping
Perform cross-jumping transformation. This transformation unifies equivalent code and save code size. The
resulting code may or may not perform better than without cross-jumping.
@item -fdelete-null-pointer-checks @item -fdelete-null-pointer-checks
@opindex fdelete-null-pointer-checks @opindex fdelete-null-pointer-checks
Use global dataflow analysis to identify and eliminate useless checks Use global dataflow analysis to identify and eliminate useless checks
......
...@@ -605,6 +605,14 @@ int flag_syntax_only = 0; ...@@ -605,6 +605,14 @@ int flag_syntax_only = 0;
static int flag_gcse; static int flag_gcse;
/* Nonzero means perform loop optimizer. */
static int flag_loop_optimize;
/* Nonzero means perform crossjumping. */
static int flag_crossjumping;
/* Nonzero means to use global dataflow analysis to eliminate /* Nonzero means to use global dataflow analysis to eliminate
useless null pointer tests. */ useless null pointer tests. */
...@@ -1017,6 +1025,10 @@ static const lang_independent_options f_options[] = ...@@ -1017,6 +1025,10 @@ static const lang_independent_options f_options[] =
N_("Perform enhanced load motion during global subexpression elimination") }, N_("Perform enhanced load motion during global subexpression elimination") },
{"gcse-sm", &flag_gcse_sm, 1, {"gcse-sm", &flag_gcse_sm, 1,
N_("Perform store motion after global subexpression elimination") }, N_("Perform store motion after global subexpression elimination") },
{"loop-optimize", &flag_loop_optimize, 1,
N_("Perform the loop optimizations") },
{"crossjumping", &flag_crossjumping, 1,
N_("Perform cross-jumping optimization") },
{"rerun-cse-after-loop", &flag_rerun_cse_after_loop, 1, {"rerun-cse-after-loop", &flag_rerun_cse_after_loop, 1,
N_("Run CSE pass after loop optimizations") }, N_("Run CSE pass after loop optimizations") },
{"rerun-loop-opt", &flag_rerun_loop_opt, 1, {"rerun-loop-opt", &flag_rerun_loop_opt, 1,
...@@ -2846,7 +2858,7 @@ rest_of_compilation (decl) ...@@ -2846,7 +2858,7 @@ rest_of_compilation (decl)
/* Move constant computations out of loops. */ /* Move constant computations out of loops. */
if (optimize > 0) if (optimize > 0 && flag_loop_optimize)
{ {
timevar_push (TV_LOOP); timevar_push (TV_LOOP);
delete_dead_jumptables (); delete_dead_jumptables ();
...@@ -3244,7 +3256,8 @@ rest_of_compilation (decl) ...@@ -3244,7 +3256,8 @@ rest_of_compilation (decl)
if (optimize) if (optimize)
{ {
life_analysis (insns, rtl_dump_file, PROP_FINAL); life_analysis (insns, rtl_dump_file, PROP_FINAL);
cleanup_cfg (CLEANUP_EXPENSIVE | CLEANUP_CROSSJUMP | CLEANUP_UPDATE_LIFE); cleanup_cfg (CLEANUP_EXPENSIVE | CLEANUP_UPDATE_LIFE
| (flag_crossjumping ? CLEANUP_CROSSJUMP : 0));
/* This is kind of a heuristic. We need to run combine_stack_adjustments /* This is kind of a heuristic. We need to run combine_stack_adjustments
even for machines with possibly nonzero RETURN_POPS_ARGS even for machines with possibly nonzero RETURN_POPS_ARGS
...@@ -3350,7 +3363,7 @@ rest_of_compilation (decl) ...@@ -3350,7 +3363,7 @@ rest_of_compilation (decl)
and insn splitting possibly introduced more crossjumping and insn splitting possibly introduced more crossjumping
oppurtuntities. */ oppurtuntities. */
cleanup_cfg (CLEANUP_EXPENSIVE | CLEANUP_POST_REGSTACK cleanup_cfg (CLEANUP_EXPENSIVE | CLEANUP_POST_REGSTACK
| CLEANUP_CROSSJUMP); | (flag_crossjumping ? CLEANUP_CROSSJUMP : 0));
if (flag_reorder_blocks) if (flag_reorder_blocks)
{ {
reorder_basic_blocks (); reorder_basic_blocks ();
...@@ -4645,6 +4658,8 @@ parse_options_and_default_flags (argc, argv) ...@@ -4645,6 +4658,8 @@ parse_options_and_default_flags (argc, argv)
#endif #endif
flag_guess_branch_prob = 1; flag_guess_branch_prob = 1;
flag_cprop_registers = 1; flag_cprop_registers = 1;
flag_loop_optimize = 1;
flag_crossjumping = 1;
} }
if (optimize >= 2) if (optimize >= 2)
......
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