Debian Codegraph @

gcc/testsuite/g++.dg/vect/slp-pr99971.cc

raw
1 // { dg-do compile }
2 // { dg-require-effective-target vect_int }
3
4 struct A
5 {
6 unsigned int a, b, c, d;
7
8 A& operator+= (A const& that)
9 {
10 a += that.a;
11 b += that.b;
12 c += that.c;
13 d += that.d;
14 return *this;
15 }
16
17 A& operator-= (A const& that)
18 {
19 a -= that.a;
20 b -= that.b;
21 c -= that.c;
22 d -= that.d;
23 return *this;
24 }
25 } __attribute__((aligned(__BIGGEST_ALIGNMENT__)));
26
27 void test(A& x, A const& y1, A const& y2)
28 {
29 x += y1;
30 x -= y2;
31 }
32
33 // We want to SLP vectorize a single connected SLP subgraph with two instances
34 // { dg-final { scan-tree-dump-not "removing SLP instance" "slp2" } }
35 // { dg-final { scan-tree-dump-times "SLPing BB part" 1 "slp2" } }
36 // { dg-final { scan-tree-dump-times "Vectorizing SLP" 2 "slp2" } }