no-tree-scev-cprop-vect-iv-1.c: Restored.
2007-09-03 H.J. Lu <hongjiu.lu@intel.com> * gcc.dg/vect/no-tree-scev-cprop-vect-iv-1.c: Restored. Moved to ... * gcc.dg/vect/no-scevccp-vect-iv-1.c: New test. * gcc.dg/vect/no-tree-scev-cprop-vect-iv-2.c: Restored. Moved to ... * gcc.dg/vect/no-scevccp-vect-iv-2.c: New test. * gcc.dg/vect/no-tree-scev-cprop-vect-iv-3.c: Restored. Moved to ... * gcc.dg/vect/no-scevccp-vect-iv-3.c: New test. From-SVN: r128045
This commit is contained in:
parent
9816d522ce
commit
7ddb87782d
7 changed files with 122 additions and 0 deletions
|
@ -1,3 +1,15 @@
|
|||
2007-09-03 H.J. Lu <hongjiu.lu@intel.com>
|
||||
|
||||
* gcc.dg/vect/no-tree-scev-cprop-vect-iv-1.c: Restored. Moved
|
||||
to ...
|
||||
* gcc.dg/vect/no-scevccp-vect-iv-1.c: New test.
|
||||
* gcc.dg/vect/no-tree-scev-cprop-vect-iv-2.c: Restored. Moved
|
||||
to ...
|
||||
* gcc.dg/vect/no-scevccp-vect-iv-2.c: New test.
|
||||
* gcc.dg/vect/no-tree-scev-cprop-vect-iv-3.c: Restored. Moved
|
||||
to ...
|
||||
* gcc.dg/vect/no-scevccp-vect-iv-3.c: New test.
|
||||
|
||||
2007-09-03 Jesper Nilsson <jesper.nilsson@axis.com>
|
||||
|
||||
* gcc.target/cris/builtin_bswap_v3.c: New testcase.
|
||||
|
|
34
gcc/testsuite/gcc.dg/vect/no-scevccp-vect-iv-1.c
Normal file
34
gcc/testsuite/gcc.dg/vect/no-scevccp-vect-iv-1.c
Normal file
|
@ -0,0 +1,34 @@
|
|||
/* { dg-require-effective-target vect_int } */
|
||||
|
||||
#include <stdarg.h>
|
||||
#include "tree-vect.h"
|
||||
|
||||
#define N 26
|
||||
|
||||
int main1 (int X)
|
||||
{
|
||||
int s = X;
|
||||
int i;
|
||||
|
||||
/* vectorization of reduction with induction.
|
||||
Need -fno-tree-scev-cprop or else the loop is eliminated. */
|
||||
for (i = 0; i < N; i++)
|
||||
s += i;
|
||||
|
||||
return s;
|
||||
}
|
||||
|
||||
int main (void)
|
||||
{
|
||||
int s;
|
||||
check_vect ();
|
||||
|
||||
s = main1 (3);
|
||||
if (s != 328)
|
||||
abort ();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
|
||||
/* { dg-final { cleanup-tree-dump "vect" } } */
|
49
gcc/testsuite/gcc.dg/vect/no-scevccp-vect-iv-2.c
Normal file
49
gcc/testsuite/gcc.dg/vect/no-scevccp-vect-iv-2.c
Normal file
|
@ -0,0 +1,49 @@
|
|||
/* { dg-require-effective-target vect_int } */
|
||||
|
||||
#include <stdarg.h>
|
||||
#include "tree-vect.h"
|
||||
|
||||
#define N 16
|
||||
|
||||
int main1 ()
|
||||
{
|
||||
int arr1[N];
|
||||
int k = 0;
|
||||
int m = 3, i = 0;
|
||||
|
||||
/* Vectorization of induction that is used after the loop.
|
||||
Currently vectorizable because scev_ccp disconnects the
|
||||
use-after-the-loop from the iv def inside the loop. */
|
||||
|
||||
do {
|
||||
k = k + 2;
|
||||
arr1[i] = k;
|
||||
m = m + k;
|
||||
i++;
|
||||
} while (i < N);
|
||||
|
||||
/* check results: */
|
||||
for (i = 0; i < N; i++)
|
||||
{
|
||||
if (arr1[i] != 2+2*i)
|
||||
abort ();
|
||||
}
|
||||
|
||||
return m + k;
|
||||
}
|
||||
|
||||
int main (void)
|
||||
{
|
||||
int res;
|
||||
|
||||
check_vect ();
|
||||
|
||||
res = main1 ();
|
||||
if (res != 32 + 275)
|
||||
abort ();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { xfail *-*-* } } } */
|
||||
/* { dg-final { cleanup-tree-dump "vect" } } */
|
27
gcc/testsuite/gcc.dg/vect/no-scevccp-vect-iv-3.c
Normal file
27
gcc/testsuite/gcc.dg/vect/no-scevccp-vect-iv-3.c
Normal file
|
@ -0,0 +1,27 @@
|
|||
/* { dg-do compile } */
|
||||
/* { dg-require-effective-target vect_int } */
|
||||
|
||||
#include <stdarg.h>
|
||||
#include "tree-vect.h"
|
||||
|
||||
#define N 26
|
||||
|
||||
unsigned int main1 ()
|
||||
{
|
||||
unsigned short i;
|
||||
unsigned int intsum = 0;
|
||||
|
||||
/* vectorization of reduction with induction, and widenning sum:
|
||||
sum shorts into int.
|
||||
Need -fno-tree-scev-cprop or else the loop is eliminated. */
|
||||
for (i = 0; i < N; i++)
|
||||
{
|
||||
intsum += i;
|
||||
}
|
||||
|
||||
return intsum;
|
||||
}
|
||||
|
||||
/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target vect_widen_sum_hi_to_si } } } */
|
||||
/* { dg-final { scan-tree-dump-times "vect_recog_widen_sum_pattern: detected" 1 "vect" { target vect_widen_sum_hi_to_si } } } */
|
||||
/* { dg-final { cleanup-tree-dump "vect" } } */
|
Loading…
Add table
Reference in a new issue