Debian Codegraph @

gcc/testsuite/gcc.dg/vect/costmodel/riscv/rvv/pr114516.c

raw
1 /* { dg-do compile } */
2 /* { dg-options "-march=rv64gcv_zba_zbb -mabi=lp64d -mrvv-max-lmul=dynamic -O3 -fdump-tree-vect-details" } */
3
4 typedef float real_t;
5 __attribute__((aligned(64))) real_t a[32000];
6 real_t s315()
7 {
8 for (int i = 0; i < 32000; i++)
9 a[i] = (i * 7) % 32000;
10 real_t x, chksum;
11 int index;
12 for (int nl = 0; nl < 256; nl++) {
13 x = a[0];
14 index = 0;
15 for (int i = 0; i < 32000; ++i) {
16 if (a[i] > x) {
17 x = a[i];
18 index = i;
19 }
20 }
21 chksum = x + (real_t) index;
22 }
23 return index + x + 1;
24 }
25
26 /* { dg-final { scan-assembler {e32,m4} } } */
27 /* { dg-final { scan-assembler-not {e32,m8} } } */
28 /* { dg-final { scan-assembler-not {csrr} } } */
29 /* { dg-final { scan-tree-dump-times "Preferring smaller LMUL loop because it has unexpected spills" 1 "vect" } } */