1 /* { dg-do compile } */
2 /* { dg-require-effective-target vect_int } */
3 /* { dg-additional-options "-fdump-tree-optimized" } */
4
5 int a[4], b[4];
6 int foo ()
7 {
8 int tem0 = a[0] + b[0];
9 int temx = tem0 * 17; /* this fails without a real need */
10 int tem1 = a[1] + b[1];
11 int tem2 = a[2] + b[2];
12 int tem3 = a[3] + b[3];
13 int temy = tem3 * 13;
14 a[0] = tem0;
15 a[1] = tem1;
16 a[2] = tem2;
17 a[3] = tem3;
18 return temx + temy;
19 }
20
21 /* We should extract the live lane from the vectorized add rather than
22 keeping the original scalar add.
23 ??? Because of a too conservative check we fail for temx here. */
24 /* { dg-final { scan-tree-dump "optimized: basic block" "slp2" } } */
25 /* { dg-final { scan-tree-dump "extracting lane for live stmt" "slp2" } } */
26 /* { dg-final { scan-tree-dump-times "extracting lane for live stmt" 2 "slp2" { xfail *-*-* } } } */
27 /* { dg-final { scan-tree-dump-not "tem3_\[0-9\]\+ = " "optimized" } } */
28 /* { dg-final { scan-tree-dump-not "tem0_\[0-9\]\+ = " "optimized" { xfail *-*-* } } } */