Debian Codegraph @

gcc/testsuite/gcc.dg/vect/costmodel/riscv/rvv/dynamic-lmul4-3.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 foo2 (int64_t *__restrict a,
7 int8_t *__restrict b,
8 int8_t *__restrict c,
9 int8_t *__restrict a2,
10 int8_t *__restrict b2,
11 int8_t *__restrict c2,
12 int8_t *__restrict a3,
13 int8_t *__restrict b3,
14 int8_t *__restrict c3,
15 int8_t *__restrict a4,
16 int8_t *__restrict b4,
17 int8_t *__restrict c4,
18 int64_t *__restrict a5,
19 int8_t *__restrict b5,
20 int8_t *__restrict c5,
21 int n)
22 {
23 for (int i = 0; i < n; i++){
24 a[i] = b[i] + c[i];
25 b5[i] = b[i] + c[i];
26 a2[i] = b2[i] + c2[i];
27 a3[i] = b3[i] + c3[i];
28 a4[i] = b4[i] + c4[i];
29 a5[i] = a[i] + a4[i];
30 a[i] = a5[i] + b5[i]+ a[i];
31
32 a[i] = a[i] + c[i];
33 b5[i] = a[i] + c[i];
34 a2[i] = a[i] + c2[i];
35 a3[i] = a[i] + c3[i];
36 a4[i] = a[i] + c4[i];
37 a5[i] = a[i] + a4[i];
38 a[i] = a[i] + b5[i]+ a[i];
39 }
40 }
41
42 /* { dg-final { scan-assembler {e32,m4} } } */
43 /* { dg-final { scan-assembler {e64,m8} } } */
44 /* { dg-final { scan-assembler-not {csrr} } } */
45 /* { dg-final { scan-tree-dump-not "Preferring smaller LMUL loop because it has unexpected spills" "vect" } } */
46 /* { dg-final { scan-tree-dump-times "Maximum lmul = 8" 1 "vect" } } */
47 /* { dg-final { scan-tree-dump-times "Maximum lmul = 4" 1 "vect" } } */
48 /* { dg-final { scan-tree-dump-times "Maximum lmul = 2" 1 "vect" } } */