Debian Codegraph @

gcc/testsuite/gcc.target/riscv/rvv/vsetvl/pr109743-4.c

raw
1 /* { dg-do compile } */
2 /* { dg-options "-mrvv-vector-bits=scalable -march=rv32gcv -mabi=ilp32 -fno-tree-vectorize -fno-schedule-insns -fno-schedule-insns2" } */
3
4 #include "riscv_vector.h"
5
6 void
7 f (int32_t *a, int32_t *b, int n)
8 {
9 if (n <= 0)
10 return;
11 int i = n;
12 size_t vl = __riscv_vsetvl_e8mf4 (i);
13 for (; i >= 0; i--)
14 {
15 vint32m1_t v = __riscv_vle32_v_i32m1 (a + i, vl);
16 v = __riscv_vle32_v_i32m1_tu (v, a + i + 100, vl);
17 __riscv_vse32_v_i32m1 (b + i, v, vl);
18
19 if (i >= vl)
20 continue;
21 if (i == 0)
22 return;
23 vl = __riscv_vsetvl_e8mf4 (i);
24 }
25 }
26
27 /* { dg-final { scan-assembler-times {vsetvli\s+[a-x0-9]+,\s*[a-x0-9]+,\s*e32,\s*m1,\s*tu,\s*m[au]} 2 { target { no-opts "-O0" no-opts "-O1" no-opts "-Os" no-opts "-Oz" no-opts "-g" no-opts "-funroll-loops" } } } } */
28 /* { dg-final { scan-assembler-times {vsetvli} 2 { target { no-opts "-O0" no-opts "-O1" no-opts "-Os" no-opts "-Oz" no-opts "-g" no-opts "-funroll-loops" } } } } */