vect: Fix an ICE in exact_div [PR95961]
In the test case for PR95961, vectorization factor computed
by vect_determine_vectorization_factor is [8,8]. But this is
updated to [1,1] later by vect_update_vf_for_slp. When we call
vect_get_num_vectors in vect_enhance_data_refs_alignment, the number
of scalars which is based on the vectorization factor is not a multiple
of the the number of elements in the vector type. This leads to
the ICE. This isn't a simple stream of contiguous vector accesses.
It's hard to predict from the available information how many vector
accesses we'll actually need per iteration. As discussed, here we
should use the number of scalars instead of the number of vectors as
an upper bound for the loop saving info about DR in the hash table.
2020-07-02 Felix Yang <felix.yang@huawei.com>
gcc/
PR tree-optimization/95961
* tree-vect-data-refs.c (vect_enhance_data_refs_alignment): Use the
number of scalars instead of the number of vectors as an upper bound
for the loop saving info about DR in the hash table. Remove unused
local variables.
gcc/testsuite/
PR tree-optimization/95961
* gcc.target/aarch64/sve/pr95961.c: New test.