Commit f1d4ac80 by Michael Hayes Committed by Michael Hayes

loop.h (struct loop_reg): New.

	* loop.h (struct loop_reg): New.
	(struct loop_regs): Change to use array of `struct loop_reg'.
	* loop.c: Replace assortment of varrays with single regs array.
	(count_one_set): Delete may_not_move array argument
	and use regs array instead.  All caller's changed.
	(count_loop_regs_set): Delete may_not_move and single_usage
	arguments and use regs array instead.  All caller's changed.
	(find_single_use_in_loop): Replace usage array argument with pointer
	to regs structure.  All caller's changed.
	(loop_optimize): Delete `moved_once' array.

From-SVN: r38700
parent 576d0b54
2001-01-05 Michael Hayes <mhayes@redhat.com> 2001-01-05 Michael Hayes <mhayes@redhat.com>
* loop.h (struct loop_reg): New.
(struct loop_regs): Change to use array of `struct loop_reg'.
* loop.c: Replace assortment of varrays with single regs array.
(count_one_set): Delete may_not_move array argument
and use regs array instead. All caller's changed.
(count_loop_regs_set): Delete may_not_move and single_usage
arguments and use regs array instead. All caller's changed.
(find_single_use_in_loop): Replace usage array argument with pointer
to regs structure. All caller's changed.
(loop_optimize): Delete `moved_once' array.
2001-01-05 Michael Hayes <mhayes@redhat.com>
* loop.c (prescan_loop): Set loop_info->has_nonconst_call. * loop.c (prescan_loop): Set loop_info->has_nonconst_call.
Use it instead of loop_info->has_call for scanning loop mems. Use it instead of loop_info->has_call for scanning loop mems.
(check_dbra_loop): Replace loop_info->has_call test with (check_dbra_loop): Replace loop_info->has_call test with
......
...@@ -18,7 +18,6 @@ along with GNU CC; see the file COPYING. If not, write to ...@@ -18,7 +18,6 @@ along with GNU CC; see the file COPYING. If not, write to
the Free Software Foundation, 59 Temple Place - Suite 330, the Free Software Foundation, 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */ Boston, MA 02111-1307, USA. */
#include "varray.h"
#include "bitmap.h" #include "bitmap.h"
/* Flags passed to loop_optimize. */ /* Flags passed to loop_optimize. */
...@@ -236,44 +235,50 @@ typedef struct loop_mem_info ...@@ -236,44 +235,50 @@ typedef struct loop_mem_info
} loop_mem_info; } loop_mem_info;
struct loop_regs
{
int num;
/* Indexed by register number, contains the number of times the reg struct loop_reg
is set during the loop being scanned. {
During code motion, a negative value indicates a reg that has been /* Number of times the reg is set during the loop being scanned.
made a candidate; in particular -2 means that it is an candidate that During code motion, a negative value indicates a reg that has
we know is equal to a constant and -1 means that it is an candidate been made a candidate; in particular -2 means that it is an
not known equal to a constant. candidate that we know is equal to a constant and -1 means that
After code motion, regs moved have 0 (which is accurate now) it is an candidate not known equal to a constant. After code
while the failed candidates have the original number of times set. 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; Therefore, at all times, == 0 indicates an invariant register;
< 0 a conditionally invariant one. */ < 0 a conditionally invariant one. */
varray_type set_in_loop; int set_in_loop;
/* Original value of set_in_loop; same except that this value /* Original value of set_in_loop; same except that this value
is not set negative for a reg whose sets have been made candidates is not set negative for a reg whose sets have been made candidates
and not set to 0 for a reg that is moved. */ and not set to 0 for a reg that is moved. */
varray_type n_times_set; int 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 /* 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. */ exactly once; contains const0_rtx if it was used more than once. */
varray_type single_usage; rtx single_usage;
/* Nonzero indicates that the register cannot be moved or strength
reduced. */
char may_not_optimize;
/* Nonzero means reg N has already been moved out of one loop. /* Nonzero means reg N has already been moved out of one loop.
This reduces the desire to move it out of another. */ This reduces the desire to move it out of another. */
char *moved_once; char moved_once;
};
int multiple_uses; struct loop_regs
{
int num; /* Number of regs used in table. */
int size; /* Size of table. */
struct loop_reg *array; /* Register usage info. array. */
int multiple_uses; /* Nonzero if a reg has multiple uses. */
}; };
struct loop_movables struct loop_movables
{ {
/* Head of movable chain. */ /* Head of movable chain. */
......
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