Hi Juzhe, I wasn't yet able to check this locally so just some minor comment nits:
> +/* Return the vectorization machine mode for RVV according to LMUL. */ > +machine_mode > +preferred_simd_mode (scalar_mode mode) > +{ > + /* We only enable auto-vectorization when TARGET_MIN_VLEN < 128 && > + riscv_autovec_lmul < RVV_M2. Since GCC loop vectorizer report ICE when > we > + enable -march=rv64gc_zve32* and -march=rv32gc_zve64*. in the I believe Kito mentioned this in the last iteration but the comment here doesn't match the code below. You want >= 128 instead of < 128. > + /* TODO: Currently, it will produce ICE for --param > + riscv-autovec-preference=fixed-vlmax. So, we just return NULL_RTX here > + let GCC genearte loads/stores. Ideally, GCC should either report > + Warning message to tell user do not use RVV vector type in function > + arg, or GCC just support function arg calling convention for RVV > + directly. */ > + if (riscv_v_ext_mode_p (mode)) > + return NULL_RTX; will produce -> will cause an ICE genearte -> generate GCC should either... -> we should either warn the user not to use an RVV vector type as function argument ... or support the calling convention.... > +++ b/gcc/testsuite/gcc.target/riscv/rvv/autovec/fixed-vlmax-1.c > @@ -0,0 +1,22 @@ > +/* { dg-do compile } */ > +/* { dg-options "-march=rv32gcv -mabi=ilp32 -mpreferred-stack-boundary=3 > -fno-schedule-insns -fno-schedule-insns2 -O3 --param > riscv-autovec-preference=fixed-vlmax" } */ > + > +#include "riscv_vector.h" > + > +void f (char*); > + > +void stach_check_alloca_1 (vuint8m1_t data, uint8_t *base, int y, ...) > +{ Shouldn't that be stack rather than stach? > +++ b/gcc/testsuite/gcc.target/riscv/rvv/autovec/partial/single_rgroup-1.h > @@ -0,0 +1,106 @@ > +#include <stddef.h> > +#include <stdint.h> > + > +#define N 777 > + > +#define test_1(TYPE) > \ > + TYPE a_##TYPE[N]; > \ > + TYPE b_##TYPE[N]; > \ > + void __attribute__ ((noinline, noclone)) test_1_##TYPE (unsigned int n) > \ Just FYI, you can use ((noipa)) to cover all cases of unwanted "inlining". Not needed here though. > diff --git a/gcc/testsuite/gcc.target/riscv/rvv/autovec/v-1.c > b/gcc/testsuite/gcc.target/riscv/rvv/autovec/v-1.c > new file mode 100644 > index 00000000000..7ff84f60749 > --- /dev/null > +++ b/gcc/testsuite/gcc.target/riscv/rvv/autovec/v-1.c > @@ -0,0 +1,4 @@ > +/* { dg-do compile } */ > +/* { dg-options "-march=rv32gcv -mabi=ilp32d --param > riscv-autovec-preference=scalable -O3 -ftree-vectorize > -fdump-tree-vect-details -save-temps" } */ > + > +#include "template-1.h" I'm a bit wary of these tests not checking anything. Of course we will see if we ICE or not but that I would expect from a "new feature". Couldn't we check something else at least that gives a clue as to what is supposed to happen? Last time I tried some of those locally, we would not vectorize. In case that's intended we could check for e.g. "vectorized 0 loops in function". If not, a comment would still help. Do we actually need -ftree-vectorize at -O3? In general I would prefer to split off common options and set them in rvv.exp already, only giving dg-additional-options for each test. Here we don't share too many apart from -O3 -ftree-vectorize so not yet necessary. Regards Robin