> +static const common_vector_cost xt_c9501_vls_vector_cost = {
> + 3, /* int_stmt_cost */
> + 4, /* fp_stmt_cost */
> + 99, /* gather_load_cost */
> + 32, /* scatter_store_cost */
Heh, we used similarly high values internally. I was hoping we'd cost gathers
a bit better now but perhaps the common-code changes weren't enough.
> + 8, /* segment_permute (2) */
> + 9, /* segment_permute (3) */
> + 9, /* segment_permute (4) */
> + 12, /* segment_permute (5) */
> + 12, /* segment_permute (6) */
> + 12, /* segment_permute (7) */
> + 12, /* segment_permute (8) */
> + 2, /* vec_to_scalar_cost */
> + 2, /* scalar_to_vec_cost */
> + 4, /* permute_cost */
> + 6, /* align_load_cost */
> + 1, /* align_store_cost */
> + 8, /* unalign_load_cost */
> + 2, /* unalign_store_cost */
The store costs seem a bit low. Is this intended?
Out of curiosity, did you fold scalar throughput/vector throughput into the
costs? I.e. a factor of 2 for 4 scalar units vs 2 vector units?
> diff --git
> a/gcc/testsuite/gcc.dg/vect/costmodel/riscv/rvv/xt-c9501fdvt-vect-ldst-cost.c
> b/gcc/testsuite/gcc.dg/vect/costmodel/riscv/rvv/xt-c9501fdvt-vect-ldst-cost.c
> new file mode 100644
> index 000000000..3b56c8355
> --- /dev/null
> +++
> b/gcc/testsuite/gcc.dg/vect/costmodel/riscv/rvv/xt-c9501fdvt-vect-ldst-cost.c
> @@ -0,0 +1,14 @@
> +/* { dg-do compile } */
> +/* { dg-options "-march=rv64gcv_zvfh -mabi=lp64d -mcpu=xt-c9501fdvt -O3
> -mrvv-vector-bits=scalable -fdump-tree-vect-details" } */
> +
> +void
> +add1_i32 (int *restrict a, int *restrict b, int n)
> +{
> + /* b[i] + 1 prevents the loop from being recognised as memcpy. */
Just FYI, you should be able to use -fno-tree-loop-distribute-patterns.
Doesn't matter a lot here, though.
All in all, looks reasonable to me. Please give others a few days to comment
still.
--
Regards
Robin