Debian Codegraph @

gcc/testsuite/gcc.target/riscv/rvv/vsetvl/vlmax_bb_prop-23.c

raw
1 /* { dg-do compile } */
2 /* { dg-options "-mrvv-vector-bits=scalable -march=rv32gcv -mabi=ilp32 -fno-tree-vectorize" } */
3
4 #include "riscv_vector.h"
5
6 void f (int * restrict in, int * restrict out, int n, int cond)
7 {
8 if (cond == 1)
9 {
10 vuint32mf2_t v = *(vuint32mf2_t*)(in + 100);
11 *(vuint32mf2_t*)(out + 100) = v;
12 }
13 else
14 {
15 if (cond == 2)
16 {
17 vuint32mf2_t v = *(vuint32mf2_t*)(in + 200);
18 *(vuint32mf2_t*)(out + 200) = v;
19 out[1000] = 8000;
20 }
21 }
22 for (int i = 0; i < n; i++)
23 {
24 vuint32mf2_t v = *(vuint32mf2_t*)(in + i);
25 *(vuint32mf2_t*)(out + i) = v;
26 }
27 }
28
29 /* { dg-final { scan-assembler-times {vsetvli\s+[a-x0-9]+,\s*zero,\s*e32,\s*mf2,\s*t[au],\s*m[au]} 3 { target { no-opts "-O0" no-opts "-Os" no-opts "-Oz" no-opts "-funroll-loops" no-opts "-g" } } } } */
30 /* { dg-final { scan-assembler-times {vsetvli\s+[a-x0-9]+,\s*zero,\s*e32,\s*mf2,\s*t[au],\s*m[au]\s+\.L[0-9]\:} 1 { target { no-opts "-O0" no-opts "-Os" no-opts "-Oz" no-opts "-funroll-loops" no-opts "-g" } } } } */