tree-vect-stmts.c (vectorizable_shift): Add missed test on vect_induction_def.
gcc/ * tree-vect-stmts.c (vectorizable_shift): Add missed test on vect_induction_def. gcc/testsuite: * gcc.target/i386/avx2-vect-shift.c: New test. From-SVN: r226781
This commit is contained in:
parent
b32bc1ac16
commit
dbfa87aa87
4 changed files with 28 additions and 1 deletions
|
@ -1,3 +1,8 @@
|
|||
2015-08-11 Yuri Rumyantsev <ysrumyan@gmail.com>
|
||||
|
||||
* tree-vect-stmts.c (vectorizable_shift): Add missed test on
|
||||
vect_induction_def.
|
||||
|
||||
2015-08-11 Manuel López-Ibáñez <manu@gcc.gnu.org>
|
||||
|
||||
PR c/66098
|
||||
|
|
|
@ -1,3 +1,7 @@
|
|||
2015-08-11 Yuri Rumyantsev <ysrumyan@gmail.com>
|
||||
|
||||
* gcc.target/i386/avx2-vect-shift.c: New test.
|
||||
|
||||
2015-08-11 Manuel López-Ibáñez <manu@gcc.gnu.org>
|
||||
|
||||
PR c/66098
|
||||
|
|
16
gcc/testsuite/gcc.target/i386/avx2-vect-shift.c
Normal file
16
gcc/testsuite/gcc.target/i386/avx2-vect-shift.c
Normal file
|
@ -0,0 +1,16 @@
|
|||
/* { dg-do compile } */
|
||||
/* { dg-require-effective-target avx2 } */
|
||||
/* { dg-options "-mavx2 -O3 -fdump-tree-vect-details" } */
|
||||
|
||||
#define N 32
|
||||
typedef unsigned int u32;
|
||||
u32 a[N];
|
||||
|
||||
void foo()
|
||||
{
|
||||
int i;
|
||||
for (i=0; i<N;i++)
|
||||
a[i] = 1 << i;
|
||||
}
|
||||
/* { dg-final { scan-tree-dump "LOOP VECTORIZED" "vect" } } */
|
||||
/* { dg-final { cleanup-tree-dump "vect" } } */
|
|
@ -4461,7 +4461,9 @@ vectorizable_shift (gimple stmt, gimple_stmt_iterator *gsi,
|
|||
/* Determine whether the shift amount is a vector, or scalar. If the
|
||||
shift/rotate amount is a vector, use the vector/vector shift optabs. */
|
||||
|
||||
if (dt[1] == vect_internal_def && !slp_node)
|
||||
if ((dt[1] == vect_internal_def
|
||||
|| dt[1] == vect_induction_def)
|
||||
&& !slp_node)
|
||||
scalar_shift_arg = false;
|
||||
else if (dt[1] == vect_constant_def
|
||||
|| dt[1] == vect_external_def
|
||||
|
|
Loading…
Add table
Reference in a new issue