On Thu, Jun 2, 2011 at 6:06 PM, Ira Rosen <ira.ro...@linaro.org> wrote: > On 26 May 2011 10:52, Ira Rosen <ira.ro...@linaro.org> wrote: >> Hi, >> >> The vectorizer supports strided loads with gaps, e.g., when only a[4i] >> and a[4i+2] are accessed, it generates a vector load a[4i:4i+3], i.e., >> creating an access to a[4i+3], which doesn't exist in the scalar code. >> This access maybe invalid as described in the PR. >> >> This patch creates an epilogue loop (with at least one iteration) for >> such cases. >> >> Bootstrapped and tested on powerpc64-suse-linux. >> Applied to trunk. I'll prepare patches for 4.5 and 4.6 next week. >> > > Here are the patches. Bootstrapped and tested on x86_64-suse-linux > (4.5) and on powerpc64-suse-linux (4.6). > OK to apply?
Ok. Thanks, Richard. > Thanks, > Ira > > > 4.6 ChangeLog: > > PR tree-optimization/49038 > * tree-vect-loop-manip.c (vect_generate_tmps_on_preheader): > Ensure at least one epilogue iteration if required by data > accesses with gaps. > * tree-vectorizer.h (struct _loop_vec_info): Add new field > to mark loops that require peeling for gaps. > * tree-vect-loop.c (new_loop_vec_info): Initialize new field. > (vect_get_known_peeling_cost): Take peeling for gaps into > account. > (vect_transform_loop): Generate epilogue if required by data > access with gaps. > * tree-vect-data-refs.c (vect_analyze_group_access): Mark the > loop as requiring an epilogue if there are gaps in the end of > the strided group. > > 4.5 ChangeLog: > > PR tree-optimization/49038 > * tree-vect-loop-manip.c (vect_generate_tmps_on_preheader): > Ensure at least one epilogue iteration if required by data > accesses with gaps. > * tree-vectorizer.h (struct _loop_vec_info): Add new field > to mark loops that require peeling for gaps. > * tree-vect-loop.c (new_loop_vec_info): Initialize new field. > (vect_estimate_min_profitable_iters): Take peeling for gaps > into > account. > (vect_transform_loop): Generate epilogue if required by data > access with gaps. > * tree-vect-data-refs.c (vect_analyze_group_access): Mark the > loop as requiring an epilogue if there are gaps in the end of > the strided group. > > 4.6 and 4.5 testsuite/ChangeLog: > > PR tree-optimization/49038 > * gcc.dg/vect/vect-strided-u8-i8-gap4-unknown.c: New test. > * gcc.dg/vect/pr49038.c: New test. >