Commit a2be868f by Michael Hayes Committed by Michael Hayes

loop.c (this_loop_info): Delete.

	* loop.c (this_loop_info): Delete.
	(uid_loop): Add in place of uid_loop_num.  All uses updated.
 	(loop_number_exit_count): Delete and replace with entry in loop
	structure.  All uses updated.
	(loop_number_loop_starts, loop_number_loop_ends): Likewise.
	(loop_number_loop_cont, loop_number_cont_dominator): Likewise.
	(loop_outer_loop): Likewise.
	(loop_invalid, loop_number_exit_labels): Likewise.
	(loop_used_count_register): Delete and replace with entry in
	loop_info structure.
	(find_and_verify_loops): Add loops argument.
	(verify_dominator, mark_loop_jump, prescan_loop): Replace loop_start,
	loop_end, etc. arguments with loop structure pointer.  All callers
	changed.
	(loop_reg_used_before_p, scan_loop, strength_reduce): Likewise.
	(check_dbra_loop, next_insn_in_loop, try_copy_prop): Likewise.
	(load_mems_and_recount_loop_regs_set, load_mems): Likewise.
	(insert_bct): Likewise.
	(basic_induction_var): New argument level.
	* loop.h (struct loop_info): Delete fields num, loops_enclosed,
	vtop, and cont.  Add used_count_register.
	(uid_loop): Delete declaration.
 	(loop_number_exit_count): Likewise.
	(loop_number_loop_starts, loop_number_loop_ends): Likewise.
	(loop_number_loop_cont, loop_number_cont_dominator): Likewise.
	(loop_outer_loop, loop_used_count_register): Likewise.
	(loop_invalid, loop_number_exit_labels): Likewise.
	(unroll_loop): Replace loop_start and loop_end arguments
 	with loop structure pointer.
	(loop_precondition_p, loop_iterations): Likewise.
	Include basic-block.h.
	* unroll.c: (unroll_loop): Replace loop_start and loop_end arguments
 	with loop structure pointer.
	(loop_precondition_p, loop_iterations): Likewise.
	* basic-block.h (struct loop): New entries vtop, cont,
 	cont_dominator, start, end, top, scan_start, exit_labels,
	exit_count.
	* Makefile.in (LOOP_H): Add basic-block.h to dependencies.

From-SVN: r31434
parent d07ecc3b
2000-01-15 Michael Hayes <m.hayes@elec.canterbury.ac.nz>
* loop.c (this_loop_info): Delete.
(uid_loop): Add in place of uid_loop_num. All uses updated.
(loop_number_exit_count): Delete and replace with entry in loop
structure. All uses updated.
(loop_number_loop_starts, loop_number_loop_ends): Likewise.
(loop_number_loop_cont, loop_number_cont_dominator): Likewise.
(loop_outer_loop): Likewise.
(loop_invalid, loop_number_exit_labels): Likewise.
(loop_used_count_register): Delete and replace with entry in
loop_info structure.
(find_and_verify_loops): Add loops argument.
(verify_dominator, mark_loop_jump, prescan_loop): Replace loop_start,
loop_end, etc. arguments with loop structure pointer. All callers
changed.
(loop_reg_used_before_p, scan_loop, strength_reduce): Likewise.
(check_dbra_loop, next_insn_in_loop, try_copy_prop): Likewise.
(load_mems_and_recount_loop_regs_set, load_mems): Likewise.
(insert_bct): Likewise.
(basic_induction_var): New argument level.
* loop.h (struct loop_info): Delete fields num, loops_enclosed,
vtop, and cont. Add used_count_register.
(uid_loop): Delete declaration.
(loop_number_exit_count): Likewise.
(loop_number_loop_starts, loop_number_loop_ends): Likewise.
(loop_number_loop_cont, loop_number_cont_dominator): Likewise.
(loop_outer_loop, loop_used_count_register): Likewise.
(loop_invalid, loop_number_exit_labels): Likewise.
(unroll_loop): Replace loop_start and loop_end arguments
with loop structure pointer.
(loop_precondition_p, loop_iterations): Likewise.
Include basic-block.h.
* unroll.c: (unroll_loop): Replace loop_start and loop_end arguments
with loop structure pointer.
(loop_precondition_p, loop_iterations): Likewise.
* basic-block.h (struct loop): New entries vtop, cont,
cont_dominator, start, end, top, scan_start, exit_labels,
exit_count.
* Makefile.in (LOOP_H): Add basic-block.h to dependencies.
2000-01-15 Gerald Pfeifer <pfeifer@dbai.tuwien.ac.at>
* defaults.h (ASM_OUTPUT_ASCII): Use ISDIGIT.
......
......@@ -756,7 +756,7 @@ RECOG_H = recog.h
EXPR_H = expr.h insn-codes.h
REGS_H = regs.h varray.h $(MACHMODE_H)
INTEGRATE_H = integrate.h varray.h
LOOP_H = loop.h varray.h
LOOP_H = loop.h varray.h basic-block.h
#
# Language makefile fragments.
......
......@@ -275,6 +275,47 @@ struct loop
/* Auxiliary info specific to a pass. */
void *info;
/* The following are currently used by loop.c but they are likely to
disappear as loop.c is converted to use the CFG. */
/* Non-zero if the loop has a NOTE_INSN_LOOP_VTOP. */
rtx vtop;
/* Non-zero if the loop has a NOTE_INSN_LOOP_CONT.
A continue statement will generate a branch to NEXT_INSN (cont). */
rtx cont;
/* The dominator of cont. */
rtx cont_dominator;
/* The NOTE_INSN_LOOP_BEG. */
rtx start;
/* The NOTE_INSN_LOOP_END. */
rtx end;
/* For a rotated loop that is entered near the bottom,
this is the label at the top. Otherwise it is zero. */
rtx top;
/* Place in the loop where control enters. */
rtx scan_start;
/* List of all LABEL_REFs which refer to code labels outside the
loop. Used by routines that need to know all loop exits, such as
final_biv_value and final_giv_value.
This does not include loop exits due to return instructions.
This is because all bivs and givs are pseudos, and hence must be
dead after a return, so the presense of a return does not affect
any of the optimizations that use this info. It is simpler to
just not include return instructions on this list. */
rtx exit_labels;
/* The number of LABEL_REFs on exit_labels for this loop and all
loops nested inside it. */
int exit_count;
};
......
......@@ -19,6 +19,7 @@ the Free Software Foundation, 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
#include "varray.h"
#include "basic-block.h"
/* Get the luid of an insn. Catch the error of trying to reference the LUID
of an insn added during loop, since these don't have LUIDs. */
......@@ -159,10 +160,6 @@ struct iv_class {
struct loop_info
{
/* Loop number. */
int num;
/* Loops enclosed by this loop including itself. */
int loops_enclosed;
/* Nonzero if there is a subroutine call in the current loop. */
int has_call;
/* Nonzero if there is a volatile memory reference in the current
......@@ -200,11 +197,7 @@ struct loop_info
unsigned HOST_WIDE_INT n_iterations;
/* The number of times the loop body was unrolled. */
unsigned int unroll_number;
/* Non-zero if the loop has a NOTE_INSN_LOOP_VTOP. */
rtx vtop;
/* Non-zero if the loop has a NOTE_INSN_LOOP_CONT.
A continue statement will generate a branch to NEXT_INSN (cont). */
rtx cont;
int used_count_register;
};
/* Definitions used by the basic induction variable discovery code. */
......@@ -215,12 +208,8 @@ enum iv_mode { UNKNOWN_INDUCT, BASIC_INDUCT, NOT_BASIC_INDUCT,
extern int *uid_luid;
extern int max_uid_for_loop;
extern int *uid_loop_num;
extern int *loop_outer_loop;
extern rtx *loop_number_exit_labels;
extern int *loop_number_exit_count;
extern int max_reg_before_loop;
extern struct loop **uid_loop;
extern FILE *loop_dump_stream;
extern varray_type reg_iv_type;
......@@ -243,9 +232,9 @@ rtx get_condition_for_loop PROTO((rtx));
void emit_iv_add_mult PROTO((rtx, rtx, rtx, rtx, rtx));
rtx express_from PROTO((struct induction *, struct induction *));
void unroll_loop PROTO((rtx, int, rtx, rtx, struct loop_info *, int));
void unroll_loop PROTO((struct loop *, int, rtx, int));
rtx biv_total_increment PROTO((struct iv_class *, rtx, rtx));
unsigned HOST_WIDE_INT loop_iterations PROTO((rtx, rtx, struct loop_info *));
unsigned HOST_WIDE_INT loop_iterations PROTO((struct loop *));
int precondition_loop_p PROTO((rtx, struct loop_info *,
rtx *, rtx *, rtx *,
enum machine_mode *mode));
......@@ -261,4 +250,3 @@ int loop_insn_first_p PROTO((rtx, rtx));
/* Forward declarations for non-static functions declared in stmt.c. */
void find_loop_tree_blocks PROTO((void));
void unroll_block_trees PROTO((void));
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