Debian Codegraph @

gcc/testsuite/gcc.dg/vect/costmodel/riscv/rvv/dynamic-lmul1-4.c

raw
1 /* { dg-do compile } */
2 /* { dg-options "-march=rv32gcv -mabi=ilp32 -O3 -ftree-vectorize -mrvv-max-lmul=dynamic -fdump-tree-vect-details" } */
3
4 #include <stdint-gcc.h>
5
6 void
7 foo (int32_t *__restrict a, int32_t *__restrict b, int32_t *__restrict c,
8 int32_t *__restrict a2, int32_t *__restrict b2, int32_t *__restrict c2,
9 int32_t *__restrict a3, int32_t *__restrict b3, int32_t *__restrict c3,
10 int32_t *__restrict a4, int32_t *__restrict b4, int32_t *__restrict c4,
11 int32_t *__restrict a5, int32_t *__restrict b5, int32_t *__restrict c5,
12 int32_t *__restrict d,
13 int32_t *__restrict d2,
14 int32_t *__restrict d3,
15 int32_t *__restrict d4,
16 int32_t *__restrict d5,
17 int32_t *__restrict e,
18 int32_t *__restrict e2,
19 int32_t *__restrict e3,
20 int32_t *__restrict e4,
21 int32_t *__restrict e5,
22 int32_t *__restrict f,
23 int32_t *__restrict f2,
24 int32_t *__restrict f3,
25 int32_t *__restrict f4,
26 int32_t *__restrict f5,
27 int32_t *__restrict g,
28 int32_t *__restrict g2,
29 int32_t *__restrict g3,
30 int32_t *__restrict g4,
31 int32_t *__restrict g5,
32
33 int32_t *__restrict gg,
34 int32_t *__restrict gg2,
35 int32_t *__restrict gg3,
36 int32_t *__restrict gg4,
37 int32_t *__restrict gg5,
38
39 int32_t *__restrict ggg,
40 int32_t *__restrict ggg2,
41 int32_t *__restrict ggg3,
42 int32_t *__restrict ggg4,
43 int32_t *__restrict ggg5,
44 int n)
45 {
46 for (int i = 0; i < n; i++)
47 {
48 a[i] = b[i] + c[i];
49 b5[i] = b[i] + c[i];
50 a2[i] = b2[i] + c2[i];
51 a3[i] = b3[i] + c3[i];
52 a4[i] = b4[i] + c4[i];
53 a5[i] = a[i] + a4[i];
54
55 d2[i] = a2[i] + c2[i];
56 d3[i] = a3[i] + c3[i];
57 d4[i] = a4[i] + c4[i];
58 d5[i] = a[i] + a4[i];
59 a[i] = a5[i] + b5[i] + a[i];
60
61 c2[i] = a[i] + c[i];
62 c3[i] = b5[i] * a5[i];
63 c4[i] = a2[i] * a3[i];
64 c5[i] = b5[i] * a2[i];
65 c[i] = a[i] + c3[i];
66 c2[i] = a[i] + c4[i];
67
68 e[i] = c2[i] + c2[i];
69 e2[i] = c2[i] + d2[i];
70 e3[i] = d3[i] + d3[i];
71 e4[i] = c4[i] + a4[i];
72 e5[i] = a[i] + a4[i];
73 a5[i] = a[i] + a4[i];
74
75 f[i] = e2[i] + c2[i];
76 f2[i] = e2[i] + d2[i];
77 f3[i] = e3[i] + d3[i];
78 f4[i] = e4[i] + a4[i];
79 f5[i] = e[i] + a4[i];
80 f5[i] = e5[i] + a4[i];
81
82 g[i] = f2[i] + c2[i];
83 g2[i] = f2[i] + d2[i];
84 g3[i] = f3[i] + d3[i];
85 g4[i] = f4[i] + a4[i];
86 g5[i] = f[i] + a4[i];
87 g5[i] = f5[i] + a4[i];
88
89
90 gg[i] = f2[i] + c2[i];
91 gg2[i] = f2[i] + d2[i];
92 gg3[i] = f3[i] + d3[i];
93 gg4[i] = f4[i] + a4[i];
94 gg5[i] = f[i] + a4[i];
95 gg5[i] = f5[i] + a4[i];
96
97
98 ggg[i] = f2[i] + c2[i];
99 ggg2[i] = f2[i] + d2[i];
100 ggg3[i] = f3[i] + d3[i];
101 ggg4[i] = f4[i] + a4[i];
102 ggg5[i] = f[i] + a4[i];
103 ggg5[i] = f5[i] + a4[i];
104
105 a[i] = a[i] + b5[i] + a[i] * a2[i] * a3[i] * a4[i]
106 * a5[i] * c[i] * c2[i] * c3[i] * c4[i] * c5[i]
107 * d[i] * d2[i] * d3[i] * d4[i] * d5[i]
108 * e[i] * e2[i] * e3[i] * e4[i] * e5[i]
109 * f[i] * f2[i] * f3[i] * f4[i] * f5[i]
110 * g[i] * g2[i] * g3[i] * g4[i] * g5[i]
111 * gg[i] * gg2[i] * gg3[i] * gg4[i] * gg5[i]
112 * ggg[i] * ggg2[i] * ggg3[i] * ggg4[i] * ggg5[i];
113 }
114 }
115
116 /* { dg-final { scan-assembler {e32,m1} } } */
117 /* { dg-final { scan-assembler-not {csrr} } } */
118 /* { dg-final { scan-tree-dump-times "Preferring smaller LMUL loop because it has unexpected spills" 3 "vect" } } */
119 /* { dg-final { scan-tree-dump-times "Maximum lmul = 8" 1 "vect" } } */
120 /* { dg-final { scan-tree-dump-times "Maximum lmul = 4" 1 "vect" } } */
121 /* { dg-final { scan-tree-dump-times "Maximum lmul = 2" 1 "vect" } } */