Debian Codegraph @

gcc/testsuite/gcc.dg/vect/costmodel/riscv/rvv/dynamic-lmul1-1.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 int n)
33 {
34 for (int i = 0; i < n; i++)
35 {
36 a[i] = b[i] + c[i];
37 b5[i] = b[i] + c[i];
38 a2[i] = b2[i] + c2[i];
39 a3[i] = b3[i] + c3[i];
40 a4[i] = b4[i] + c4[i];
41 a5[i] = a[i] + a4[i];
42
43 d2[i] = a2[i] + c2[i];
44 d3[i] = a3[i] + c3[i];
45 d4[i] = a4[i] + c4[i];
46 d5[i] = a[i] + a4[i];
47 a[i] = a5[i] + b5[i] + a[i];
48
49 c2[i] = a[i] + c[i];
50 c3[i] = b5[i] * a5[i];
51 c4[i] = a2[i] * a3[i];
52 c5[i] = b5[i] * a2[i];
53 c[i] = a[i] + c3[i];
54 c2[i] = a[i] + c4[i];
55
56 e[i] = c2[i] + c2[i];
57 e2[i] = c2[i] + d2[i];
58 e3[i] = d3[i] + d3[i];
59 e4[i] = c4[i] + a4[i];
60 e5[i] = a[i] + a4[i];
61 a5[i] = a[i] + a4[i];
62
63 f[i] = e2[i] + c2[i];
64 f2[i] = e2[i] + d2[i];
65 f3[i] = e3[i] + d3[i];
66 f4[i] = e4[i] + a4[i];
67 f5[i] = e[i] + a4[i];
68 f5[i] = e5[i] + a4[i];
69
70 g[i] = f2[i] + c2[i];
71 g2[i] = f2[i] + d2[i];
72 g3[i] = f3[i] + d3[i];
73 g4[i] = f4[i] + a4[i];
74 g5[i] = f[i] + a4[i];
75 g5[i] = f5[i] + a4[i];
76
77 a[i] = a[i] + b5[i] + a[i] * a2[i] * a3[i] * a4[i]
78 * a5[i] * c[i] * c2[i] * c3[i] * c4[i] * c5[i]
79 * d[i] * d2[i] * d3[i] * d4[i] * d5[i]
80 * e[i] * e2[i] * e3[i] * e4[i] * e5[i]
81 * f[i] * f2[i] * f3[i] * f4[i] * f5[i]
82 * g[i] * g2[i] * g3[i] * g4[i] * g5[i];
83 }
84 }
85
86 /* { dg-final { scan-assembler {e32,m1} } } */
87 /* { dg-final { scan-assembler-not {csrr} } } */
88 /* { dg-final { scan-tree-dump-times "Preferring smaller LMUL loop because it has unexpected spills" 3 "vect" } } */
89 /* { dg-final { scan-tree-dump-times "Maximum lmul = 8" 1 "vect" } } */
90 /* { dg-final { scan-tree-dump-times "Maximum lmul = 4" 1 "vect" } } */
91 /* { dg-final { scan-tree-dump-times "Maximum lmul = 2" 1 "vect" } } */