This is the mail archive of the
mailing list for the GCC project.
Re: RFA: Avoid versioning loop with unaligned step
- From: Richard Biener <richard dot guenther at gmail dot com>
- To: Joern Wolfgang Rennecke <gnu at amylaar dot uk>, Richard Sandiford <rdsandiford at googlemail dot com>
- Cc: GCC Patches <gcc-patches at gcc dot gnu dot org>
- Date: Thu, 20 Dec 2018 17:18:22 +0100
- Subject: Re: RFA: Avoid versioning loop with unaligned step
- References: <5C1B9C8E.firstname.lastname@example.org>
On Thu, Dec 20, 2018 at 2:43 PM Joern Wolfgang Rennecke <email@example.com> wrote:
> eSi-RISC has vector permute functionality, but no unaligned loads. We
> see execution failures on gcc.dg/vect/slp-perm-12.c because loop
> versioning is used to make the tptr aligned for the first loop
> iteration, and then with a step of originally 11, 22 after
> vectorization, and a vector alignment of 8 bytes, the second iteration
> causes an AlignmentError exception.
> The attached patch to tree-vect-data-refs.c suppresses attempts to align
> data accesses where the
> step alignment times the vectorization factor is insufficient to sustain
> the alignment during the loop.
> Bootstrapped and regression tested on x86_64-pc-linux-gnu .
> I have also attached a matching testsuite patch to not expect SLP
> vectorization for slp-perm-12 when
> no unaligned loads are available, although in terms of testing, I can
> only say that it works for us.
vect_compute_data_ref_alignment uses DR_TARGET_ALIGNMENT
and DR_STEP_ALIGNMENT () % dr_target-alignment == 0 as check.
I think it's preferable to use the same or similar values for the desired
Otherwise this looks OK to me.