Commit 1ecd860b by Michael Hayes Committed by Michael Hayes

loop.h (LOOP_REGS): New macro.

	* loop.h (LOOP_REGS): New macro.
	(struct loop_regs): New.
	(struct loop_info): Add regs field.
	* loop.c (set_in_loop): Remove global array and store
	in loop_regs structure as part of loop_info structure.
	(n_times_set, may_not_optimize): Likewise.
	(reg_single_usage, moved_once): Likewise.
	(count_one_set): Add regs argument.
	(combine_movables, rtx_equal_for_loop_p, combine_givs): Likewise.
	(set_pseudo_multiple_uses): Pass regs pointer.

From-SVN: r36335
parent 0a5b41f2
2000-09-12 Michael Hayes <mhayes@cygnus.com>
* loop.h (LOOP_REGS): New macro.
(struct loop_regs): New.
(struct loop_info): Add regs field.
* loop.c (set_in_loop): Remove global array and store
in loop_regs structure as part of loop_info structure.
(n_times_set, may_not_optimize): Likewise.
(reg_single_usage, moved_once): Likewise.
(count_one_set): Add regs argument.
(combine_movables, rtx_equal_for_loop_p, combine_givs): Likewise.
(set_pseudo_multiple_uses): Pass regs pointer.
2000-09-12 Michael Hayes <mhayes@cygnus.com>
* unroll.c (iteration_info): Subsume into loop_iterations.
* loop.h (loop_info): New field iv.
......
......@@ -29,6 +29,9 @@ Boston, MA 02111-1307, USA. */
/* Get the loop info pointer of a loop. */
#define LOOP_INFO(LOOP) ((struct loop_info *) (LOOP)->aux)
/* Get a pointer to the loop registers structure. */
#define LOOP_REGS(LOOP) (&LOOP_INFO (loop)->regs)
/* 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. */
......@@ -173,8 +176,46 @@ typedef struct loop_mem_info
} loop_mem_info;
/* Information required to calculate the number of loop iterations.
This is set by loop_iterations. */
struct loop_regs
{
int num;
/* Indexed by register number, contains the number of times the reg
is set during the loop being scanned.
During code motion, a negative value indicates a reg that has been
made a candidate; in particular -2 means that it is an candidate that
we know is equal to a constant and -1 means that it is an candidate
not known equal to a constant.
After code motion, regs moved have 0 (which is accurate now)
while the failed candidates have the original number of times set.
Therefore, at all times, == 0 indicates an invariant register;
< 0 a conditionally invariant one. */
varray_type set_in_loop;
/* Original value of set_in_loop; same except that this value
is not set negative for a reg whose sets have been made candidates
and not set to 0 for a reg that is moved. */
varray_type n_times_set;
/* Index by register number, 1 indicates that the register
cannot be moved or strength reduced. */
varray_type may_not_optimize;
/* Contains the insn in which a register was used if it was used
exactly once; contains const0_rtx if it was used more than once. */
varray_type single_usage;
/* Nonzero means reg N has already been moved out of one loop.
This reduces the desire to move it out of another. */
char *moved_once;
int multiple_uses;
};
/* Information pertaining to a loop. */
struct loop_info
{
......@@ -242,6 +283,8 @@ struct loop_info
int num_mem_sets;
/* The insn where the first of these was found. */
rtx first_loop_store_insn;
/* The registers used the in loop. */
struct loop_regs regs;
};
/* Definitions used by the basic induction variable discovery code. */
......
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