Debian Codegraph @

gcc/testsuite/gcc.dg/vect/costmodel/riscv/rvv/dynamic-lmul4-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, int32_t *__restrict d2, int32_t *__restrict d3,
13 int32_t *__restrict d4, int32_t *__restrict d5, int n, int m)
14 {
15 for (int i = 0; i < n; i++)
16 {
17 a[i] = b[i] + c[i];
18 a2[i] = b2[i] + c2[i];
19 a3[i] = b3[i] + c3[i];
20 a4[i] = b4[i] + c4[i];
21 a5[i] = a[i] + a4[i];
22 d[i] = a[i] - a2[i];
23 d2[i] = a2[i] * a[i];
24 d3[i] = a3[i] * a2[i];
25 d4[i] = a2[i] * d2[i];
26 d5[i] = a[i] * a2[i] * a3[i] * a4[i] * d[i];
27 }
28 }
29
30 /* { dg-final { scan-assembler {e32,m4} } } */
31 /* { dg-final { scan-assembler-not {csrr} } } */
32 /* { dg-final { scan-tree-dump-times "Preferring smaller LMUL loop because it has unexpected spills" 1 "vect" } } */
33 /* { dg-final { scan-tree-dump-times "Maximum lmul = 8" 1 "vect" } } */
34 /* { dg-final { scan-tree-dump-times "Maximum lmul = 4" 1 "vect" } } */
35 /* { dg-final { scan-tree-dump-times "Maximum lmul = 2" 1 "vect" } } */