Debian Codegraph @

gcc/testsuite/gcc.dg/vect/costmodel/riscv/rvv/no-dynamic-lmul-1.c

raw
1 /* { dg-do compile } */
2 /* { dg-options "-march=rv64gcv_zvl4096b -mabi=lp64d -O3 -ftree-vectorize -mrvv-max-lmul=dynamic -fdump-tree-vect-details" } */
3
4 #include <stdint-gcc.h>
5
6 void
7 foo (int8_t *restrict a)
8 {
9 for (int i = 0; i < 4096; ++i)
10 a[i] = a[i]-16;
11 }
12
13 void
14 foo2 (int16_t *restrict a)
15 {
16 for (int i = 0; i < 2048; ++i)
17 a[i] = a[i]-16;
18 }
19
20 void
21 foo3 (int32_t *restrict a)
22 {
23 for (int i = 0; i < 1024; ++i)
24 a[i] = a[i]-16;
25 }
26
27 void
28 foo4 (int64_t *restrict a)
29 {
30 for (int i = 0; i < 512; ++i)
31 a[i] = a[i]-16;
32 }
33
34 void
35 foo5 (int8_t *restrict a)
36 {
37 for (int i = 0; i < 16; ++i)
38 a[i] = a[i]-16;
39 }
40
41 void
42 foo6 (int16_t *restrict a)
43 {
44 for (int i = 0; i < 16; ++i)
45 a[i] = a[i]-16;
46 }
47
48 void
49 foo7 (int32_t *restrict a)
50 {
51 for (int i = 0; i < 16; ++i)
52 a[i] = a[i]-16;
53 }
54
55 void
56 foo8 (int64_t *restrict a)
57 {
58 for (int i = 0; i < 16; ++i)
59 a[i] = a[i]-16;
60 }
61
62 /* { dg-final { scan-tree-dump-not "Preferring smaller LMUL loop because it has unexpected spills" "vect" } } */
63 /* { dg-final { scan-assembler-times {vsetvli} 4 } } */
64 /* { dg-final { scan-assembler-times {vsetivli} 4 } } */