+2013-04-04 Richard Biener <rguenther@suse.de>
+
+ PR tree-optimization/56826
+ * tree-vect-slp.c (vect_build_slp_tree): Compute ncopies
+ more accurately.
+
2013-04-04 Richard Biener <rguenther@suse.de>
PR tree-optimization/56213
+2013-04-04 Richard Biener <rguenther@suse.de>
+
+ PR tree-optimization/56826
+ * gcc.dg/vect/pr56826.c: New testcase.
+ * gcc.dg/vect/O3-pr36098.c: Adjust.
+
2013-04-04 Tejas Belagod <tejas.belagod@arm.com>
* gcc.target/aarch64/inc/asm-adder-clobber-lr.c: Remove duplication.
iatom[m]=sb[i].iatom[m];
}
-/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 1 "vect" } } */
+/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 0 "vect" } } */
/* { dg-final { cleanup-tree-dump "vect" } } */
--- /dev/null
+extern void abort (void);\r
+\r
+typedef struct {\r
+ int a[3];\r
+ int num;\r
+} t1;\r
+t1 B[100];\r
+int A[300];\r
+\r
+void __attribute__((noinline,noclone))\r
+bar (int *A, t1 *B, int n)\r
+{\r
+ int i;\r
+ int *a = A;\r
+ for (i=0; i<n; i++, a+=3)\r
+ {\r
+ a[0] = B[i].a[0];\r
+ a[1] = B[i].a[1];\r
+ a[2] = B[i].a[2];\r
+ }\r
+}\r
+\r
+int main()\r
+{\r
+ int i;\r
+ for (i=0; i<100; i++) \r
+ {\r
+ B[i].num = i;\r
+ B[i].a[0] = i * 3;\r
+ B[i].a[1] = i * 3 + 1;\r
+ B[i].a[2] = i * 3 + 2;\r
+ __asm__ volatile ("");\r
+ }\r
+ bar (&A[0], &B[0], 100);\r
+ for (i=0; i<300; i++)\r
+ if (A[i] != i)\r
+ abort ();\r
+ return 0;\r
+} \r
+\r
+/* { dg-final { cleanup-tree-dump "vect" } } */\r
tree lhs;
bool stop_recursion = false, need_same_oprnds = false;
tree vectype, scalar_type, first_op1 = NULL_TREE;
- unsigned int ncopies;
optab optab;
int icode;
enum machine_mode optab_op2_mode;
vectorization_factor = *max_nunits;
}
- ncopies = vectorization_factor / TYPE_VECTOR_SUBPARTS (vectype);
-
if (is_gimple_call (stmt))
{
rhs_code = CALL_EXPR;
else
{
/* Load. */
+ unsigned unrolling_factor
+ = least_common_multiple
+ (*max_nunits, group_size) / group_size;
/* FORNOW: Check that there is no gap between the loads
and no gap between the groups when we need to load
multiple groups at once.
??? We should enhance this to only disallow gaps
inside vectors. */
- if ((ncopies > 1
+ if ((unrolling_factor > 1
&& GROUP_FIRST_ELEMENT (vinfo_for_stmt (stmt)) == stmt
&& GROUP_GAP (vinfo_for_stmt (stmt)) != 0)
|| (GROUP_FIRST_ELEMENT (vinfo_for_stmt (stmt)) != stmt
/* Check that the size of interleaved loads group is not
greater than the SLP group size. */
+ unsigned ncopies
+ = vectorization_factor / TYPE_VECTOR_SUBPARTS (vectype);
if (loop_vinfo
&& GROUP_FIRST_ELEMENT (vinfo_for_stmt (stmt)) == stmt
&& ((GROUP_SIZE (vinfo_for_stmt (stmt))