On Thu, May 26, 2011 at 12:52 AM, 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.
>
> Ira
>
>
> 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.
>
> testsuite/ChangeLog:
>
>        PR tree-optimization/49038
>        * gcc.dg/vect/vect-strided-u8-i8-gap4-unknown.c: New test.

This test fails at run-time at random on Linux/ia32:

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49239


-- 
H.J.

Reply via email to