summaryrefslogtreecommitdiffstats
path: root/gcc/cfgloop.h
diff options
context:
space:
mode:
authoramacleod <amacleod@138bc75d-0d04-0410-961f-82ee72b054a4>2013-10-09 13:09:23 +0000
committeramacleod <amacleod@138bc75d-0d04-0410-961f-82ee72b054a4>2013-10-09 13:09:23 +0000
commitf86b328b32d171e9f2c5274ea7bc2dd3e92ad827 (patch)
treedaafe0156356e7c30b23700b33e51ef2d3acc1a2 /gcc/cfgloop.h
parentd7dcba40a5768c70c40d1b7109377c78010abea4 (diff)
downloadppe42-gcc-f86b328b32d171e9f2c5274ea7bc2dd3e92ad827.tar.gz
ppe42-gcc-f86b328b32d171e9f2c5274ea7bc2dd3e92ad827.zip
* tree-flow.h: Move some protoypes. Include new tree-ssa-loop.h.
(struct affine_iv, struct tree_niter_desc): Move to tree-ssa-loop.h. (enum move_pos): Move to tree-ssa-loop-im.h * cfgloop.h: Move some prototypes. (gcov_type_to_double_int): relocate from tree-ssa-loop.niter.c. * tree-flow-inline.h (loop_containing_stmt): Move to tree-ssa-loop.h. * tree-ssa-loop.h: New File. Include other tree-ssa-loop-*.h files. (struct affine_iv, struct tree_niter_desc): Relocate from tree-flow.h. (loop_containing_stmt): Relocate from tree-flow-inline.h. * tree-ssa-loop-ch.c: (do_while_loop_p): Make static. * tree-ssa-loop-im.c (for_each_index): Move to tree-ssa-loop.c. (enum move_pos): Relocate here. (lsm_tmp_name_add, gen_lsm_tmp_name, get_lsm_tmp_name): Move to tree-ssa-loop.c. (execute_sm_if_changed_flag_set): Change get_lsm_tmp_name call. (tree_ssa_loop_im, gate_tree_ssa_loop_im, pass_data_lim, make_pass_lim): Relocate here from tree-ssa-loop.c. * tree-ssa-loop-ivcanon.c (tree_num_loop_insns): Move to tree-ssa-loop.c. (loop_edge_to_cancel, unloop_loops): Make static. (tree_ssa_loop_ivcanon, gate_tree_ssa_loop_ivcanon, pass_data_iv_canon, make_pass_iv_canon): Relocate from tree-ssa-loop.c. (tree_complete_unroll, gate_tree_complete_unroll, pass_data_complete_unroll, make_pass_complete_unroll): Relocate here. (tree_complete_unroll_inner, gate_tree_complete_unroll_inner, pass_data_complete_unrolli, make_pass_complete_unrolli): Relocate here. * tree-ssa-loop-ivopts.c: Remove local prototypes. (stmt_invariant_in_loop_p): Remove unused function. * tree-ssa-loop-ivopts.h: New file. Add prototypes. * tree-ssa-loop-manip.h: New file. Add prototypes. * tree-ssa-loop-niter.c (record_niter_bound): Move to cfgloop.c. (gcov_type_to_double_int): Move to cfgloop.h. (double_int_cmp, bound_index, estimate_numbers_of_iterations_loop): Make static. (estimated_loop_iterations): Factor out get_estimated_loop_iterations. (max_loop_iterations): Factor out get_max_loop_iterations. (estimated_loop_iterations_int, max_stmt_executions_int): Move to cfgloop.c. * tree-ssa-loop-niter.h: New file. Add prototypes. * tree-ssa-loop-prefetch.c (tree_ssa_loop_prefetch, gate_tree_ssa_loop_prefetch, pass_data_loop_prefetch, make_pass_loop_prefetch): Relocate from tree-ssa-loop.c. * tree-ssa-loop-unswitch.c (tree_ssa_loop_unswitch, gate_tree_ssa_loop_unswitch, pass_data_tree_unswitch, make_pass_tree_unswitch): Relocate from tree-ssa-loop.c. * tree-ssa-loop.c (tree_ssa_loop_im, gate_tree_ssa_loop_im, pass_data_lim, make_pass_lim): Move to tree-ssa-loop-im.c. (tree_ssa_loop_unswitch, gate_tree_ssa_loop_unswitch, pass_data_tree_unswitch, make_pass_tree_unswitch): Move. (tree_ssa_loop_ivcanon, gate_tree_ssa_loop_ivcanon, pass_data_iv_canon, make_pass_iv_canon, tree_complete_unroll, gate_tree_complete_unroll, pass_data_complete_unroll, make_pass_complete_unroll, tree_complete_unroll_inner, gate_tree_complete_unroll_inner, pass_data_complete_unrolli, make_pass_complete_unrolli): Move to tree-ssa-loop-ivcanon.c. (tree_ssa_loop_prefetch, gate_tree_ssa_loop_prefetch, pass_data_loop_prefetch, make_pass_loop_prefetch): Move to tree-ssa-loop-prefetch.c. (for_each_index, lsm_tmp_name_add, gen_lsm_tmp_name): Relocate from tree-ssa-loop-im.c. (get_lsm_tmp_name): Relocate and add suffix parameter. (tree_num_loop_insns): Relocate from tree-ssa-ivcanon.c. * tree-scalar-evolution.h (simple_iv): Don't use affive_iv typedef. * cfgloop.c (record_niter_bound, estimated_loop_iterations_int, max_stmt_executions_int): Move from tree-ssa-loop-niter.c. (get_estimated_loop_iterations): Factor out accessor from estimated_loop_iterations in tree-ssa-loop-niter.c. (get_max_loop_iterations): Factor out accessor from _max_loop_iterations in tree-ssa-niter.c. * loop-unroll.c (decide_unroll_constant_iterations, decide_unroll_runtime_iterations, decide_peel_simple, decide_unroll_stupid): Use new get_* accessors. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@203317 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cfgloop.h')
-rw-r--r--gcc/cfgloop.h33
1 files changed, 21 insertions, 12 deletions
diff --git a/gcc/cfgloop.h b/gcc/cfgloop.h
index 33d96fe5263..9048e022607 100644
--- a/gcc/cfgloop.h
+++ b/gcc/cfgloop.h
@@ -255,7 +255,6 @@ extern bool flow_bb_inside_loop_p (const struct loop *, const_basic_block);
extern struct loop * find_common_loop (struct loop *, struct loop *);
struct loop *superloop_at_depth (struct loop *, unsigned);
struct eni_weights_d;
-extern unsigned tree_num_loop_insns (struct loop *, struct eni_weights_d *);
extern int num_loop_insns (const struct loop *);
extern int average_num_loop_insns (const struct loop *);
extern unsigned get_loop_level (const struct loop *);
@@ -306,16 +305,6 @@ gcov_type expected_loop_iterations_unbounded (const struct loop *);
extern unsigned expected_loop_iterations (const struct loop *);
extern rtx doloop_condition_get (rtx);
-void estimate_numbers_of_iterations_loop (struct loop *);
-void record_niter_bound (struct loop *, double_int, bool, bool);
-bool estimated_loop_iterations (struct loop *, double_int *);
-bool max_loop_iterations (struct loop *, double_int *);
-HOST_WIDE_INT estimated_loop_iterations_int (struct loop *);
-HOST_WIDE_INT max_loop_iterations_int (struct loop *);
-bool max_stmt_executions (struct loop *, double_int *);
-bool estimated_stmt_executions (struct loop *, double_int *);
-HOST_WIDE_INT max_stmt_executions_int (struct loop *);
-HOST_WIDE_INT estimated_stmt_executions_int (struct loop *);
/* Loop manipulation. */
extern bool can_duplicate_loop_p (const struct loop *loop);
@@ -735,7 +724,6 @@ enum
extern void unroll_and_peel_loops (int);
extern void doloop_optimize_loops (void);
extern void move_loop_invariants (void);
-extern bool finite_loop_p (struct loop *);
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);
@@ -751,5 +739,26 @@ loop_outermost (struct loop *loop)
return (*loop->superloops)[1];
}
+extern void record_niter_bound (struct loop *, double_int, bool, bool);
+extern HOST_WIDE_INT estimated_loop_iterations_int (struct loop *);
+extern HOST_WIDE_INT max_loop_iterations_int (struct loop *);
+extern bool get_estimated_loop_iterations (struct loop *loop, double_int *nit);
+extern bool get_max_loop_iterations (struct loop *loop, double_int *nit);
+/* Converts VAL to double_int. */
+
+static inline double_int
+gcov_type_to_double_int (gcov_type val)
+{
+ double_int ret;
+
+ ret.low = (unsigned HOST_WIDE_INT) val;
+ /* If HOST_BITS_PER_WIDE_INT == HOST_BITS_PER_WIDEST_INT, avoid shifting by
+ the size of type. */
+ val >>= HOST_BITS_PER_WIDE_INT - 1;
+ val >>= 1;
+ ret.high = (unsigned HOST_WIDE_INT) val;
+
+ return ret;
+}
#endif /* GCC_CFGLOOP_H */
OpenPOWER on IntegriCloud