loop.c (invariant_p): Don't test flag_rerun_loop_opt.

* 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.

        * i386.c (notice_update_cc): Remove bogus pentium GCC code.

        * stmt.c (warn_if_unused_value): Don't warn for TRY_CATCH_EXPR.
Various pending patches.

From-SVN: r16973
This commit is contained in:
Jeff Law 1997-12-06 00:38:01 -07:00
parent a58248fa8a
commit 81797aba4d
6 changed files with 33 additions and 39 deletions

View File

@ -1,3 +1,18 @@
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

View File

@ -3543,15 +3543,6 @@ notice_update_cc (exp)
if (SET_DEST (exp) == pc_rtx)
return;
#ifdef IS_STACK_MODE
/* Moving into a memory of stack_mode may have been moved
in between the use and set of cc0 by loop_spl(). So
old value of cc.status must be retained */
if (GET_CODE(SET_DEST(exp)) == MEM
&& IS_STACK_MODE (GET_MODE (SET_DEST (exp))))
return;
#endif
/* Moving register or memory into a register:
it doesn't alter the cc's, but it might invalidate
the RTX's which we remember the cc's came from.

View File

@ -6355,7 +6355,7 @@ Int2(@var{A})
Int2: @code{INTEGER(KIND=6)} function.
@noindent
@var{A}: @code{INTEGER}; scalar; INTENT(IN).
@var{A}: @code{INTEGER}, @code{REAL}, or @code{COMPLEX}; scalar; INTENT(IN).
@noindent
Intrinsic groups: @code{gnu}.
@ -6390,7 +6390,7 @@ Int8(@var{A})
Int8: @code{INTEGER(KIND=2)} function.
@noindent
@var{A}: @code{INTEGER}; scalar; INTENT(IN).
@var{A}: @code{INTEGER}, @code{REAL}, or @code{COMPLEX}; scalar; INTENT(IN).
@noindent
Intrinsic groups: @code{gnu}.

View File

@ -374,10 +374,11 @@ init_loop ()
(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;
@ -502,7 +503,7 @@ loop_optimize (f, dumpfile)
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
@ -514,12 +515,12 @@ loop_optimize (f, dumpfile)
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 ();
}
@ -534,9 +535,10 @@ loop_optimize (f, dumpfile)
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;
@ -1051,7 +1053,7 @@ scan_loop (loop_start, end, nregs)
if (flag_strength_reduce)
strength_reduce (scan_start, end, loop_top,
insn_count, loop_start, end);
insn_count, loop_start, end, unroll_p);
}
/* Add elements to *OUTPUT to record all the pseudo-regs
@ -2847,12 +2849,7 @@ invariant_p (x)
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;
@ -3339,13 +3336,14 @@ static rtx addr_placeholder;
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;
@ -3583,7 +3581,7 @@ strength_reduce (scan_start, end, loop_top, insn_count,
{
/* 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;
@ -4362,7 +4360,7 @@ strength_reduce (scan_start, end, loop_top, insn_count,
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

View File

@ -1873,6 +1873,7 @@ warn_if_unused_value (exp)
case CALL_EXPR:
case METHOD_CALL_EXPR:
case RTL_EXPR:
case TRY_CATCH_EXPR:
case WITH_CLEANUP_EXPR:
case EXIT_EXPR:
/* We don't warn about COND_EXPR because it may be a useful

View File

@ -3313,28 +3313,17 @@ rest_of_compilation (decl)
{
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);
});
}