coretypes.h: Include input.h and as-a.h.
[platform/upstream/gcc.git] / gcc / cfgloop.h
index 932465d..0620342 100644 (file)
@@ -1,5 +1,5 @@
 /* Natural loop functions
-   Copyright (C) 1987-2014 Free Software Foundation, Inc.
+   Copyright (C) 1987-2015 Free Software Foundation, Inc.
 
 This file is part of GCC.
 
@@ -20,11 +20,12 @@ along with GCC; see the file COPYING3.  If not see
 #ifndef GCC_CFGLOOP_H
 #define GCC_CFGLOOP_H
 
-#include "double-int.h"
-#include "wide-int.h"
 #include "bitmap.h"
 #include "sbitmap.h"
+#include "tm.h"
+#include "hard-reg-set.h"
 #include "function.h"
+#include "cfgloopmanip.h"
 
 /* Structure to hold decision about unrolling/peeling.  */
 enum lpt_dec
@@ -108,6 +109,14 @@ enum loop_estimation
   EST_LAST
 };
 
+/* The structure describing non-overflow control induction variable for
+   loop's exit edge.  */
+struct GTY ((chain_next ("%h.next"))) control_iv {
+  tree base;
+  tree step;
+  struct control_iv *next;
+};
+
 /* Structure to hold information for each natural loop.  */
 struct GTY ((chain_next ("%h.next"))) loop {
   /* Index into loops array.  */
@@ -195,6 +204,9 @@ struct GTY ((chain_next ("%h.next"))) loop {
   /* Upper bound on number of iterations of a loop.  */
   struct nb_iter_bound *bounds;
 
+  /* Non-overflow control ivs of a loop.  */
+  struct control_iv *control_ivs;
+
   /* Head of the cyclic list of the exits of the loop.  */
   struct loop_exit *exits;
 
@@ -264,8 +276,6 @@ void rescan_loop_exit (edge, bool, bool);
 /* Loop data structure manipulation/querying.  */
 extern void flow_loop_tree_node_add (struct loop *, struct loop *);
 extern void flow_loop_tree_node_remove (struct loop *);
-extern void place_new_loop (struct function *, struct loop *);
-extern void add_loop (struct loop *, struct loop *);
 extern bool flow_loop_nested_p (const struct loop *, const struct loop *);
 extern bool flow_bb_inside_loop_p (const struct loop *, const_basic_block);
 extern struct loop * find_common_loop (struct loop *, struct loop *);
@@ -303,15 +313,6 @@ extern void remove_bb_from_loops (basic_block);
 extern void cancel_loop_tree (struct loop *);
 extern void delete_loop (struct loop *);
 
-enum
-{
-  CP_SIMPLE_PREHEADERS = 1,
-  CP_FALLTHRU_PREHEADERS = 2
-};
-
-basic_block create_preheader (struct loop *, int);
-extern void create_preheaders (int);
-extern void force_single_succ_latches (void);
 
 extern void verify_loop_structure (void);
 
@@ -321,37 +322,8 @@ gcov_type expected_loop_iterations_unbounded (const struct loop *);
 extern unsigned expected_loop_iterations (const struct loop *);
 extern rtx doloop_condition_get (rtx);
 
-
-/* Loop manipulation.  */
-extern bool can_duplicate_loop_p (const struct loop *loop);
-
-#define DLTHE_FLAG_UPDATE_FREQ 1       /* Update frequencies in
-                                          duplicate_loop_to_header_edge.  */
-#define DLTHE_RECORD_COPY_NUMBER 2     /* Record copy number in the aux
-                                          field of newly create BB.  */
-#define DLTHE_FLAG_COMPLETTE_PEEL 4    /* Update frequencies expecting
-                                          a complete peeling.  */
-
-extern edge create_empty_if_region_on_edge (edge, tree);
-extern struct loop *create_empty_loop_on_edge (edge, tree, tree, tree, tree,
-                                              tree *, tree *, struct loop *);
-extern struct loop * duplicate_loop (struct loop *, struct loop *);
-extern void copy_loop_info (struct loop *loop, struct loop *target);
-extern void duplicate_subloops (struct loop *, struct loop *);
-extern bool duplicate_loop_to_header_edge (struct loop *, edge,
-                                          unsigned, sbitmap, edge,
-                                          vec<edge> *, int);
-extern struct loop *loopify (edge, edge,
-                            basic_block, edge, edge, bool,
-                            unsigned, unsigned);
-struct loop * loop_version (struct loop *, void *,
-                           basic_block *, unsigned, unsigned, unsigned, bool);
-extern bool remove_path (edge);
-extern void unloop (struct loop *, bool *, bitmap);
-extern void scale_loop_frequencies (struct loop *, int, int);
 void mark_loop_for_removal (loop_p);
 
-
 /* Induction variable analysis.  */
 
 /* The description of induction variable.  The things are a bit complicated
@@ -387,10 +359,10 @@ struct rtx_iv
   rtx delta, mult;
 
   /* The mode it is extended to.  */
-  enum machine_mode extend_mode;
+  machine_mode extend_mode;
 
   /* The mode the variable iterates in.  */
-  enum machine_mode mode;
+  machine_mode mode;
 
   /* Whether the first iteration needs to be handled specially.  */
   unsigned first_special : 1;
@@ -431,7 +403,7 @@ struct GTY(()) niter_desc
   bool signed_p;
 
   /* The mode in that niter_expr should be computed.  */
-  enum machine_mode mode;
+  machine_mode mode;
 
   /* The number of iterations of the loop.  */
   rtx niter_expr;
@@ -440,7 +412,7 @@ struct GTY(()) niter_desc
 extern void iv_analysis_loop_init (struct loop *);
 extern bool iv_analyze (rtx_insn *, rtx, struct rtx_iv *);
 extern bool iv_analyze_result (rtx_insn *, rtx, struct rtx_iv *);
-extern bool iv_analyze_expr (rtx_insn *, rtx, enum machine_mode,
+extern bool iv_analyze_expr (rtx_insn *, rtx, machine_mode,
                             struct rtx_iv *);
 extern rtx get_iv_value (struct rtx_iv *, rtx);
 extern bool biv_p (rtx_insn *, rtx);
@@ -733,10 +705,8 @@ enum
   UAP_UNROLL_ALL = 2   /* Enables unrolling of all loops.  */
 };
 
-extern void unroll_loops (int);
 extern void doloop_optimize_loops (void);
 extern void move_loop_invariants (void);
-extern void scale_loop_profile (struct loop *loop, int scale, gcov_type iteration_bound);
 extern vec<basic_block> get_loop_hot_path (const struct loop *loop);
 
 /* Returns the outermost loop of the loop nest that contains LOOP.*/