Use vec_perm_builder::series_p in shift_amt_for_vec_perm_mask
authorRichard Sandiford <richard.sandiford@linaro.org>
Tue, 2 Jan 2018 18:27:24 +0000 (18:27 +0000)
committerRichard Sandiford <rsandifo@gcc.gnu.org>
Tue, 2 Jan 2018 18:27:24 +0000 (18:27 +0000)
commitd3867483044ae00bac6daaeac6274e95254fb991
treef88513d11adda2c227b64b6e7453d3b2d8b40afc
parent1a1c441dbe5933ebf9180831236aa5be7d70a434
Use vec_perm_builder::series_p in shift_amt_for_vec_perm_mask

This patch makes shift_amt_for_vec_perm_mask use series_p to check
for the simple case of a natural linear series before falling back
to testing each element individually.  The series_p test works with
variable-length vectors but testing every individual element doesn't.

2018-01-02  Richard Sandiford  <richard.sandiford@linaro.org>

gcc/
* optabs.c (shift_amt_for_vec_perm_mask): Try using series_p
before testing each element individually.
* tree-vect-generic.c (lower_vec_perm): Likewise.

From-SVN: r256099
gcc/ChangeLog
gcc/optabs.c
gcc/tree-vect-generic.c