+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>
* real.c (eiisneg): Move outside #ifdef NANS.
-fdelayed-branch -fdelete-null-pointer-checks @gol
-fexpensive-optimizations -ffast-math -ffloat-store @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
-fkeep-static-consts -fmerge-constants -fmerge-all-constants @gol
-fmove-all-movables -fno-default-inline -fno-defer-pop @gol
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.
+@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
@opindex fdelete-null-pointer-checks
Use global dataflow analysis to identify and eliminate useless checks
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
useless null pointer tests. */
N_("Perform enhanced load motion during global subexpression elimination") },
{"gcse-sm", &flag_gcse_sm, 1,
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,
N_("Run CSE pass after loop optimizations") },
{"rerun-loop-opt", &flag_rerun_loop_opt, 1,
/* Move constant computations out of loops. */
- if (optimize > 0)
+ if (optimize > 0 && flag_loop_optimize)
{
timevar_push (TV_LOOP);
delete_dead_jumptables ();
if (optimize)
{
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
even for machines with possibly nonzero RETURN_POPS_ARGS
and insn splitting possibly introduced more crossjumping
oppurtuntities. */
cleanup_cfg (CLEANUP_EXPENSIVE | CLEANUP_POST_REGSTACK
- | CLEANUP_CROSSJUMP);
+ | (flag_crossjumping ? CLEANUP_CROSSJUMP : 0));
if (flag_reorder_blocks)
{
reorder_basic_blocks ();
#endif
flag_guess_branch_prob = 1;
flag_cprop_registers = 1;
+ flag_loop_optimize = 1;
+ flag_crossjumping = 1;
}
if (optimize >= 2)