Alternative check for vector refs with same alignment
commit7d4e73a684a9afa4ce00a4ad3efb288566e0f42e
authorrsandifo <rsandifo@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 31 May 2017 12:05:10 +0000 (31 12:05 +0000)
committerrsandifo <rsandifo@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 31 May 2017 12:05:10 +0000 (31 12:05 +0000)
treee197071263e0149c8d712d55d10e9c39086d8679
parent3e5b5cb2a8a042fd3bb922313610e8672cdc2f93
Alternative check for vector refs with same alignment

vect_find_same_alignment_drs uses the ddr dependence distance
to tell whether two references have the same alignment.  Although
that's safe with the current code, there's no particular reason
why a dependence distance of 0 should mean that the accesses start
on the same byte.  E.g. a reference to a full complex value could
in principle depend on a reference to the imaginary component.
A later patch adds support for this kind of dependence.

On the other side, checking modulo vf is pessimistic when the step
divided by the element size is a factor of 2.

This patch instead looks for cases in which the drs have the same
base, offset and step, and for which the difference in their constant
initial values is a multiple of the alignment.

2017-05-03  Richard Sandiford  <richard.sandiford@linaro.org>

gcc/
* tree-vect-data-refs.c (vect_find_same_alignment_drs): Remove
loop_vinfo argument and use of dependence distance vectors.
Check instead whether the two references differ only in their
initial value and assume that they have the same alignment if the
difference is a multiple of the vector alignment.
(vect_analyze_data_refs_alignment): Update call accordingly.

gcc/testsuite/
* gcc.dg/vect/vect-103.c: Update wording of dump message.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@248730 138bc75d-0d04-0410-961f-82ee72b054a4
gcc/ChangeLog
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/vect/vect-103.c
gcc/tree-vect-data-refs.c