Commit 314f64eb by Richard Biener Committed by Richard Biener

re PR tree-optimization/56826 (Run-fail after r197189.)

2013-04-04  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/56826
	* tree-vect-slp.c (vect_build_slp_tree): Compute ncopies
	more accurately.

	* gcc.dg/vect/pr56826.c: New testcase.
	* gcc.dg/vect/O3-pr36098.c: Adjust.

From-SVN: r197486
parent 48f3c266
2013-04-04 Richard Biener <rguenther@suse.de> 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 PR tree-optimization/56213
* tree-vect-data-refs.c (vect_check_strided_load): Remove. * tree-vect-data-refs.c (vect_check_strided_load): Remove.
(vect_analyze_data_refs): Allow all non-nested loads as (vect_analyze_data_refs): Allow all non-nested loads as
......
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> 2013-04-04 Tejas Belagod <tejas.belagod@arm.com>
* gcc.target/aarch64/inc/asm-adder-clobber-lr.c: Remove duplication. * gcc.target/aarch64/inc/asm-adder-clobber-lr.c: Remove duplication.
......
...@@ -17,5 +17,5 @@ void foo (int ncons, t_sortblock *sb, int *iatom) ...@@ -17,5 +17,5 @@ void foo (int ncons, t_sortblock *sb, int *iatom)
iatom[m]=sb[i].iatom[m]; 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" } } */ /* { dg-final { cleanup-tree-dump "vect" } } */
extern void abort (void);
typedef struct {
int a[3];
int num;
} t1;
t1 B[100];
int A[300];
void __attribute__((noinline,noclone))
bar (int *A, t1 *B, int n)
{
int i;
int *a = A;
for (i=0; i<n; i++, a+=3)
{
a[0] = B[i].a[0];
a[1] = B[i].a[1];
a[2] = B[i].a[2];
}
}
int main()
{
int i;
for (i=0; i<100; i++)
{
B[i].num = i;
B[i].a[0] = i * 3;
B[i].a[1] = i * 3 + 1;
B[i].a[2] = i * 3 + 2;
__asm__ volatile ("");
}
bar (&A[0], &B[0], 100);
for (i=0; i<300; i++)
if (A[i] != i)
abort ();
return 0;
}
/* { dg-final { cleanup-tree-dump "vect" } } */
...@@ -470,7 +470,6 @@ vect_build_slp_tree (loop_vec_info loop_vinfo, bb_vec_info bb_vinfo, ...@@ -470,7 +470,6 @@ vect_build_slp_tree (loop_vec_info loop_vinfo, bb_vec_info bb_vinfo,
tree lhs; tree lhs;
bool stop_recursion = false, need_same_oprnds = false; bool stop_recursion = false, need_same_oprnds = false;
tree vectype, scalar_type, first_op1 = NULL_TREE; tree vectype, scalar_type, first_op1 = NULL_TREE;
unsigned int ncopies;
optab optab; optab optab;
int icode; int icode;
enum machine_mode optab_op2_mode; enum machine_mode optab_op2_mode;
...@@ -577,8 +576,6 @@ vect_build_slp_tree (loop_vec_info loop_vinfo, bb_vec_info bb_vinfo, ...@@ -577,8 +576,6 @@ vect_build_slp_tree (loop_vec_info loop_vinfo, bb_vec_info bb_vinfo,
vectorization_factor = *max_nunits; vectorization_factor = *max_nunits;
} }
ncopies = vectorization_factor / TYPE_VECTOR_SUBPARTS (vectype);
if (is_gimple_call (stmt)) if (is_gimple_call (stmt))
{ {
rhs_code = CALL_EXPR; rhs_code = CALL_EXPR;
...@@ -741,12 +738,15 @@ vect_build_slp_tree (loop_vec_info loop_vinfo, bb_vec_info bb_vinfo, ...@@ -741,12 +738,15 @@ vect_build_slp_tree (loop_vec_info loop_vinfo, bb_vec_info bb_vinfo,
else else
{ {
/* Load. */ /* Load. */
unsigned unrolling_factor
= least_common_multiple
(*max_nunits, group_size) / group_size;
/* FORNOW: Check that there is no gap between the loads /* FORNOW: Check that there is no gap between the loads
and no gap between the groups when we need to load and no gap between the groups when we need to load
multiple groups at once. multiple groups at once.
??? We should enhance this to only disallow gaps ??? We should enhance this to only disallow gaps
inside vectors. */ inside vectors. */
if ((ncopies > 1 if ((unrolling_factor > 1
&& GROUP_FIRST_ELEMENT (vinfo_for_stmt (stmt)) == stmt && GROUP_FIRST_ELEMENT (vinfo_for_stmt (stmt)) == stmt
&& GROUP_GAP (vinfo_for_stmt (stmt)) != 0) && GROUP_GAP (vinfo_for_stmt (stmt)) != 0)
|| (GROUP_FIRST_ELEMENT (vinfo_for_stmt (stmt)) != stmt || (GROUP_FIRST_ELEMENT (vinfo_for_stmt (stmt)) != stmt
...@@ -767,6 +767,8 @@ vect_build_slp_tree (loop_vec_info loop_vinfo, bb_vec_info bb_vinfo, ...@@ -767,6 +767,8 @@ vect_build_slp_tree (loop_vec_info loop_vinfo, bb_vec_info bb_vinfo,
/* Check that the size of interleaved loads group is not /* Check that the size of interleaved loads group is not
greater than the SLP group size. */ greater than the SLP group size. */
unsigned ncopies
= vectorization_factor / TYPE_VECTOR_SUBPARTS (vectype);
if (loop_vinfo if (loop_vinfo
&& GROUP_FIRST_ELEMENT (vinfo_for_stmt (stmt)) == stmt && GROUP_FIRST_ELEMENT (vinfo_for_stmt (stmt)) == stmt
&& ((GROUP_SIZE (vinfo_for_stmt (stmt)) && ((GROUP_SIZE (vinfo_for_stmt (stmt))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment