tree-vect-data-refs.c (vect_drs_dependent_in_basic_block): Use operand_equal_p to compare DR_BASE_ADDRESSes.

gcc/
	* tree-vect-data-refs.c (vect_drs_dependent_in_basic_block): Use
	operand_equal_p to compare DR_BASE_ADDRESSes.
	(vect_check_interleaving): Likewise.

gcc/testsuite/
	* gcc.dg/vect/vect-119.c: New test.

From-SVN: r172817
This commit is contained in:
Richard Sandiford 2011-04-21 09:39:57 +00:00 committed by Richard Sandiford
parent 5a2e560830
commit 0b5a27249a
4 changed files with 40 additions and 10 deletions

View File

@ -1,3 +1,9 @@
2011-04-21 Richard Sandiford <richard.sandiford@linaro.org>
* tree-vect-data-refs.c (vect_drs_dependent_in_basic_block): Use
operand_equal_p to compare DR_BASE_ADDRESSes.
(vect_check_interleaving): Likewise.
2011-04-21 Richard Sandiford <richard.sandiford@linaro.org>
PR target/46329

View File

@ -1,3 +1,7 @@
2011-04-21 Richard Sandiford <richard.sandiford@linaro.org>
* gcc.dg/vect/vect-119.c: New test.
2011-04-21 Richard Sandiford <richard.sandiford@linaro.org>
* gcc.dg/vect/vect.exp: Run the main tests twice, one with -flto

View File

@ -0,0 +1,28 @@
/* { dg-do compile } */
#define OUTER 32
#define INNER 40
static unsigned int
bar (const unsigned int x[INNER][2], unsigned int sum)
{
int i;
for (i = 0; i < INNER; i++)
sum += x[i][0] * x[i][0] + x[i][1] * x[i][1];
return sum;
}
unsigned int foo (const unsigned int x[OUTER][INNER][2])
{
int i;
unsigned int sum;
sum = 0.0f;
for (i = 0; i < OUTER; i++)
sum = bar (x[i], sum);
return sum;
}
/* { dg-final { scan-tree-dump-times "Detected interleaving of size 2" 1 "vect" } } */
/* { dg-final { cleanup-tree-dump "vect" } } */

View File

@ -314,11 +314,7 @@ vect_drs_dependent_in_basic_block (struct data_reference *dra,
/* Check that the data-refs have same bases and offsets. If not, we can't
determine if they are dependent. */
if ((DR_BASE_ADDRESS (dra) != DR_BASE_ADDRESS (drb)
&& (TREE_CODE (DR_BASE_ADDRESS (dra)) != ADDR_EXPR
|| TREE_CODE (DR_BASE_ADDRESS (drb)) != ADDR_EXPR
|| TREE_OPERAND (DR_BASE_ADDRESS (dra), 0)
!= TREE_OPERAND (DR_BASE_ADDRESS (drb),0)))
if (!operand_equal_p (DR_BASE_ADDRESS (dra), DR_BASE_ADDRESS (drb), 0)
|| !dr_equal_offsets_p (dra, drb))
return true;
@ -364,11 +360,7 @@ vect_check_interleaving (struct data_reference *dra,
/* Check that the data-refs have same first location (except init) and they
are both either store or load (not load and store). */
if ((DR_BASE_ADDRESS (dra) != DR_BASE_ADDRESS (drb)
&& (TREE_CODE (DR_BASE_ADDRESS (dra)) != ADDR_EXPR
|| TREE_CODE (DR_BASE_ADDRESS (drb)) != ADDR_EXPR
|| TREE_OPERAND (DR_BASE_ADDRESS (dra), 0)
!= TREE_OPERAND (DR_BASE_ADDRESS (drb),0)))
if (!operand_equal_p (DR_BASE_ADDRESS (dra), DR_BASE_ADDRESS (drb), 0)
|| !dr_equal_offsets_p (dra, drb)
|| !tree_int_cst_compare (DR_INIT (dra), DR_INIT (drb))
|| DR_IS_READ (dra) != DR_IS_READ (drb))