From 1dae21ad9797ae5cb77db3f2d85e854f3ae121f4 Mon Sep 17 00:00:00 2001 From: Richard Biener Date: Fri, 21 Jul 2017 07:13:57 +0000 Subject: [PATCH] re PR tree-optimization/81303 (410.bwaves regression caused by r249919) 2016-07-21 Richard Biener PR tree-optimization/81303 * tree-vect-loop.c (vect_estimate_min_profitable_iters): Take into account prologue and epilogue iterations when raising min_profitable_iters to sth at least covering one vector iteration. From-SVN: r250416 --- gcc/ChangeLog | 7 +++++++ gcc/tree-vect-loop.c | 5 +++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 2e29894a920..e5bd2bf58bc 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +2016-07-21 Richard Biener + + PR tree-optimization/81303 + * tree-vect-loop.c (vect_estimate_min_profitable_iters): Take + into account prologue and epilogue iterations when raising + min_profitable_iters to sth at least covering one vector iteration. + 2017-07-21 Tamar Christina * config/arm/arm.c (arm_test_cpu_arch_dat): diff --git a/gcc/tree-vect-loop.c b/gcc/tree-vect-loop.c index 7bae41680af..64d86995c84 100644 --- a/gcc/tree-vect-loop.c +++ b/gcc/tree-vect-loop.c @@ -3702,8 +3702,9 @@ vect_estimate_min_profitable_iters (loop_vec_info loop_vinfo, " Calculated minimum iters for profitability: %d\n", min_profitable_iters); - min_profitable_iters = - min_profitable_iters < vf ? vf : min_profitable_iters; + /* We want the vectorized loop to execute at least once. */ + if (min_profitable_iters < (vf + peel_iters_prologue + peel_iters_epilogue)) + min_profitable_iters = vf + peel_iters_prologue + peel_iters_epilogue; if (dump_enabled_p ()) dump_printf_loc (MSG_NOTE, vect_location, -- 2.30.2