Checking the number of pluses is unreliable since the vector size isn't known. Instead see that the unwanted scalar compute is not there. 2021-03-11 Richard Biener <rguenther@suse.de> PR testsuite/98245 * gcc.dg/vect/bb-slp-46.c: Scan for the scalar compute instead of verifying the total number of adds.
29 lines
1022 B
C
29 lines
1022 B
C
/* { dg-do compile } */
|
|
/* { dg-require-effective-target vect_int } */
|
|
/* { dg-additional-options "-fdump-tree-optimized" } */
|
|
|
|
int a[4], b[4];
|
|
int foo ()
|
|
{
|
|
int tem0 = a[0] + b[0];
|
|
int temx = tem0 * 17; /* this fails without a real need */
|
|
int tem1 = a[1] + b[1];
|
|
int tem2 = a[2] + b[2];
|
|
int tem3 = a[3] + b[3];
|
|
int temy = tem3 * 13;
|
|
a[0] = tem0;
|
|
a[1] = tem1;
|
|
a[2] = tem2;
|
|
a[3] = tem3;
|
|
return temx + temy;
|
|
}
|
|
|
|
/* We should extract the live lane from the vectorized add rather than
|
|
keeping the original scalar add.
|
|
??? Because of a too conservative check we fail for temx here. */
|
|
/* { dg-final { scan-tree-dump "optimized: basic block" "slp2" } } */
|
|
/* { dg-final { scan-tree-dump "extracting lane for live stmt" "slp2" } } */
|
|
/* { dg-final { scan-tree-dump-times "extracting lane for live stmt" 2 "slp2" { xfail *-*-* } } } */
|
|
/* { dg-final { scan-tree-dump-not "tem3_\[0-9\]\+ = " "optimized" } } */
|
|
/* { dg-final { scan-tree-dump-not "tem0_\[0-9\]\+ = " "optimized" { xfail *-*-* } } } */
|