aboutsummaryrefslogtreecommitdiff
path: root/gcc/loop.h
diff options
context:
space:
mode:
authorMichael Hayes <mhayes@cygnus.com>2000-09-11 21:46:35 +0000
committerMichael Hayes <m.hayes@gcc.gnu.org>2000-09-11 21:46:35 +0000
commit1ecd860b2879a4529b01208eab3484be9383c7d4 (patch)
tree15eef14322878903f4a9ad4465889d34fba1f1dc /gcc/loop.h
parent0a5b41f2563e140388e5d59fd81458d828034270 (diff)
downloadgcc-1ecd860b2879a4529b01208eab3484be9383c7d4.zip
gcc-1ecd860b2879a4529b01208eab3484be9383c7d4.tar.gz
gcc-1ecd860b2879a4529b01208eab3484be9383c7d4.tar.bz2
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
Diffstat (limited to 'gcc/loop.h')
-rw-r--r--gcc/loop.h47
1 files changed, 45 insertions, 2 deletions
diff --git a/gcc/loop.h b/gcc/loop.h
index addd674..f73e225 100644
--- a/gcc/loop.h
+++ b/gcc/loop.h
@@ -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. */