diff options
author | Jan Hubicka <jh@suse.cz> | 2012-11-06 14:49:30 +0100 |
---|---|---|
committer | Jan Hubicka <hubicka@gcc.gnu.org> | 2012-11-06 13:49:30 +0000 |
commit | 22458c5af737bc36c02ff575f397cf40cb180dd6 (patch) | |
tree | 44114c90b1d256643a9aab059bc90c1f26b5f113 /gcc/tree-vect-loop-manip.c | |
parent | c8fef899e88a4978b1391d2cae4cd240c644afbe (diff) | |
download | gcc-22458c5af737bc36c02ff575f397cf40cb180dd6.zip gcc-22458c5af737bc36c02ff575f397cf40cb180dd6.tar.gz gcc-22458c5af737bc36c02ff575f397cf40cb180dd6.tar.bz2 |
l_fma_float_?.c: Update.
* gcc.target/i386/l_fma_float_?.c: Update.
* gcc.target/i386/l_fma_double_?.c: Update.
* tree-vect-loop-manip.c (vect_do_peeling_for_loop_bound,
vect_do_peeling_for_alignment): Fix loop bound computation.
* tree-vect-loop.c (vect_transform_loop): Maintain loop bounds.
From-SVN: r193241
Diffstat (limited to 'gcc/tree-vect-loop-manip.c')
-rw-r--r-- | gcc/tree-vect-loop-manip.c | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/gcc/tree-vect-loop-manip.c b/gcc/tree-vect-loop-manip.c index 3c356e3..58ded23 100644 --- a/gcc/tree-vect-loop-manip.c +++ b/gcc/tree-vect-loop-manip.c @@ -1954,9 +1954,16 @@ vect_do_peeling_for_loop_bound (loop_vec_info loop_vinfo, tree *ratio, by ratio_mult_vf_name steps. */ vect_update_ivs_after_vectorizer (loop_vinfo, ratio_mult_vf_name, update_e); - max_iter = LOOP_VINFO_VECT_FACTOR (loop_vinfo) - 1; + /* For vectorization factor N, we need to copy last N-1 values in epilogue + and this means N-2 loopback edge executions. + + PEELING_FOR_GAPS works by subtracting last iteration and thus the epilogue + will execute at least LOOP_VINFO_VECT_FACTOR times. */ + max_iter = (LOOP_VINFO_PEELING_FOR_GAPS (loop_vinfo) + ? LOOP_VINFO_VECT_FACTOR (loop_vinfo) * 2 + : LOOP_VINFO_VECT_FACTOR (loop_vinfo)) - 2; if (check_profitability) - max_iter = MAX (max_iter, (int) th); + max_iter = MAX (max_iter, (int) th - 1); record_niter_bound (new_loop, double_int::from_shwi (max_iter), false, true); dump_printf (MSG_OPTIMIZED_LOCATIONS, "Setting upper bound of nb iterations for epilogue " @@ -2186,9 +2193,11 @@ vect_do_peeling_for_alignment (loop_vec_info loop_vinfo, #ifdef ENABLE_CHECKING slpeel_verify_cfg_after_peeling (new_loop, loop); #endif - max_iter = LOOP_VINFO_VECT_FACTOR (loop_vinfo) - 1; + /* For vectorization factor N, we need to copy at most N-1 values + for alignment and this means N-2 loopback edge executions. */ + max_iter = LOOP_VINFO_VECT_FACTOR (loop_vinfo) - 2; if (check_profitability) - max_iter = MAX (max_iter, (int) th); + max_iter = MAX (max_iter, (int) th - 1); record_niter_bound (new_loop, double_int::from_shwi (max_iter), false, true); dump_printf (MSG_OPTIMIZED_LOCATIONS, "Setting upper bound of nb iterations for prologue " |