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
- 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.
ba12948 Avoid minimum - 1 confusion in vectoriser
gcc/ChangeLog | 10 ++++++++++
gcc/tree-vect-loop-manip.c | 2 +-
gcc/tree-vect-loop.c | 34 ++++++++++++----------------------
3 files changed, 23 insertions(+), 23 deletions(-)