gcc/ * 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. --- gcc/tree-scalar-evolution.c | 8 ++++---- gcc/tree-scalar-evolution.h | 2 +- gcc/tree-vect-loop-manip.c | 6 +++--- gcc/tree-vect-loop.c | 5 +++-- 4 files changed, 11 insertions(+), 10 deletions(-)
diff --git a/gcc/tree-scalar-evolution.c b/gcc/tree-scalar-evolution.c index 14dbd45..40f9901 100644 --- a/gcc/tree-scalar-evolution.c +++ b/gcc/tree-scalar-evolution.c @@ -868,10 +868,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)) @@ -882,8 +882,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 = stmt->dyn_cast_gimple_cond ()) + res = cond_stmt; } if (dump_file && (dump_flags & TDF_SCEV)) diff --git a/gcc/tree-scalar-evolution.h b/gcc/tree-scalar-evolution.h index 5569976..3466a75 100644 --- a/gcc/tree-scalar-evolution.h +++ b/gcc/tree-scalar-evolution.h @@ -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); diff --git a/gcc/tree-vect-loop-manip.c b/gcc/tree-vect-loop-manip.c index 15d9a53..b0b6bbe 100644 --- a/gcc/tree-vect-loop-manip.c +++ b/gcc/tree-vect-loop-manip.c @@ -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 diff --git a/gcc/tree-vect-loop.c b/gcc/tree-vect-loop.c index 220f665..3781d43 100644 --- a/gcc/tree-vect-loop.c +++ b/gcc/tree-vect-loop.c @@ -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) { @@ -1084,7 +1085,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; -- 1.8.5.3