re PR tree-optimization/37539 (Hang for -O3)

PR tree-optimization/37539
	* tree-vect-transform.c (vect_transform_strided_load): Save vector
	statement in related statement field only for the first load of the
	group of loads with the same data reference.

From-SVN: r140522
This commit is contained in:
Ira Rosen 2008-09-21 08:36:07 +00:00 committed by Ira Rosen
parent ce00be9ede
commit 5abf386014
4 changed files with 74 additions and 10 deletions

View File

@ -1,3 +1,10 @@
2008-09-21 Ira Rosen <irar@il.ibm.com>
PR tree-optimization/37539
* tree-vect-transform.c (vect_transform_strided_load): Save vector
statement in related statement field only for the first load of the
group of loads with the same data reference.
2008-09-20 Adam Nemet <anemet@caviumnetworks.com>
* config/mips/mips.h (TUNE_OCTEON): New macro.

View File

@ -1,3 +1,8 @@
2008-09-21 Ira Rosen <irar@il.ibm.com>
PR tree-optimization/37539
* gcc.dg/vect/pr37539.c: New test.
2008-09-20 Eric Botcazou <ebotcazou@adacore.com>
PR rtl-optimization/33642

View File

@ -0,0 +1,45 @@
/* { dg-require-effective-target vect_int } */
#include <stdarg.h>
#include "tree-vect.h"
__attribute__ ((noinline)) void
ayuv2yuyv_ref (int *d, int *src, int n)
{
char *dest = (char *)d;
int i;
for(i=0;i<n/2;i++){
dest[i*4 + 0] = (src[i*2 + 0])>>16;
dest[i*4 + 1] = (src[i*2 + 1])>>8;
dest[i*4 + 2] = (src[i*2 + 0])>>16;
dest[i*4 + 3] = (src[i*2 + 0])>>0;
}
/* Check results. */
for(i=0;i<n/2;i++){
if (dest[i*4 + 0] != (src[i*2 + 0])>>16
|| dest[i*4 + 1] != (src[i*2 + 1])>>8
|| dest[i*4 + 2] != (src[i*2 + 0])>>16
|| dest[i*4 + 3] != (src[i*2 + 0])>>0)
abort();
}
}
int main ()
{
int d[256], src[128], i;
for (i = 0; i < 128; i++)
src[i] = i;
ayuv2yuyv_ref(d, src, 128);
return 0;
}
/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 2 "vect" { target vect_strided_wide } } } */
/* { dg-final { cleanup-tree-dump "vect" } } */

View File

@ -5947,17 +5947,24 @@ vect_transform_strided_load (gimple stmt, VEC(tree,heap) *dr_chain, int size,
STMT_VINFO_VEC_STMT (vinfo_for_stmt (next_stmt)) = new_stmt;
else
{
gimple prev_stmt =
STMT_VINFO_VEC_STMT (vinfo_for_stmt (next_stmt));
gimple rel_stmt =
STMT_VINFO_RELATED_STMT (vinfo_for_stmt (prev_stmt));
while (rel_stmt)
{
prev_stmt = rel_stmt;
rel_stmt = STMT_VINFO_RELATED_STMT (vinfo_for_stmt (rel_stmt));
}
STMT_VINFO_RELATED_STMT (vinfo_for_stmt (prev_stmt)) = new_stmt;
if (!DR_GROUP_SAME_DR_STMT (vinfo_for_stmt (next_stmt)))
{
gimple prev_stmt =
STMT_VINFO_VEC_STMT (vinfo_for_stmt (next_stmt));
gimple rel_stmt =
STMT_VINFO_RELATED_STMT (vinfo_for_stmt (prev_stmt));
while (rel_stmt)
{
prev_stmt = rel_stmt;
rel_stmt =
STMT_VINFO_RELATED_STMT (vinfo_for_stmt (rel_stmt));
}
STMT_VINFO_RELATED_STMT (vinfo_for_stmt (prev_stmt)) =
new_stmt;
}
}
next_stmt = DR_GROUP_NEXT_DR (vinfo_for_stmt (next_stmt));
gap_count = 1;
/* If NEXT_STMT accesses the same DR as the previous statement,