diff options
author | Sudakshina Das <sudi.das@arm.com> | 2019-12-09 10:22:01 +0000 |
---|---|---|
committer | Sudakshina Das <sudi@gcc.gnu.org> | 2019-12-09 10:22:01 +0000 |
commit | e3126e5f649c8eebe07fc517d86f10d6867b7eec (patch) | |
tree | 666f91365cb8eb2177a3b7b04ea599caacd740ca /gcc/ChangeLog | |
parent | 49647b7b25673273262fb630598027c6d841690f (diff) | |
download | gcc-e3126e5f649c8eebe07fc517d86f10d6867b7eec.tar.gz |
[GCC, Vect] Fix costing for vector shifts
While looking at the vectorization for following example, we realized that
even though vectorizable_shift function was distinguishing vector shifted
by vector from vector shifted by scalar, while modelling the cost it would
always add the cost of building a vector constant despite not needing it for
vector shifted by scalar.
This patch fixes this by using scalar_shift_arg to determine whether we need
to build a vector for the second operand or not. This causes the test case
below to now vectorize.
gcc/ChangeLog:
2019-12-09 Sudakshina Das <sudi.das@arm.com>
Richard Sandiford <richard.sandiford@arm.com>
* tree-vect-stmt.c (vectorizable_shift): Condition ndts for
vect_model_simple_cost call on scalar_shift_arg.
gcc/testsuite/ChangeLog:
2019-12-09 Sudakshina Das <sudi.das@arm.com>
* gcc.dg/vect/vect-shift-5.c: New test.
Co-Authored-By: Richard Sandiford <richard.sandiford@arm.com>
From-SVN: r279114
Diffstat (limited to 'gcc/ChangeLog')
-rw-r--r-- | gcc/ChangeLog | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 1c953d29b86..3d98bef0136 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2019-12-09 Sudakshina Das <sudi.das@arm.com> + Richard Sandiford <richard.sandiford@arm.com> + + * tree-vect-stmt.c (vectorizable_shift): Condition ndts for + vect_model_simple_cost call on scalar_shift_arg. + 2019-12-09 Jakub Jelinek <jakub@redhat.com> PR tree-optimization/92834 |