+Fri Dec 5 18:26:25 1997 J"orn Rennecke <amylaar@cygnus.co.uk>
+
+ * loop.c (invariant_p): Don't test flag_rerun_loop_opt.
+ (loop_optimize, scan_loop, strength_reduce): New argument unroll_p.
+ * toplev.c (rest_of_compilation): Pass it. Remove code to
+ save / clear / restore flag_unroll_{,all_}loops.
+
+Fri Dec 5 16:26:03 1997 Bernd Schmidt <crux@ohara.Informatik.RWTH-Aachen.DE>
+
+ * i386.c (notice_update_cc): Remove bogus pentium GCC code.
+
+Fri Dec 5 16:25:14 1997 Jeffrey A Law (law@cygnus.com)
+
+ * stmt.c (warn_if_unused_value): Don't warn for TRY_CATCH_EXPR.
+
Thu Dec 4 11:51:00 1997 Jason Merrill <jason@yorick.cygnus.com>
* except.c (get_dynamic_handler_chain): Only make the call once per
(or 0 if none should be output). */
void
-loop_optimize (f, dumpfile)
+loop_optimize (f, dumpfile, unroll_p)
/* f is the first instruction of a chain of insns for one function */
rtx f;
FILE *dumpfile;
+ int unroll_p;
{
register rtx insn;
register int i;
uid_luid[i] = uid_luid[i - 1];
/* Create a mapping from loops to BLOCK tree nodes. */
- if (flag_unroll_loops && write_symbols != NO_DEBUG)
+ if (unroll_p && write_symbols != NO_DEBUG)
find_loop_tree_blocks ();
/* Determine if the function has indirect jump. On some systems
for (i = max_loop_num-1; i >= 0; i--)
if (! loop_invalid[i] && loop_number_loop_ends[i])
scan_loop (loop_number_loop_starts[i], loop_number_loop_ends[i],
- max_reg_num ());
+ max_reg_num (), unroll_p);
/* If debugging and unrolling loops, we must replicate the tree nodes
corresponding to the blocks inside the loop, so that the original one
to one mapping will remain. */
- if (flag_unroll_loops && write_symbols != NO_DEBUG)
+ if (unroll_p && write_symbols != NO_DEBUG)
unroll_block_trees ();
}
\f
write, then we can also mark the memory read as invariant. */
static void
-scan_loop (loop_start, end, nregs)
+scan_loop (loop_start, end, nregs, unroll_p)
rtx loop_start, end;
int nregs;
+ int unroll_p;
{
register int i;
register rtx p;
if (flag_strength_reduce)
strength_reduce (scan_start, end, loop_top,
- insn_count, loop_start, end);
+ insn_count, loop_start, end, unroll_p);
}
\f
/* Add elements to *OUTPUT to record all the pseudo-regs
We don't know the loop bounds here though, so just fail for all
labels. */
- /* ??? This is also necessary if flag_rerun_loop_opt is true, because in
- this case we may be doing loop unrolling the second time we run loop,
- and hence the first loop run also needs this check. There is no way
- to check here whether the second run will actually do loop unrolling
- though, as that info is in a local var in rest_of_compilation. */
- if (flag_unroll_loops || flag_rerun_loop_opt)
+ if (flag_unroll_loops)
return 0;
else
return 1;
static void
strength_reduce (scan_start, end, loop_top, insn_count,
- loop_start, loop_end)
+ loop_start, loop_end, unroll_p)
rtx scan_start;
rtx end;
rtx loop_top;
int insn_count;
rtx loop_start;
rtx loop_end;
+ int unroll_p;
{
rtx p;
rtx set;
{
/* Can still unroll the loop anyways, but indicate that there is no
strength reduction info available. */
- if (flag_unroll_loops)
+ if (unroll_p)
unroll_loop (loop_end, insn_count, loop_start, end_insert_before, 0);
return;
induction variable information that strength_reduce has already
collected. */
- if (flag_unroll_loops)
+ if (unroll_p)
unroll_loop (loop_end, insn_count, loop_start, end_insert_before, 1);
#ifdef HAIFA
{
TIMEVAR (loop_time,
{
- int save_flag_unroll_loops;
- int save_flag_unroll_all_loops;
-
if (flag_rerun_loop_opt)
{
/* We only want to perform unrolling once. */
- save_flag_unroll_loops = flag_unroll_loops;
- save_flag_unroll_all_loops = flag_unroll_all_loops;
- flag_unroll_loops = 0;
- flag_unroll_all_loops = 0;
- loop_optimize (insns, loop_dump_file);
+ loop_optimize (insns, loop_dump_file, 0);
/* The regscan pass may not be necessary, but let's
be safe until we can prove otherwise. */
reg_scan (insns, max_reg_num (), 1);
-
- /* Restore loop unrolling flags. */
- flag_unroll_loops = save_flag_unroll_loops;
- flag_unroll_all_loops = save_flag_unroll_all_loops;
}
- loop_optimize (insns, loop_dump_file);
+ loop_optimize (insns, loop_dump_file, flag_unroll_loops);
});
}