Improve gcc.dg/vect/bb-slp-32.c testcase
The following adds a correctness check to the combined store/reduce vectorization. * gcc.dg/vect/bb-slp-32.c: Add check for correctness.
This commit is contained in:
parent
dbb718175d
commit
a73744a4f8
1 changed files with 20 additions and 6 deletions
|
@ -1,14 +1,15 @@
|
|||
/* { dg-do compile } */
|
||||
/* { dg-require-effective-target vect_int } */
|
||||
/* { dg-additional-options "-fvect-cost-model=dynamic" } */
|
||||
|
||||
void bar (int *);
|
||||
int foo (int *p, int a, int b)
|
||||
#include "tree-vect.h"
|
||||
|
||||
int __attribute__((noipa))
|
||||
foo (int * __restrict__ x, int *p, int a, int b)
|
||||
{
|
||||
int x[4];
|
||||
p = __builtin_assume_aligned (p, __BIGGEST_ALIGNMENT__);
|
||||
x = __builtin_assume_aligned (x, __BIGGEST_ALIGNMENT__);
|
||||
int tem0, tem1, tem2, tem3;
|
||||
int sum = 0;
|
||||
p = __builtin_assume_aligned (p, __BIGGEST_ALIGNMENT__);
|
||||
tem0 = p[0] + 1 + a;
|
||||
sum += tem0;
|
||||
x[0] = tem0;
|
||||
|
@ -21,6 +22,19 @@ int foo (int *p, int a, int b)
|
|||
tem3 = p[3] + 4 + a;
|
||||
sum += tem3;
|
||||
x[3] = tem3;
|
||||
bar (x);
|
||||
return sum;
|
||||
}
|
||||
|
||||
int x[4] __attribute__((aligned(__BIGGEST_ALIGNMENT__)));
|
||||
int p[4] __attribute__((aligned(__BIGGEST_ALIGNMENT__))) = { 0, 1, 2, 3 };
|
||||
|
||||
int main()
|
||||
{
|
||||
check_vect ();
|
||||
|
||||
if (foo (x, p, 7, 13) != 56)
|
||||
abort ();
|
||||
if (x[0] != 8 || x[1] != 16 || x[2] != 18 || x[3] != 14)
|
||||
abort ();
|
||||
return 0;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue