OSDN Git Service

H
[pf3gnuchains/gcc-fork.git] / gcc / loop.h
index 7def978..d0ae25f 100644 (file)
@@ -1,5 +1,5 @@
 /* Loop optimization definitions for GNU C-Compiler
-   Copyright (C) 1991 Free Software Foundation, Inc.
+   Copyright (C) 1991, 1995, 1998 Free Software Foundation, Inc.
 
 This file is part of GNU CC.
 
@@ -15,7 +15,8 @@ GNU General Public License for more details.
 
 You should have received a copy of the GNU General Public License
 along with GNU CC; see the file COPYING.  If not, write to
-the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.  */
+the Free Software Foundation, 59 Temple Place - Suite 330,
+Boston, MA 02111-1307, USA.  */
 
 /* 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.  */
@@ -74,7 +75,9 @@ struct induction
                                   even if further info is available.
                                   Both this and the above can be zero.  */
   unsigned ignore : 1;         /* 1 prohibits further processing of giv */
-  unsigned always_computable : 1;/* 1 if this set occurs each iteration */
+  unsigned always_computable : 1;/* 1 if this value is computable every
+                                   iteration.  */
+  unsigned always_executed : 1; /* 1 if this set occurs each iteration.  */
   unsigned maybe_multiple : 1; /* Only used for a biv and  1 if this biv
                                   update may be done multiple times per
                                   iteration. */
@@ -87,6 +90,12 @@ struct induction
   unsigned maybe_dead : 1;     /* 1 if this giv might be dead.  In that case,
                                   we won't use it to eliminate a biv, it
                                   would probably lose. */
+  unsigned auto_inc_opt : 1;   /* 1 if this giv had its increment output next
+                                  to it to try to form an auto-inc address. */
+  unsigned unrolled : 1;       /* 1 if new register has been allocated and
+                                  initialized in unrolled loop.  */
+  unsigned shared : 1;
+  unsigned no_const_addval : 1; /* 1 if add_val does not contain a const. */
   int lifetime;                        /* Length of life of this giv */
   int times_used;              /* # times this giv is used. */
   rtx derive_adjustment;       /* If nonzero, is an adjustment to be
@@ -104,6 +113,10 @@ struct induction
                                   is split, and a constant is eliminated from
                                   the address, the -constant is stored here
                                   for later use. */
+  struct induction *same_insn; /* If there are multiple identical givs in
+                                  the same insn, then all but one have this
+                                  field set, and they all point to the giv
+                                  that doesn't have this field set.  */
 };
 
 /* A `struct iv_class' is created for each biv.  */
@@ -141,6 +154,7 @@ 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 unsigned HOST_WIDE_INT loop_n_iterations;
 extern int max_reg_before_loop;
 
@@ -153,23 +167,29 @@ extern struct iv_class *loop_iv_list;
 
 /* Forward declarations for non-static functions declared in loop.c and
    unroll.c.  */
-int invariant_p ();
-rtx get_condition_for_loop ();
-void emit_iv_add_mult ();
-
-/* Variables declared in stmt.c but also needed in loop.c.  */
-
-extern union tree_node **loop_number_first_block;
-extern union tree_node **loop_number_last_block;
-extern int *loop_number_block_level;
+int invariant_p PROTO((rtx));
+rtx get_condition_for_loop PROTO((rtx));
+void emit_iv_add_mult PROTO((rtx, rtx, rtx, rtx, rtx));
 
 /* Forward declarations for non-static functions declared in stmt.c.  */
-void find_loop_tree_blocks ();
-void unroll_block_trees ();
-
-void unroll_loop ();
-rtx biv_total_increment ();
-unsigned HOST_WIDE_INT loop_iterations ();
-rtx final_biv_value ();
-rtx final_giv_value ();
-void emit_unrolled_add ();
+void find_loop_tree_blocks PROTO((void));
+void unroll_block_trees PROTO((void));
+
+void unroll_loop PROTO((rtx, int, rtx, rtx, int));
+rtx biv_total_increment PROTO((struct iv_class *, rtx, rtx));
+unsigned HOST_WIDE_INT loop_iterations PROTO((rtx, rtx));
+rtx final_biv_value PROTO((struct iv_class *, rtx, rtx));
+rtx final_giv_value PROTO((struct induction *, rtx, rtx));
+void emit_unrolled_add PROTO((rtx, rtx, rtx));
+int back_branch_in_range_p PROTO((rtx, rtx, rtx));
+
+extern int *loop_unroll_factor;
+
+#ifdef HAVE_decrement_and_branch_on_count
+extern rtx loop_iteration_var;
+extern rtx loop_initial_value;
+extern rtx loop_increment;
+extern rtx loop_final_value;
+extern enum rtx_code loop_comparison_code;
+#endif  /* HAVE_decrement_and_branch_on_count */
+