From 80be3333236f4fcb03e15811d4b8487a604bf866 Mon Sep 17 00:00:00 2001 From: Richard Sandiford Date: Mon, 3 Jul 2017 16:30:43 +0000 Subject: Avoid minimum - 1 confusion in vectoriser The variables that claimed to be the "minimum number of iterations" for which vectorisation was profitable were actually the maximum number of iterations for which vectorisation wasn't profitable. The loop threshold was too. This patch makes the values be what the variable names suggest. 2017-07-03 Richard Sandiford gcc/ * tree-vect-loop.c (vect_analyze_loop_2): Treat min_scalar_loop_bound, min_profitable_iters, and th as inclusive lower bounds. Fix LOOP_VINFO_PEELING_FOR_GAPS condition. (vect_estimate_min_profitable_iters): Return inclusive lower bounds for min_profitable_iters and min_profitable_estimate. (vect_transform_loop): Treat th as an inclusive lower bound. * tree-vect-loop-manip.c (vect_loop_versioning): Likewise. From-SVN: r249927 --- gcc/tree-vect-loop-manip.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'gcc/tree-vect-loop-manip.c') diff --git a/gcc/tree-vect-loop-manip.c b/gcc/tree-vect-loop-manip.c index aa52c50..34e4aa2 100644 --- a/gcc/tree-vect-loop-manip.c +++ b/gcc/tree-vect-loop-manip.c @@ -2142,7 +2142,7 @@ vect_loop_versioning (loop_vec_info loop_vinfo, bool version_niter = LOOP_REQUIRES_VERSIONING_FOR_NITERS (loop_vinfo); if (check_profitability) - cond_expr = fold_build2 (GT_EXPR, boolean_type_node, scalar_loop_iters, + cond_expr = fold_build2 (GE_EXPR, boolean_type_node, scalar_loop_iters, build_int_cst (TREE_TYPE (scalar_loop_iters), th)); -- cgit v1.1