Debian Codegraph @

gcc/testsuite/gcc.target/riscv/rvv/vsetvl/pr109773-1.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 f (int32_t *a, int32_t *b, int n)
7 {
8 if (n <= 0)
9 return;
10 int i = n;
11 size_t vl = __riscv_vsetvl_e8mf4 (i);
12 for (; i >= 0; i--)
13 {
14 vint32m1_t v = __riscv_vle32_v_i32m1 (a + i, vl);
15 __riscv_vse32_v_i32m1 (b + i, v, vl);
16 vl = __riscv_vsetvl_e8mf4 (vl);
17 }
18 }
19
20 /* { 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" } } } } */