/* 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.
#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
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. */
/* 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;
/* 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 *);
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);
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
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;
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;
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);
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.*/