aboutsummaryrefslogtreecommitdiff
path: root/gcc/loop.h
diff options
context:
space:
mode:
authorMichael Hayes <mhayes@cygnus.com>2000-09-11 21:48:46 +0000
committerMichael Hayes <m.hayes@gcc.gnu.org>2000-09-11 21:48:46 +0000
commited5bb68db315b7192f63866899378250810bdad8 (patch)
treea526b1975d0a61527c9c7397add153dd0db913f2 /gcc/loop.h
parent1ecd860b2879a4529b01208eab3484be9383c7d4 (diff)
downloadgcc-ed5bb68db315b7192f63866899378250810bdad8.zip
gcc-ed5bb68db315b7192f63866899378250810bdad8.tar.gz
gcc-ed5bb68db315b7192f63866899378250810bdad8.tar.bz2
loop.h (LOOP_IVS): New macro.
* loop.h (LOOP_IVS): New macro. (REG_IV_TYPE, REG_IV_INFO): Add ivs argument. (struct loop_ivs): New. (struct loop_info): Add ivs field. (reg_iv_type, reg_iv_info): Delete prototype. (reg_biv_class, loop_iv_list): Likewise. * loop.c (record_biv, find_life_end): Pass loop argument. (reg_iv_type): Remove global array and use field in loop_regs structure within loop_ivs structure. (reg_iv_info, reg_biv_class, loop_iv_list): Likewise. (first_increment_giv, last_increment_giv): Use entry in loop_ivs structure. (record_initial): Pass ivs pointer. * unroll.c (copy_loop_body, remap_split_bivs): Add loop argument. From-SVN: r36336
Diffstat (limited to 'gcc/loop.h')
-rw-r--r--gcc/loop.h49
1 files changed, 37 insertions, 12 deletions
diff --git a/gcc/loop.h b/gcc/loop.h
index f73e225..21555a8 100644
--- a/gcc/loop.h
+++ b/gcc/loop.h
@@ -32,6 +32,9 @@ Boston, MA 02111-1307, USA. */
/* Get a pointer to the loop registers structure. */
#define LOOP_REGS(LOOP) (&LOOP_INFO (loop)->regs)
+/* Get a pointer to the loop induction variables structure. */
+#define LOOP_IVS(LOOP) (&LOOP_INFO (loop)->ivs)
+
/* 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. */
@@ -176,6 +179,34 @@ typedef struct loop_mem_info
} loop_mem_info;
+struct loop_ivs
+{
+ /* Indexed by register number, indicates whether or not register is
+ an induction variable, and if so what type. */
+ varray_type reg_iv_type;
+
+ /* Indexed by register number, contains pointer to `struct
+ induction' if register is an induction variable. This holds
+ general info for all induction variables. */
+ varray_type reg_iv_info;
+
+ /* Indexed by register number, contains pointer to `struct iv_class'
+ if register is a basic induction variable. This holds info
+ describing the class (a related group) of induction variables
+ that the biv belongs to. */
+ struct iv_class **reg_biv_class;
+
+ /* The head of a list which links together (via the next field)
+ every iv class for the current loop. */
+ struct iv_class *loop_iv_list;
+
+ /* Givs made from biv increments are always splittable for loop
+ unrolling. Since there is no regscan info for them, we have to
+ keep track of them separately. */
+ unsigned int first_increment_giv;
+ unsigned int last_increment_giv;
+};
+
struct loop_regs
{
@@ -285,6 +316,8 @@ struct loop_info
rtx first_loop_store_insn;
/* The registers used the in loop. */
struct loop_regs regs;
+ /* The induction variable information in loop. */
+ struct loop_ivs ivs;
};
/* Definitions used by the basic induction variable discovery code. */
@@ -299,18 +332,10 @@ extern unsigned int max_reg_before_loop;
extern struct loop **uid_loop;
extern FILE *loop_dump_stream;
-extern varray_type reg_iv_type;
-extern varray_type reg_iv_info;
-
-#define REG_IV_TYPE(n) \
- (*(enum iv_mode *) &VARRAY_INT(reg_iv_type, (n)))
-#define REG_IV_INFO(n) \
- (*(struct induction **) &VARRAY_GENERIC_PTR(reg_iv_info, (n)))
-
-extern struct iv_class **reg_biv_class;
-extern struct iv_class *loop_iv_list;
-
-extern unsigned int first_increment_giv, last_increment_giv;
+#define REG_IV_TYPE(ivs, n) \
+ (*(enum iv_mode *) &VARRAY_INT(ivs->reg_iv_type, (n)))
+#define REG_IV_INFO(ivs, n) \
+ (*(struct induction **) &VARRAY_GENERIC_PTR(ivs->reg_iv_info, (n)))
/* Forward declarations for non-static functions declared in loop.c and
unroll.c. */