@@ -1,5 +1,19 @@
2014-10-24 David Malcolm <dmalcolm@redhat.com>
+ Concretize get_loop_exit_condition et al to working on gimple_cond
+
+ * tree-scalar-evolution.h (get_loop_exit_condition): Return a
+ gimple_cond.
+ * tree-scalar-evolution.c (get_loop_exit_condition): Likewise, also
+ concretizing local "res" from gimple to gimple_cond.
+ * tree-vect-loop-manip.c (slpeel_make_loop_iterate_ntimes): Convert
+ locals from gimple to gimple_cond.
+ (slpeel_can_duplicate_loop_p): Likewise.
+ * tree-vect-loop.c (vect_get_loop_niters): Return a gimple_cond.
+ (vect_analyze_loop_form): Convert local from gimple to gimple_cond.
+
+2014-10-24 David Malcolm <dmalcolm@redhat.com>
+
Update various expressions within tree-scalar-evolution.c to be gimple_phi
* tree-scalar-evolution.c (follow_ssa_edge): Require a gimple_phi,
@@ -867,10 +867,10 @@ add_to_evolution (unsigned loop_nb, tree chrec_before, enum tree_code code,
guards the exit edge. If the expression is too difficult to
analyze, then give up. */
-gimple
+gimple_cond
get_loop_exit_condition (const struct loop *loop)
{
- gimple res = NULL;
+ gimple_cond res = NULL;
edge exit_edge = single_exit (loop);
if (dump_file && (dump_flags & TDF_SCEV))
@@ -881,8 +881,8 @@ get_loop_exit_condition (const struct loop *loop)
gimple stmt;
stmt = last_stmt (exit_edge->src);
- if (gimple_code (stmt) == GIMPLE_COND)
- res = stmt;
+ if (gimple_cond cond_stmt = dyn_cast <gimple_cond> (stmt))
+ res = cond_stmt;
}
if (dump_file && (dump_flags & TDF_SCEV))
@@ -22,7 +22,7 @@ along with GCC; see the file COPYING3. If not see
#define GCC_TREE_SCALAR_EVOLUTION_H
extern tree number_of_latch_executions (struct loop *);
-extern gimple get_loop_exit_condition (const struct loop *);
+extern gimple_cond get_loop_exit_condition (const struct loop *);
extern void scev_initialize (void);
extern bool scev_initialized_p (void);
@@ -667,8 +667,8 @@ void
slpeel_make_loop_iterate_ntimes (struct loop *loop, tree niters)
{
tree indx_before_incr, indx_after_incr;
- gimple cond_stmt;
- gimple orig_cond;
+ gimple_cond cond_stmt;
+ gimple_cond orig_cond;
edge exit_edge = single_exit (loop);
gimple_stmt_iterator loop_cond_gsi;
gimple_stmt_iterator incr_gsi;
@@ -974,7 +974,7 @@ slpeel_can_duplicate_loop_p (const struct loop *loop, const_edge e)
{
edge exit_e = single_exit (loop);
edge entry_e = loop_preheader_edge (loop);
- gimple orig_cond = get_loop_exit_condition (loop);
+ gimple_cond orig_cond = get_loop_exit_condition (loop);
gimple_stmt_iterator loop_exit_gsi = gsi_last_bb (exit_e->src);
if (loop->inner
@@ -805,7 +805,8 @@ vect_analyze_scalar_cycles (loop_vec_info loop_vinfo)
Return the loop exit condition. */
-static gimple
+
+static gimple_cond
vect_get_loop_niters (struct loop *loop, tree *number_of_iterations,
tree *number_of_iterationsm1)
{
@@ -1085,7 +1086,7 @@ loop_vec_info
vect_analyze_loop_form (struct loop *loop)
{
loop_vec_info loop_vinfo;
- gimple loop_cond;
+ gimple_cond loop_cond;
tree number_of_iterations = NULL, number_of_iterationsm1 = NULL;
loop_vec_info inner_loop_vinfo = NULL;