Debian Codegraph @

gcc/testsuite/gcc.dg/vect/bb-slp-pr114435.c

raw
1 /* { dg-do compile } */
2 /* { dg-require-effective-target vect_double } */
3 /* Predictive commining is supposed to happen. */
4 /* { dg-additional-options "-O3 -fdump-tree-pcom" } */
5
6 struct res {
7 double r0;
8 double r1;
9 double r2;
10 double r3;
11 };
12
13 struct pxl {
14 double v0;
15 double v1;
16 double v2;
17 double v3;
18 };
19
20 #define IS_NAN(x) ((x) == (x))
21
22 void fold(struct res *r, struct pxl *in, double k, int sz)
23 {
24 int i;
25
26 for (i = 0; i < sz; i++) {
27 if (IS_NAN(k)) continue;
28 r->r0 += in[i].v0 * k;
29 r->r1 += in[i].v1 * k;
30 r->r2 += in[i].v2 * k;
31 r->r3 += in[i].v3 * k;
32 }
33 }
34
35 /* { dg-final { scan-tree-dump "# r__r0_lsm\[^\r\n\]* = PHI" "pcom" } } */
36 /* { dg-final { scan-tree-dump "optimized: basic block part vectorized" "slp1" } } */
37 /* { dg-final { scan-tree-dump "# vect\[^\r\n\]* = PHI" "slp1" } } */