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
+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
+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
--- /dev/null
+/* { 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" } } */
/* 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